本文整理匯總了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'));
}
示例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();
}
示例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));
}
示例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);
}