新增采购产品出库上浮比例功能
- 在采购产品报价逻辑中添加出库价格字段 - 新增出库上浮比例列表接口 - 更新采购产品报价控制器,增加出库价格参数
This commit is contained in:
parent
a2620f7c9a
commit
32b6dab76c
@ -105,15 +105,16 @@ class PurchaseProductOfferLogic extends BaseLogic
|
|||||||
'buyer_nums' => $params['buyer_nums'],
|
'buyer_nums' => $params['buyer_nums'],
|
||||||
'supplier_id' => $params['supplier_id'],
|
'supplier_id' => $params['supplier_id'],
|
||||||
'price' => $params['purchase'],
|
'price' => $params['purchase'],
|
||||||
|
'outbound_price' => $params['outbound_price'],
|
||||||
'total_price' => $params['total_price'],
|
'total_price' => $params['total_price'],
|
||||||
]);
|
]);
|
||||||
$find=BeforehandOrderCartInfo::where(['bhoid'=>$params['bhoid'],'product_id'=>$offer['product_id']])->find();
|
// $find=BeforehandOrderCartInfo::where(['bhoid'=>$params['bhoid'],'product_id'=>$offer['product_id']])->find();
|
||||||
if($find){
|
// if($find){
|
||||||
$find->purchase=$params['purchase'];
|
// $find->purchase=$params['purchase'];
|
||||||
$find->total_price=bcmul($find['cart_num'],$params['price'],2);
|
// $find->total_price=bcmul($find['cart_num'],$params['price'],2);
|
||||||
$find->price=$params['price'];
|
// $find->price=$params['price'];
|
||||||
$find->save();
|
// $find->save();
|
||||||
}
|
// }
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
@ -29,11 +29,15 @@ class PurchaseProductOfferController extends BaseApiController
|
|||||||
return $this->dataLists(new PurchaseProductOfferLists());
|
return $this->dataLists(new PurchaseProductOfferLists());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交采购信息
|
||||||
|
*/
|
||||||
public function offer_update(){
|
public function offer_update(){
|
||||||
$params=$this->request->post();
|
$params=$this->request->post();
|
||||||
$data=[
|
$data=[
|
||||||
'buyer_nums'=>$params['nums'],
|
'buyer_nums'=>$params['nums'],
|
||||||
'price'=>$params['price'],
|
'price'=>$params['price'],
|
||||||
|
'outbound_price'=>$params['outbound_price'],
|
||||||
'total_price'=>$params['total_price'],
|
'total_price'=>$params['total_price'],
|
||||||
'buyer_confirm'=>1,
|
'buyer_confirm'=>1,
|
||||||
];
|
];
|
||||||
@ -43,6 +47,18 @@ class PurchaseProductOfferController extends BaseApiController
|
|||||||
}else{
|
}else{
|
||||||
return $this->fail('提交失败');
|
return $this->fail('提交失败');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库上浮比例列表
|
||||||
|
*/
|
||||||
|
public function outbound_floating_lv(){
|
||||||
|
$data[]=[
|
||||||
|
['name'=>'干货/5','value'=>0.05],
|
||||||
|
['name'=>'鲜货/15','value'=>0.15],
|
||||||
|
['name'=>'粮油/5','value'=>0.05],
|
||||||
|
];
|
||||||
|
return $this->success('ok',$data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user