From 209d4366bfe61ae943844587c98dfb6f1252094d Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 20 Jan 2025 14:32:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E9=A2=84=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/beforehand_order/BeforehandOrderLists.php | 4 +++- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index a98521e58..e1bc72826 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -75,8 +75,10 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte default: break; } - if (!empty($this->params['store_staff_id'])) { + if (!empty($this->params['store_staff_id']) || !empty($this->params['is_store'])) { $this->searchWhere[] = ['store_staff_id', '>', 0]; + } else { + $this->searchWhere[] = ['store_staff_id', '=', 0]; } if ($order_rk!='') { $oid=WarehouseOrder::where('financial_pm',1)->where('code','like','%'.$order_rk)->column('id'); diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index b12a578dc..13ad4ad0a 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -438,6 +438,7 @@ class BeforehandOrderLogic extends BaseLogic WarehouseOrder::where('id', $res['id'])->update(['total_price' => $totalPrice, 'nums' => $finds['nums']]); $order->save(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $totalPrice]); BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->update(['is_buyer' => -1]); + self::confirm(['id' => $params['bhoid']]); Db::commit(); return true; } catch (\Throwable $e) { @@ -1003,6 +1004,13 @@ class BeforehandOrderLogic extends BaseLogic if ($params['store_id'] > 0) { $where2[] = ['store_id', '=', $params['store_id']]; } + if (!empty($params['is_store'])) { + $where[] = ['store_staff_id', '>', 0]; + $where2[] = ['store_staff_id', '>', 0]; + } else { + $where[] = ['store_staff_id', '=', 0]; + $where2[] = ['store_staff_id', '=', 0]; + } if ($params['start_time'] != '' && $params['end_time'] != '') { $where2[] = ['create_time', 'between', [strtotime($params['start_time']), strtotime($params['end_time'])]]; } From 29c7f1494a64268049a07da016849a127c761e81 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 20 Jan 2025 14:59:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=95=86=E5=93=81=E5=88=A0=E9=99=A4=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLogic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 1defced89..d74df2910 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -280,8 +280,9 @@ class BeforehandOrderCartInfoLogic extends BaseLogic PurchaseProductOffer::where('order_id',$find['bhoid'])->where('product_id',$find['product_id'])->update(['delete_time'=>time()]); } $res=BeforehandOrderCartInfo::destroy($params['id']); - $pay_price=BeforehandOrderCartInfo::where('bhoid', $params['id'])->sum('pay_price'); - BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price]); + $pay_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('pay_price'); + $total_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('total_price'); + BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price, 'total_price'=>$total_price]); return $res; }