commit
5ce865dea0
@ -105,15 +105,16 @@ class PurchaseProductOfferLogic extends BaseLogic
|
||||
'buyer_nums' => $params['buyer_nums'],
|
||||
'supplier_id' => $params['supplier_id'],
|
||||
'price' => $params['purchase'],
|
||||
'outbound_price' => $params['outbound_price'],
|
||||
'total_price' => $params['total_price'],
|
||||
]);
|
||||
$find=BeforehandOrderCartInfo::where(['bhoid'=>$params['bhoid'],'product_id'=>$offer['product_id']])->find();
|
||||
if($find){
|
||||
$find->purchase=$params['purchase'];
|
||||
$find->total_price=bcmul($find['cart_num'],$params['price'],2);
|
||||
$find->price=$params['price'];
|
||||
$find->save();
|
||||
}
|
||||
// $find=BeforehandOrderCartInfo::where(['bhoid'=>$params['bhoid'],'product_id'=>$offer['product_id']])->find();
|
||||
// if($find){
|
||||
// $find->purchase=$params['purchase'];
|
||||
// $find->total_price=bcmul($find['cart_num'],$params['price'],2);
|
||||
// $find->price=$params['price'];
|
||||
// $find->save();
|
||||
// }
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Throwable $e) {
|
||||
|
@ -29,11 +29,15 @@ class PurchaseProductOfferController extends BaseApiController
|
||||
return $this->dataLists(new PurchaseProductOfferLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交采购信息
|
||||
*/
|
||||
public function offer_update(){
|
||||
$params=$this->request->post();
|
||||
$data=[
|
||||
'buyer_nums'=>$params['nums'],
|
||||
'price'=>$params['price'],
|
||||
'outbound_price'=>$params['outbound_price'],
|
||||
'total_price'=>$params['total_price'],
|
||||
'buyer_confirm'=>1,
|
||||
];
|
||||
@ -43,6 +47,18 @@ class PurchaseProductOfferController extends BaseApiController
|
||||
}else{
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -51,7 +51,7 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI
|
||||
return PurchaseProductOffer::where($this->searchWhere)
|
||||
->field(['id', 'order_id', 'product_id', 'price', 'buyer_nums', 'unit', 'is_buyer', 'buyer_confirm','need_num', 'buyer_id', 'status', 'mark'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->order(['product_id'=>'desc','id' => 'desc'])
|
||||
->select()->each(function($item){
|
||||
$find=StoreProduct::where('id',$item->product_id)->find();
|
||||
$item->store_name=$find->store_name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user