feat:material
This commit is contained in:
@@ -147,6 +147,25 @@ class MaterialService extends BaseService{
|
||||
return $this->return->success('success',$list);
|
||||
}
|
||||
|
||||
public function materialStockEdit(): array{
|
||||
$id = (int)$this->request->input('id');
|
||||
$currentStock = (double)$this->request->input('current_stock');
|
||||
$unitPrice = (double)$this->request->input('unit_price');
|
||||
|
||||
$info = $this->MaterialStockModel->where('id',$id)->first();
|
||||
|
||||
if (!empty($currentStock)){
|
||||
$info->current_stock = $currentStock;
|
||||
}
|
||||
if (!empty($unitPrice)){
|
||||
$info->unit_price = $unitPrice;
|
||||
}
|
||||
|
||||
if (!$info->save()) throw new ErrException('修改失败');
|
||||
|
||||
return $this->return->success();
|
||||
}
|
||||
|
||||
public function costListByChef():array
|
||||
{
|
||||
$limit = (int)$this->request->input('limit', 10);
|
||||
|
||||
Reference in New Issue
Block a user