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


PHP Warehouse::find方法代碼示例

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


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

示例1: getWarehouseList

 public function getWarehouseList()
 {
     /* Load Model of warehouses and setup the list */
     App::import('Model', 'Warehouse');
     $warehouse = new Warehouse();
     /* Set conditions */
     $options = array('fields' => array('City.city_name', 'Warehouse.warehouse_name', 'Warehouse.id'), 'joins' => array(array('alias' => 'City', 'table' => 'cities', 'type' => 'LEFT', 'conditions' => array('City.id = WarehouseDesc.city_id'))), 'conditions' => array('WarehouseDesc.is_deleted' => 0));
     $getWarehouseAllWithStatus = $warehouse->find('all', $options);
     $newWarehouseList = array();
     if ($warehouse->find('count') > 0) {
         foreach ($getWarehouseAllWithStatus as $index => $value) {
             $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"] . " (" . $value["City"]["city_name"] . ")";
         }
     }
     return $getWarehouseList = $newWarehouseList;
 }
開發者ID:agashish,項目名稱:test_new,代碼行數:16,代碼來源:CommonHelper.php

示例2: getWarehouseList

 public function getWarehouseList()
 {
     /* Load Model of warehouses and setup the list */
     App::import('Model', 'Warehouse');
     $warehouse = new Warehouse();
     $getWarehouseAllWithStatus = $warehouse->find('all');
     $newWarehouseList = array();
     if ($warehouse->find('count') > 0) {
         foreach ($getWarehouseAllWithStatus as $index => $value) {
             if ($value["WarehouseDesc"]["is_deleted"] == "1") {
                 $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"] . " (Under Deleted)";
             } else {
                 $newWarehouseList[$value["Warehouse"]["id"]] = $value["Warehouse"]["warehouse_name"];
             }
         }
     }
     return $getWarehouseList = $newWarehouseList;
 }
開發者ID:agashish,項目名稱:wms_master,代碼行數:18,代碼來源:CommonComponent.php

示例3: postWarehouseEdit

 public function postWarehouseEdit($WarehouseId)
 {
     $rules = array('name' => 'required|min:2|unique:warehouse,name,' . $WarehouseId, 'user_id' => 'unique:warehouse,user_id,' . $WarehouseId);
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('goods/warehouse-edit/' . $WarehouseId)->withErrors($validator)->withInput();
     }
     $warehouse = Warehouse::find($WarehouseId);
     $warehouse->name = Input::get('name');
     $warehouse->user_id = Input::get('user_id');
     $warehouse->save();
     return Redirect::to('goods/warehouse-all')->with('success', '倉庫更新成功!');
 }
開發者ID:huanghua581,項目名稱:erp,代碼行數:13,代碼來源:GoodsController.php

示例4: getRecoverEmptyGood

 public function getRecoverEmptyGood($goodEmptyId)
 {
     $good_empty = GoodEmpty::find($goodEmptyId);
     $branch = Branch::find($good_empty->branch_id);
     $warehouse = Warehouse::find(Input::get('warehouse_id'));
     $products = Product::where('store', '>', 0)->where('price', '>', 0)->where('warehouse_id', $warehouse->id)->where('good_id', '=', $good_empty->good_id)->get();
     return View::make('branch.recover-empty-good')->with(compact('products'))->with(compact('branch'))->with(compact('warehouse'));
 }
開發者ID:huanghua581,項目名稱:erp,代碼行數:8,代碼來源:BranchController.php

示例5: getPrint

 public function getPrint()
 {
     $warehouse = Warehouse::all();
     $users = User::where('grade', '10')->where('disable', '0')->get();
     $warehouse_name = '';
     $user_name = '';
     $prints = array();
     $count_prints = 0;
     $warehouse_id = Input::get('warehouse_id');
     $user_id = Input::get('user_id');
     if ($warehouse_id === '0' || $user_id === '0') {
         return Redirect::to('picking/print')->with('error', '倉庫和業務員都需要選擇!');
     }
     if ($warehouse_id && $user_id) {
         $warehouse_name = Warehouse::find($warehouse_id)->pluck('name');
         $user = User::find($user_id);
         $user_name = $user->username;
         $prints = Delivery::where('warehouse_id', $warehouse_id)->where('status', '2')->where('user_id', $user_id)->with('items', 'user')->get();
         $count_prints = count($prints);
     }
     return View::make('picking.print')->with(compact('warehouse'))->with(compact('users'))->with(compact('prints'))->with(compact('warehouse_name'))->with(compact('user_name'))->with(compact('count_prints'));
 }
