fix:depot_purchase
This commit is contained in:
@@ -195,6 +195,7 @@ class DepotService extends BaseService{
|
||||
else{
|
||||
//库存增加
|
||||
$materialStock->current_stock = $materialStock->current_stock + $number;
|
||||
$materialStock->unit_price = $purchase_price;
|
||||
}
|
||||
|
||||
if (!$depotPurchase->save() || !$materialStock->save()) throw new ErrException('采购添加失败');
|
||||
@@ -298,6 +299,7 @@ class DepotService extends BaseService{
|
||||
->when($kitchenId,function ($query) use ($kitchenId) {
|
||||
$query->where('depot_purchase.kitchen_id',$kitchenId);
|
||||
})
|
||||
->orderBy('depot_purchase.create_time','desc')
|
||||
->paginate($limit,['depot_purchase.*','material.name as material_name','supplier.name as supplier_name','depot.name as depot_name'])
|
||||
->toArray();
|
||||
|
||||
|
||||
@@ -387,15 +387,13 @@ POST {{host}}/admin/depot/depot_purchase
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{admin_token}}
|
||||
|
||||
depot_id=1&material_id=1&supplier_id=1&purchase_price=60&number=2&city_id=1&kitchen_id=1
|
||||
depot_id=1&material_id=1&supplier_id=1&purchase_price=60&number=5&city_id=1&kitchen_id=1
|
||||
|
||||
### 采购数量修改
|
||||
POST {{host}}/admin/depot/depot_purchase_update
|
||||
### 采购退货
|
||||
POST {{host}}/admin/depot/depot_purchase_back?id=1
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{admin_token}}
|
||||
|
||||
id=1&number=9
|
||||
|
||||
### 排菜列表
|
||||
GET {{host}}/admin/dish/list?limit=10
|
||||
content-type: application/json
|
||||
|
||||
Reference in New Issue
Block a user