Merge pull request 'dev' (#254) from dev into main

Reviewed-on: #254
This commit is contained in:
mkm 2024-10-11 21:13:19 +08:00
commit 5ce865dea0
3 changed files with 26 additions and 9 deletions

View File

@ -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) {

View File

@ -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);
}
} }

View File

@ -51,7 +51,7 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI
return PurchaseProductOffer::where($this->searchWhere) 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']) ->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) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['product_id'=>'desc','id' => 'desc'])
->select()->each(function($item){ ->select()->each(function($item){
$find=StoreProduct::where('id',$item->product_id)->find(); $find=StoreProduct::where('id',$item->product_id)->find();
$item->store_name=$find->store_name; $item->store_name=$find->store_name;