From a2620f7c9ac965d4a0137d15940cfafe2b452b15 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 11 Oct 2024 18:00:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=BC=98=E6=83=A0=E5=88=97=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在PurchaseProductOfferLists类中,修改了查询排序逻辑,先按product_id降序排列,然后在按id降序排列。这样可以更合理地组织返回的列表,根据产品ID进行分组,每组内部再按照记录ID降序排序。 --- .../lists/purchase_product_offer/PurchaseProductOfferLists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php index 3470eb21f..6a4cd723e 100644 --- a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -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; From 32b6dab76ce52d70d9684ebeeae9029d40c692aa Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 11 Oct 2024 21:09:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=87=BA=E5=BA=93=E4=B8=8A=E6=B5=AE=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在采购产品报价逻辑中添加出库价格字段 - 新增出库上浮比例列表接口 - 更新采购产品报价控制器,增加出库价格参数 --- .../PurchaseProductOfferLogic.php | 15 ++++++++------- .../PurchaseProductOfferController.php | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index bae452566..a4d78e86f 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -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) { diff --git a/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php b/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php index 658a806f7..d6df678fa 100644 --- a/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php +++ b/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php @@ -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); + } + } \ No newline at end of file