當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Warehouse::where方法代碼示例

本文整理匯總了PHP中Warehouse::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Warehouse::where方法的具體用法?PHP Warehouse::where怎麽用?PHP Warehouse::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Warehouse的用法示例。


在下文中一共展示了Warehouse::where方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getIndex

 public function getIndex()
 {
     // 管理員
     //
     if (Auth::user()->grade == 10) {
         $delivery = Delivery::where('user_id', Auth::user()->id)->orderBy('t_begin', 'desc')->paginate();
         $count = Delivery::where('user_id', Auth::user()->id)->count();
     } else {
         if (Auth::user()->grade == 6) {
             $w = Warehouse::where('user_id', Auth::user()->id)->lists('id');
             $delivery = Delivery::whereIn('warehouse_id', $w)->orderBy('t_begin', 'desc')->paginate();
             $count = Delivery::whereIn('warehouse_id', $w)->count();
         } else {
             $delivery = Delivery::orderBy('t_begin', 'desc')->paginate();
             $count = Delivery::count();
         }
     }
     return View::make('picking.index')->with('delivery', $delivery)->with(compact('count'));
 }
開發者ID:huanghua581,項目名稱:erp,代碼行數:19,代碼來源:PickingController.php

示例2: postModal

 /**
  * postModal (入庫確認)
  */
 public function postModal()
 {
     //itemReceivedPackageDetail->id
     $id = Input::get('id');
     $position = Input::get('readyposition');
     $itemReceivedPackageDetail = ItemReceivedPackageDetail::find($id);
     $itemReceivedPackageDetail->status = 2;
     $itemReceivedPackageDetail->readyposition = $position;
     $itemReceivedPackageDetail->save();
     //曆史入庫記錄
     $historyWareHouse = new HistoryWarehouse();
     $historyWareHouse->identity = $itemReceivedPackageDetail->identity;
     $historyWareHouse->item = $itemReceivedPackageDetail->item;
     $historyWareHouse->batch = $itemReceivedPackageDetail->batch;
     $historyWareHouse->quantity = $itemReceivedPackageDetail->quantity;
     $historyWareHouse->position = $position;
     $historyWareHouse->operator = 5;
     $historyWareHouse->save();
     //庫存匯總
     $wareHouse = Warehouse::where('item', $itemReceivedPackageDetail->item)->where('position', $position)->first();
     if ($wareHouse) {
         $wareHouse->quantity = $wareHouse->quantity + $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     } else {
         $wareHouse = new Warehouse();
         $wareHouse->item = $itemReceivedPackageDetail->item;
         $wareHouse->position = $position;
         $wareHouse->quantity = $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     }
     //更新item總庫存
     $items = Item::where('code', $itemReceivedPackageDetail->item)->first();
     $items->stock += $itemReceivedPackageDetail->quantity;
     $items->readystock -= $itemReceivedPackageDetail->quantity;
     $items->save();
     return Redirect::back();
 }
開發者ID:yanguanglan,項目名稱:sz,代碼行數:40,代碼來源:WareHouseController.php

示例3: getAllocation

 public function getAllocation($ProductId)
 {
     $product = Product::find($ProductId);
     $warehouse = Warehouse::where('id', '<>', $product->warehouse_id)->get();
     return View::make('goods.allocation')->with('warehouse', $warehouse)->with('product', $product)->with('good', Good::find($product->good_id));
 }
開發者ID:huanghua581,項目名稱:erp,代碼行數:6,代碼來源:GoodsController.php

示例4: postPackageCheckedin

 /**
  * postPackageCheckedin (拆包檢驗入庫)
  */
 public function postPackageCheckedin()
 {
     $id = Input::get('id');
     $position = Input::get('readyposition');
     $itemReceivedPackageDetail = ItemReceivedPackageDetail::find($id);
     $itemReceivedPackageDetail->status = 2;
     $itemReceivedPackageDetail->readyposition = $position;
     $itemReceivedPackageDetail->save();
     //曆史入庫記錄
     $historyWareHouse = new HistoryWarehouse();
     $historyWareHouse->identity = $itemReceivedPackageDetail->identity;
     $historyWareHouse->item = $itemReceivedPackageDetail->item;
     $historyWareHouse->batch = $itemReceivedPackageDetail->batch;
     $historyWareHouse->quantity = $itemReceivedPackageDetail->quantity;
     $historyWareHouse->position = $position;
     $historyWareHouse->operator = 5;
     $historyWareHouse->save();
     //庫存匯總
     $wareHouse = Warehouse::where('item', $itemReceivedPackageDetail->item)->where('position', $position)->first();
     if ($wareHouse) {
         $wareHouse->quantity = $wareHouse->quantity + $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     } else {
         $wareHouse = new Warehouse();
         $wareHouse->item = $itemReceivedPackageDetail->item;
         $wareHouse->position = $position;
         $wareHouse->quantity = $itemReceivedPackageDetail->quantity;
         $wareHouse->save();
     }
     //更新item總庫存
     $items = Item::where('code', $itemReceivedPackageDetail->item)->first();
     $items->stock += $itemReceivedPackageDetail->quantity;
     $items->readystock -= $itemReceivedPackageDetail->quantity;
     $items->save();
     //到包日期|包號
     $itemReceivedPackage = ItemReceivedPackage::find($itemReceivedPackageDetail->package_id);
     $package_checked_date = $itemReceivedPackage->package_checked_date;
     $package_no = $itemReceivedPackage->package_no;
     //供應商
     $supplier = Supplier::find($itemReceivedPackageDetail->supplier_id);
     //details
     $itemReceivedPackageDetails = ItemReceivedPackageDetail::where('package_id', $itemReceivedPackageDetail->package_id)->orderBy('status')->get();
     return View::make('admin.itemreceive.packagedetail')->with('itemReceivedPackageDetails', $itemReceivedPackageDetails)->with('supplier', $supplier)->with('package_checked_date', $package_checked_date)->with('package_no', $package_no);
 }
開發者ID:yanguanglan,項目名稱:sz,代碼行數:47,代碼來源:ItemReceiveController.php


注:本文中的Warehouse::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。