本文整理汇总了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);
}