開發者ID:huanghua581,項目名稱:erp,代碼行數:22,代碼來源:PickingController.php

示例6: postEditModal

 /**
  * postEditModal
  */
 public function postEditModal()
 {
     $stockup = Input::get('stockup');
     $stockup = json_decode($stockup, true);
     $order_id = Input::get('order_id');
     $order = Order::find(Input::get('order_id'));
     //添加表
     $stock = new Stockup();
     $stock->order_id = $order_id;
     $stock->stockup_count = 0;
     $stock->item_count = 0;
     $stock->amount = 0.0;
     $stock->operator = '5';
     $stock->auditors = '4';
     $stock->save();
     //添加細表
     $stockup_count = $item_count = $amount = 0;
     foreach ($order->orderdetails as $orderdetail) {
         $confirm_quantity = 0;
         $ready_stock = $real_stock = 0;
         if ($stockup[$orderdetail->item->code]['stockup']) {
             foreach ($stockup[$orderdetail->item->code]['stockup'] as $value) {
                 //庫存 有位置 identity status
                 if (isset($value['position']) && !empty($value['position'])) {
                     $stockdetail = new StockupDetail();
                     $stockdetail->stockup_id = $stock->id;
                     $stockdetail->identity = isset($value['item']) ? $value['item'] : '';
                     $stockdetail->supplier_id = 0;
                     $stockdetail->item_id = $orderdetail->item->id;
                     $stockdetail->quantity = $value['quantity'];
                     $stockdetail->position = $value['position'];
                     $stockdetail->status = 2;
                     $stockdetail->packaged = 0;
                     $stockdetail->save();
                     //位置減庫存
                     $real_stock += $value['quantity'];
                     //預錄入狀態更新
                     if (isset($value['item'])) {
                         $item_detail = ItemReceivedPackageDetail::find($value['item']);
                         $item_detail->status = 3;
                         $item_detail->save();
                     }
                     //位置庫存
                     $item_position = Warehouse::find($value['position']);
                     $item_position->quantity -= $value['quantity'];
                     $item_position->save();
                 } else {
                     //預錄入 沒有位置
                     $stockdetail = new StockupDetail();
                     $stockdetail->stockup_id = $stock->id;
                     $stockdetail->identity = $value['item'];
                     $stockdetail->supplier_id = '';
                     $stockdetail->item_id = $orderdetail->item->id;
                     $stockdetail->quantity = $value['quantity'];
                     $stockdetail->position = '';
                     $stockdetail->status = 1;
                     $stockdetail->packaged = 0;
                     $stockdetail->save();
                     $ready_stock += $value['quantity'];
                     //預錄入狀態更新
                     $item_detail = ItemReceivedPackageDetail::find($value['item']);
                     $item_detail->status = 3;
                     $item_detail->save();
                 }
                 $item_count++;
                 $stockup_count += $value['quantity'];
                 $confirm_quantity += $value['quantity'];
                 $amount += $value['quantity'] * $orderdetail->confirm_price;
                 //減狀態
                 //減少庫存
             }
         }
         //減少庫存總數
         $item = Item::find($orderdetail->item->id);
         $item->stock -= $real_stock;
         $item->readystock -= $ready_stock;
         $item->save();
         //更新訂單備貨數量
         $detail = OrderDetail::find($orderdetail->id);
         $detail->confirm_quantity = $confirm_quantity;
         $detail->save();
     }
     //總計,匹數,米數,金額
     $stock->stockup_count = $stockup_count;
     $stock->item_count = $item_count;
     $stock->amount = $amount;
     $stock->save();
     //更新訂單狀態|應付款項合計
     $order->item_fee = $amount;
     $order->order_status = 'order_stockuped';
     $order->save();
     return Redirect::to('admin/stockups');
 }
開發者ID:yanguanglan,項目名稱:sz,代碼行數:96,代碼來源:StockupsController.php

示例7: d011

 public function d011($id = null)
 {
     $ruang = Warehouse::find($id);
     $ruang->delete();
     ZiUtil::to_json(json_encode("{ success: true}"));
 }
開發者ID:suryakencana,項目名稱:tekkadan,代碼行數:6,代碼來源:Warehouse.php


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