From 0c1b3ed5da1e66e0d9a6106cf3bbfbe4e7be52c7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jul 2024 10:06:58 +0800 Subject: [PATCH 01/20] =?UTF-8?q?feat(UserLists.php):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BC=96=E5=8F=B7=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/user/UserLists.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/admin/lists/user/UserLists.php b/app/admin/lists/user/UserLists.php index 920176906..36713da06 100644 --- a/app/admin/lists/user/UserLists.php +++ b/app/admin/lists/user/UserLists.php @@ -135,7 +135,6 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsS public function setExcelFields(): array { return [ - 'sn' => '用户编号', 'nickname' => '用户昵称', 'account' => '账号', 'mobile' => '手机号码', From 945fdac2c22c46ef905e85aac0361ffb376b7f90 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jul 2024 10:17:30 +0800 Subject: [PATCH 02/20] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=97=A8?= =?UTF-8?q?=E5=BA=97ID=E5=AD=97=E6=AE=B5=E5=88=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/user/UserLists.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/admin/lists/user/UserLists.php b/app/admin/lists/user/UserLists.php index 36713da06..20fea0ba3 100644 --- a/app/admin/lists/user/UserLists.php +++ b/app/admin/lists/user/UserLists.php @@ -13,6 +13,7 @@ use app\common\model\user\UserAddress; use app\common\model\vip_flow\VipFlow; use support\Db; use app\common\lists\ListsSearchInterface; +use app\common\model\system_store\SystemStore; class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsSearchInterface { @@ -44,7 +45,7 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsS public function lists(): array { $field = "id,nickname,real_name,sex,avatar,account,mobile,channel,create_time,purchase_funds,user_ship, - label_id,integral,now_money,total_recharge_amount,vip_time"; + label_id,integral,now_money,total_recharge_amount,vip_time,store_id"; $lists = User::where($this->searchWhere) ->with(['user_ship','user_label']) ->limit($this->limitOffset, $this->limitLength) @@ -68,6 +69,10 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsS if($item['label_name']== null){ $item['label_name'] = '无'; } + $item['store_name']=''; + if($item['store_id']>0){ + $item['store_name'] = SystemStore::where('id',$item['store_id'])->value('name'); + } $item['return_money'] = VipFlow:: where(['user_id'=>$item['id'],'status'=>0]) ->sum('number')??0; @@ -138,8 +143,13 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsS 'nickname' => '用户昵称', 'account' => '账号', 'mobile' => '手机号码', - 'channel' => '注册来源', - 'create_time' => '注册时间', + 'now_money' => '用户余额', + 'integral' => '礼品券', + 'vip_name' => '会员类型', + 'store_name' => '门店', + 'total_recharge_amount' => '累计消费', + 'purchase_funds' => '采购款', + 'format_address'=>'地址' ]; } } \ No newline at end of file From 4e67edcc77108c1a847319ff24dfe081999b7f96 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jul 2024 11:31:05 +0800 Subject: [PATCH 03/20] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=9C=9F?= =?UTF-8?q?=E5=AE=9E=E5=A7=93=E5=90=8D=E5=AD=97=E6=AE=B5=E5=88=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/user/UserLists.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/admin/lists/user/UserLists.php b/app/admin/lists/user/UserLists.php index 20fea0ba3..a419056cc 100644 --- a/app/admin/lists/user/UserLists.php +++ b/app/admin/lists/user/UserLists.php @@ -141,6 +141,7 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface,ListsS { return [ 'nickname' => '用户昵称', + 'real_name' => '真实姓名', 'account' => '账号', 'mobile' => '手机号码', 'now_money' => '用户余额', From 7264546a3a04c32c97cd5d885b27667c0d16d218 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jul 2024 11:36:53 +0800 Subject: [PATCH 04/20] =?UTF-8?q?feat(BaseLikeController):=20=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=95=B0=E6=8D=AE=E8=BD=AC=E4=B8=BA=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/BaseLikeController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/common/controller/BaseLikeController.php b/app/common/controller/BaseLikeController.php index 13c07d9c8..3302bcd0b 100644 --- a/app/common/controller/BaseLikeController.php +++ b/app/common/controller/BaseLikeController.php @@ -22,8 +22,11 @@ class BaseLikeController extends BaseController * @author 乔峰 * @date 2021/12/27 14:21 */ - protected function success(string $msg = 'success', array $data = [], int $code = 1, int $show = 0) + protected function success(string $msg = 'success', $data = [], int $code = 1, int $show = 0) { + if(is_object($data)){ + $data = $data->toArray(); + } return JsonService::success($msg, $data, $code, $show); } @@ -36,6 +39,9 @@ class BaseLikeController extends BaseController */ protected function data($data) { + if(is_object($data)){ + $data = $data->toArray(); + } return JsonService::data($data); } From 8f9ba883a20fb7695e26d32c0c1e52f85c86cd95 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jul 2024 11:55:19 +0800 Subject: [PATCH 05/20] =?UTF-8?q?feat(StoreOrderCartInfoLists):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lists/store_order_cart_info/StoreOrderCartInfoLists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php index 959b68f01..a8a9aa900 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php @@ -47,7 +47,7 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI return StoreOrderCartInfo::where($this->searchWhere) ->field('cart_info,product_id,store_id')->limit($this->limitOffset, $this->limitLength) ->select()->each(function ($item) { - $find=StoreBranchProduct::where('product_id',$item['product_id'])->where('store_id',$item['store_id'])->field('image,store_name,store_info')->find(); + $find=StoreProduct::where('id',$item['product_id'])->field('image,store_name,store_info')->find(); if($find){ $item['image']=$find['image'];//商品图片 $item['store_name']=$find['store_name'];//商品名称 From 7e99a8afa96a7a228a4e396bc996ea73ea373360 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 09:24:44 +0800 Subject: [PATCH 06/20] =?UTF-8?q?feat(CapitalFlowLogic):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B5=84=E9=87=91=E6=B5=81=E6=B0=B4=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=94=AF=E4=BB=98=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CapitalFlowLogic.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/common/logic/CapitalFlowLogic.php b/app/common/logic/CapitalFlowLogic.php index e65ce0f15..22a4a2f55 100644 --- a/app/common/logic/CapitalFlowLogic.php +++ b/app/common/logic/CapitalFlowLogic.php @@ -3,6 +3,7 @@ namespace app\common\logic; use app\common\enum\OrderEnum; +use app\common\enum\PayEnum; use app\common\model\finance\CapitalFlow; class CapitalFlowLogic extends BaseLogic @@ -72,12 +73,12 @@ class CapitalFlowLogic extends BaseLogic $model->link_type = $linkType; $model->link_id = $linkId; $model->amount = $amount; - if ($payType == OrderEnum::BALANCE_PAYMEN_NO) { - $model->before_balance = $this->user['purchase_funds']; - $model->balance = bcsub($this->user['purchase_funds'], $amount, 2); - } else { - $model->before_balance = $this->user['now_money']; - $model->balance = bcsub($this->user['now_money'], $amount, 2); + if ($payType == PayEnum::PURCHASE_FUNDS) { + $model->before_balance = bcadd($this->user['purchase_funds'],$amount,2); + $model->balance = $this->user['purchase_funds']; + } elseif ($payType == PayEnum::BALANCE_PAY){ + $model->before_balance = bcadd($this->user['now_money'],$amount,2); + $model->balance = $this->user['now_money']; } $model->create_time = date('Y-m-d H:i:s'); $model->type = 'out'; From 1def86886d40365666c6d967f7b6691f9c2e6c71 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 09:34:38 +0800 Subject: [PATCH 07/20] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=E6=94=AF=E4=BB=98=E7=9A=84=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CapitalFlowLogic.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/common/logic/CapitalFlowLogic.php b/app/common/logic/CapitalFlowLogic.php index 22a4a2f55..9e47ccca4 100644 --- a/app/common/logic/CapitalFlowLogic.php +++ b/app/common/logic/CapitalFlowLogic.php @@ -79,6 +79,9 @@ class CapitalFlowLogic extends BaseLogic } elseif ($payType == PayEnum::BALANCE_PAY){ $model->before_balance = bcadd($this->user['now_money'],$amount,2); $model->balance = $this->user['now_money']; + }else{ + $model->before_balance = $this->user['now_money']; + $model->balance = $this->user['now_money']; } $model->create_time = date('Y-m-d H:i:s'); $model->type = 'out'; From 1c1a34e618d16cc0840b9cd1b1321109bfa6acbd Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 09:46:33 +0800 Subject: [PATCH 08/20] =?UTF-8?q?feat(PayNotifyLogic):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=94=A8=E6=88=B7=E6=94=AF=E4=BB=98=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E8=B0=83=E6=95=B4=E8=B5=84=E9=87=91?= =?UTF-8?q?=E6=B5=81=E5=8A=A8=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index c4b03a1af..e37f97f22 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -93,7 +93,7 @@ class PayNotifyLogic extends BaseLogic } // self::addUserSing($order); $capitalFlowDao = new CapitalFlowLogic($user); - $capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']); + $capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 3, $order['store_id']); self::dealProductLog($order); self::afterPay($order); @@ -203,7 +203,7 @@ class PayNotifyLogic extends BaseLogic $user->save(); $capitalFlowDao = new CapitalFlowLogic($user); - $capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price'], '', 1, $order['store_id']); + $capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price'], '', 18, $order['store_id']); // if ($user['user_ship'] == 1) { // self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS); // } @@ -263,7 +263,7 @@ class PayNotifyLogic extends BaseLogic } else { $capitalFlowDao = new CapitalFlowLogic($user); //微信支付和用户余额无关 - $capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 1, $order['store_id']); + $capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 0, $order['store_id']); } $order->save(); if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) { @@ -304,10 +304,10 @@ class PayNotifyLogic extends BaseLogic $capitalFlowDao = new CapitalFlowLogic($user); if ($purchase_funds >= $orderRe['price']) { User::where('id', $orderRe['uid'])->dec('purchase_funds', $orderRe['refund_price'])->update(); - $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 1, $orderRe['store_id']); + $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 0, $orderRe['store_id']); } else { User::where('id', $orderRe['uid'])->dec('purchase_funds', $purchase_funds)->update(); - $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 1, $orderRe['store_id']); + $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 0, $orderRe['store_id']); } //退还 充值得兑换券 UserSignLogic::RefundRecharge($orderRe); From ce0fa6c394ee2860b7de74cb2446ea4a27ab379f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 10:10:04 +0800 Subject: [PATCH 09/20] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9StoreOrder?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=BB=A5=E5=A4=84=E7=90=86=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/store_order/StoreOrder.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/common/model/store_order/StoreOrder.php b/app/common/model/store_order/StoreOrder.php index 977458c8c..81d0cb40b 100644 --- a/app/common/model/store_order/StoreOrder.php +++ b/app/common/model/store_order/StoreOrder.php @@ -40,7 +40,12 @@ class StoreOrder extends BaseModel public function getStatusNameTextAttr($value, $data) { - $status = OrderEnum::getOrderType($data['status']) ?? ''; + if($data['status']==-1){ + $status = OrderEnum::refundStatus($data['refund_status']) ?? ''; + }else{ + $status = OrderEnum::getOrderType($data['status']) ?? ''; + + } return $status; } From 50dd13542e82254a65447052bc39fd80b89021fb Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 10:12:51 +0800 Subject: [PATCH 10/20] =?UTF-8?q?feat(OrderEnum):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/enum/OrderEnum.php | 4 ++++ app/common/model/store_order/StoreOrder.php | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/enum/OrderEnum.php b/app/common/enum/OrderEnum.php index 6674b96ad..8ffae83e1 100644 --- a/app/common/enum/OrderEnum.php +++ b/app/common/enum/OrderEnum.php @@ -180,6 +180,10 @@ class OrderEnum */ public static function getOrderType($value = true) { + if($value==-1){ + $status = self::refundStatus($value) ?? ''; + return $status; + } $data = [ self::RECEIVED_GOODS => '已完成', self::WAIT_EVALUATION => '待评价', diff --git a/app/common/model/store_order/StoreOrder.php b/app/common/model/store_order/StoreOrder.php index 81d0cb40b..90b1efcc6 100644 --- a/app/common/model/store_order/StoreOrder.php +++ b/app/common/model/store_order/StoreOrder.php @@ -40,12 +40,8 @@ class StoreOrder extends BaseModel public function getStatusNameTextAttr($value, $data) { - if($data['status']==-1){ - $status = OrderEnum::refundStatus($data['refund_status']) ?? ''; - }else{ - $status = OrderEnum::getOrderType($data['status']) ?? ''; - } + $status = OrderEnum::getOrderType($data['status']) ?? ''; return $status; } From 22c89d8dddcaeaa77dc3d52a7af239fc6fab30f3 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 10:16:28 +0800 Subject: [PATCH 11/20] =?UTF-8?q?feat(OrderEnum):=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E5=92=8C=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/store_order/StoreOrderLists.php | 6 +++++- app/common/enum/OrderEnum.php | 4 ---- app/common/model/store_order/StoreOrder.php | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/admin/lists/store_order/StoreOrderLists.php b/app/admin/lists/store_order/StoreOrderLists.php index 3da16980b..90dfddcc8 100644 --- a/app/admin/lists/store_order/StoreOrderLists.php +++ b/app/admin/lists/store_order/StoreOrderLists.php @@ -64,7 +64,11 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface ->order(['id' => 'desc']) ->select()->each(function ($item) { $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : ''; - $item['status_name'] = OrderEnum::getOrderType($item['status']) ?? ''; + if($item['status']==-1){ + $item['status_name'] = OrderEnum::refundStatus($item['refund_status']) ?? ''; + }else{ + $item['status_name'] = OrderEnum::getOrderType($item['status']) ?? ''; + } if ($item['uid'] <= 0) { $item['nickname'] = '游客'; } else { diff --git a/app/common/enum/OrderEnum.php b/app/common/enum/OrderEnum.php index 8ffae83e1..6674b96ad 100644 --- a/app/common/enum/OrderEnum.php +++ b/app/common/enum/OrderEnum.php @@ -180,10 +180,6 @@ class OrderEnum */ public static function getOrderType($value = true) { - if($value==-1){ - $status = self::refundStatus($value) ?? ''; - return $status; - } $data = [ self::RECEIVED_GOODS => '已完成', self::WAIT_EVALUATION => '待评价', diff --git a/app/common/model/store_order/StoreOrder.php b/app/common/model/store_order/StoreOrder.php index 90b1efcc6..69b1b301b 100644 --- a/app/common/model/store_order/StoreOrder.php +++ b/app/common/model/store_order/StoreOrder.php @@ -40,8 +40,11 @@ class StoreOrder extends BaseModel public function getStatusNameTextAttr($value, $data) { - - $status = OrderEnum::getOrderType($data['status']) ?? ''; + if($data['status']==-1){ + $status = OrderEnum::refundStatus($data['refund_status']) ?? ''; + }else{ + $status = OrderEnum::getOrderType($data['status']) ?? ''; + } return $status; } From 10fbddf295768b9e79a4e7c785ad85b93de9e3d6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 14:52:46 +0800 Subject: [PATCH 12/20] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=E4=BB=A5=E6=94=AF=E6=8C=81=E6=96=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5rose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index eb44a671e..c90bd959b 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -18,6 +18,7 @@ use app\common\model\order\Cart; use app\common\model\store_branch_product\StoreBranchProduct; use app\common\model\store_category\StoreCategory; use app\common\model\store_finance_flow\StoreFinanceFlow; +use app\common\model\store_finance_flow_product\StoreFinanceFlowProduct; use app\common\model\store_order\StoreOrder; use app\common\model\store_order_cart_info\StoreOrderCartInfo; use app\common\model\store_product\StoreProduct; @@ -82,13 +83,13 @@ class OrderLogic extends BaseLogic self::$fresh_price = 0; //生鲜金额 /** 计算价格 */ $off_activity = Config::where('name', 'off_activity')->value('value'); - $field = 'id branch_product_id,store_name,image,unit,price,vip_price,cost,purchase,product_id,top_cate_id,store_info'; + $field = 'id branch_product_id,store_name,image,unit,price,vip_price,cost,purchase,product_id,top_cate_id,store_info,rose'; foreach ($cart_select as $k => $v) { $find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field($field)->find(); if (!$find) { // unset($cart_select[$k]); // continue; - $field = 'id branch_product_id,store_name,image,unit,price,vip_price,cost,purchase, id product_id,cate_id,store_info'; + $field = 'id branch_product_id,store_name,image,unit,price,vip_price,cost,purchase, id product_id,cate_id,store_info,rose'; $find = StoreProduct::where(['id' => $v['product_id']])->field($field)->find(); if ($find) { $cate_id = StoreCategory::where('id', $find['cate_id'])->value('pid'); @@ -135,6 +136,7 @@ class OrderLogic extends BaseLogic $cart_select[$k]['verify_code'] = $params['verify_code'] ?? ''; $cart_select[$k]['vip_frozen_price'] = 0; $cart_select[$k]['store_info'] = $find['store_info']; + $cart_select[$k]['rose'] = $find['rose']; //会员待返回金额 // if ($user && $off_activity == 0) { // if ($user['user_ship'] == 4) { @@ -575,12 +577,7 @@ class OrderLogic extends BaseLogic 'staff_id' => $params['staff_id'] ?? 0, ], ['id' => $order['id']]); //修改商品统计记录标识 - (new StoreProductLog())->update( - [ - 'store_id' => $params['store_id'] - ], - ['oid' => $order['id']] - ); + (new StoreProductLog())->where('oid',$order['id'])->update(['store_id' => $params['store_id']]); (new StoreOrderCartInfo())->update([ 'verify_code' => $params['verify_code'] . '-1', 'writeoff_time' => time(), @@ -590,6 +587,10 @@ class OrderLogic extends BaseLogic 'update_time' => time(), ], ['oid' => $order['id']]); $financeFlow = new StoreFinanceFlow(); + $res=$financeFlow->where('order_id',$order['id'])->update(['store_id'=>$params['store_id'],'staff_id'=>$params['staff_id']]); + if($res){ + $order['store_id']=$params['store_id']; + } $financeFlowLogic = new StoreFinanceFlowLogic(); $select_1 = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => ['in' => 14, 15, 16]])->select(); foreach ($select_1 as $k => $v) { From 3d7d447c7d1effd722a97e776322aa260c677347 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 14:56:35 +0800 Subject: [PATCH 13/20] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=E4=BB=A5=E5=A4=84=E7=90=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=9C=B0=E5=9D=80=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index c90bd959b..441ef61d0 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -231,7 +231,7 @@ class OrderLogic extends BaseLogic $store_id = getenv('STORE_ID') ?? 1; $store['near_store'] = SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find() ?? []; } - $order['address_id'] = UserAddress::where('uid', $user['id'])->where('is_default', 1)->value('id')??0; + $order['address_id'] = UserAddress::where('uid', $user['id'])->where('is_default', 1)->value('id') ?? 0; } if (empty($store_check)) { if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { @@ -292,12 +292,25 @@ class OrderLogic extends BaseLogic // $_order['reservation_time'] = $params['reservation_time']; // $_order['reservation'] = YesNoEnum::YES; // } - if ($addressId > 0 && $uid > 0) { - $address = UserAddress::where(['id' => $addressId, 'uid' => $uid])->find(); + if ($uid > 0) { + $address = UserAddress::where(['uid' => $uid])->find(); if ($address) { $_order['real_name'] = $address['real_name']; $_order['user_phone'] = $address['phone']; - $_order['user_address'] = $address['detail']; + if ($address['area']) { + $_order['user_address'] = Db::name('geo_area')->where('area_code', $address['area'])->value('area_name') ?? ''; + } + if ($address['street']) { + $street_name = Db::name('geo_street')->where('street_code', $address['street'])->value('street_name') ?? ''; + $_order['user_address'] .= '/' . $street_name; + } + if ($address['village']) { + $village_name = Db::name('geo_village')->where('village_code', $address['village'])->value('village_name') ?? ''; + $_order['user_address'] .= '/' . $village_name; + } + if ($address['brigade']) { + $_order['user_address'] .= '/' . $address['brigade'] ?? $address['brigade'] . '队' : ''; + } } } if ($params['shipping_type'] == 2) { @@ -577,7 +590,7 @@ class OrderLogic extends BaseLogic 'staff_id' => $params['staff_id'] ?? 0, ], ['id' => $order['id']]); //修改商品统计记录标识 - (new StoreProductLog())->where('oid',$order['id'])->update(['store_id' => $params['store_id']]); + (new StoreProductLog())->where('oid', $order['id'])->update(['store_id' => $params['store_id']]); (new StoreOrderCartInfo())->update([ 'verify_code' => $params['verify_code'] . '-1', 'writeoff_time' => time(), @@ -587,9 +600,9 @@ class OrderLogic extends BaseLogic 'update_time' => time(), ], ['oid' => $order['id']]); $financeFlow = new StoreFinanceFlow(); - $res=$financeFlow->where('order_id',$order['id'])->update(['store_id'=>$params['store_id'],'staff_id'=>$params['staff_id']]); - if($res){ - $order['store_id']=$params['store_id']; + $res = $financeFlow->where('order_id', $order['id'])->update(['store_id' => $params['store_id'], 'staff_id' => $params['staff_id']]); + if ($res) { + $order['store_id'] = $params['store_id']; } $financeFlowLogic = new StoreFinanceFlowLogic(); $select_1 = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => ['in' => 14, 15, 16]])->select(); From 71126e9ecb1a1720a08f35db7aa40f39a549c583 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jul 2024 15:00:20 +0800 Subject: [PATCH 14/20] =?UTF-8?q?feat(OrderLogic):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=9C=B0=E5=9D=80=E9=98=9F=E4=BC=8D=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 441ef61d0..77353be04 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -309,7 +309,7 @@ class OrderLogic extends BaseLogic $_order['user_address'] .= '/' . $village_name; } if ($address['brigade']) { - $_order['user_address'] .= '/' . $address['brigade'] ?? $address['brigade'] . '队' : ''; + $_order['user_address'] .= '/' . $address['brigade'] ?? $address['brigade'] . '队'; } } } From 6a9dc9ddc204c0f2e36c065b47f7c0ca4bab96f6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 14:35:10 +0800 Subject: [PATCH 15/20] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=80=80=E6=AC=BE=E9=80=BB=E8=BE=91=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store_order/StoreOrderController.php | 35 +------------ .../logic/store_order/StoreOrderLogic.php | 52 ++++++++++++++----- app/api/controller/order/OrderController.php | 33 ++++-------- app/api/logic/LoginLogic.php | 6 +++ app/api/logic/user/UserLogic.php | 10 ++-- 5 files changed, 65 insertions(+), 71 deletions(-) diff --git a/app/admin/controller/store_order/StoreOrderController.php b/app/admin/controller/store_order/StoreOrderController.php index 34307b5cb..414312813 100644 --- a/app/admin/controller/store_order/StoreOrderController.php +++ b/app/admin/controller/store_order/StoreOrderController.php @@ -116,40 +116,7 @@ class StoreOrderController extends BaseAdminController if(empty($detail)){ return $this->fail('无该订单请检查'); } - //微信支付 - if(in_array($detail['pay_type'],[PayEnum::WECHAT_PAY_MINI,PayEnum::WECHAT_PAY_BARCODE])){ - $money = (int)bcmul($detail['pay_price'],100); - $refund = (new \app\common\logic\store_order\StoreOrderLogic()) - ->refund($params['order_id'],$money,$money); - if($refund){ -// $arr = [ -// 'amount'=>[ -// 'refund'=>$money -// ] -// ]; -// PayNotifyLogic::refund($params['order_id'],$arr); - return $this->success(); - } - } - //余额支付 采购款支付 - if (in_array($detail['pay_type'] ,[PayEnum::BALANCE_PAY,PayEnum::PURCHASE_FUNDS])){ - $money = bcmul($detail['pay_price'],100); - $arr = [ - 'amount'=>[ - 'refund'=>$money - ] - ]; - PayNotifyLogic::refund($params['order_id'],$arr); - return $this->success(); - - } - //现金支付 - if($detail['pay_type'] = PayEnum::CASH_PAY){ - PayNotifyLogic::cash_refund($params['order_id']); - return $this->success(); - } - //todo 支付包支付 - + StoreOrderLogic::refund($detail,$params); return $this->fail('退款失败'); } diff --git a/app/admin/logic/store_order/StoreOrderLogic.php b/app/admin/logic/store_order/StoreOrderLogic.php index 23379ef93..96ded6ae2 100644 --- a/app/admin/logic/store_order/StoreOrderLogic.php +++ b/app/admin/logic/store_order/StoreOrderLogic.php @@ -2,9 +2,10 @@ namespace app\admin\logic\store_order; - +use app\common\enum\PayEnum; use app\common\model\store_order\StoreOrder; use app\common\logic\BaseLogic; +use app\common\logic\PayNotifyLogic; use app\common\model\store_order_cart_info\StoreOrderCartInfo; use think\facade\Db; @@ -29,9 +30,7 @@ class StoreOrderLogic extends BaseLogic { Db::startTrans(); try { - StoreOrder::create([ - - ]); + StoreOrder::create([]); Db::commit(); return true; @@ -54,9 +53,7 @@ class StoreOrderLogic extends BaseLogic { Db::startTrans(); try { - StoreOrder::where('id', $params['id'])->update([ - - ]); + StoreOrder::where('id', $params['id'])->update([]); Db::commit(); return true; @@ -90,11 +87,42 @@ class StoreOrderLogic extends BaseLogic */ public static function detail($params): array { - $data= StoreOrder::findOrEmpty($params['id']); - if($data){ - $data['status_name']=$data->status_name_text; - $data['pay_time']=date('Y-m-d H:i:s',$data['pay_time']); + $data = StoreOrder::findOrEmpty($params['id']); + if ($data) { + $data['status_name'] = $data->status_name_text; + $data['pay_time'] = date('Y-m-d H:i:s', $data['pay_time']); } return $data?->toArray(); } -} \ No newline at end of file + + public static function refund($detail, $params) + { + //微信支付 + if (in_array($detail['pay_type'], [PayEnum::WECHAT_PAY_MINI, PayEnum::WECHAT_PAY_BARCODE])) { + $money = (int)bcmul($detail['pay_price'], 100); + $refund = (new \app\common\logic\store_order\StoreOrderLogic()) + ->refund($params['order_id'], $money, $money); + if ($refund) { + return '退款成功'; + } + } + //余额支付 采购款支付 + if (in_array($detail['pay_type'], [PayEnum::BALANCE_PAY, PayEnum::PURCHASE_FUNDS])) { + $money = bcmul($detail['pay_price'], 100); + $arr = [ + 'amount' => [ + 'refund' => $money + ] + ]; + PayNotifyLogic::refund($params['order_id'], $arr); + return '退款成功'; + } + //现金支付 + if ($detail['pay_type'] = PayEnum::CASH_PAY) { + PayNotifyLogic::cash_refund($params['order_id']); + return '退款成功'; + } + return false; + //todo 支付包支付 + } +} diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index a72a22068..f88ec318f 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -2,6 +2,7 @@ namespace app\api\controller\order; +use app\admin\logic\store_order\StoreOrderLogic; use app\api\logic\order\OrderLogic; use app\api\controller\BaseApiController; use app\api\lists\order\OrderList; @@ -413,15 +414,9 @@ class OrderController extends BaseApiController } } - // #[ - // ApiDoc\Title('核销'), - // ApiDoc\url('/api/order/order/writeoff_order'), - // ApiDoc\Method('POST'), - // ApiDoc\Param(name: "verify_code", type: "string", require: true, desc: "验证码"), - // ApiDoc\NotHeaders(), - // ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), - // ApiDoc\ResponseSuccess("data", type: "array"), - // ] + /** + * 核销 + */ public function writeoff_order() { $params = (new OrderValidate())->post()->goCheck('check'); @@ -453,25 +448,19 @@ class OrderController extends BaseApiController } - // #[ - // ApiDoc\Title('订单退款申请'), - // ApiDoc\url('/api/order/order/apply_refund'), - // ApiDoc\Method('POST'), - // ApiDoc\Param(name: "refund_message", type: "string", require: true, desc: "退款原因"), - // ApiDoc\Param(name: "refund_num", type: "int", require: true, desc: "退款数量"), - // ApiDoc\Param(name: "id", type: "int", require: true, desc: "订单id"), - // ApiDoc\Param(name: "old_cart_id", type: "int", require: true, desc: "购物车id"), - // ApiDoc\Param(name: "refund_type", type: "int", require: true, desc: "退款申请类型"), - // ApiDoc\NotHeaders(), - // ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), - // ApiDoc\ResponseSuccess("data", type: "array"), - // ] + /** + * 订单退款申请 + */ public function apply_refund() { $params = (new OrderValidate())->post()->goCheck('add'); $uid = $this->userId; //拆单逻辑 OrderLogic::dealRefund($uid, $params); + $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->where('status','in',[0,1])->find(); + if($detail){ + StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); + } return $this->success('申请成功'); } diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index f5982542b..fae9c37fe 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -102,6 +102,11 @@ class LoginLogic extends BaseLogic //返回登录信息 $avatar = $user->avatar ?: Config::get('project.default_image.user_avatar'); $avatar = FileService::getFileUrl($avatar); + if($user->store_id){ + $share_name=SystemStore::where('id',$user->store_id)->value('abbreviation'); + }else{ + $share_name=SystemStore::where('id',4)->value('abbreviation'); + } return [ 'avatar' => $avatar, 'id'=>$userInfo['user_id'], @@ -113,6 +118,7 @@ class LoginLogic extends BaseLogic // 'sn' => $userInfo['sn'], 'token' => $userInfo['token'], 'real_name' => $userInfo['real_name'], + 'share_name' => $share_name.'No.'.preg_replace('/4/','*', $user['id']), ]; } catch (\Exception $e) { self::setError($e->getMessage()); diff --git a/app/api/logic/user/UserLogic.php b/app/api/logic/user/UserLogic.php index ef5a9590f..8eb727c10 100644 --- a/app/api/logic/user/UserLogic.php +++ b/app/api/logic/user/UserLogic.php @@ -86,7 +86,7 @@ class UserLogic extends BaseLogic { $data = User::with(['userShip'])->where('id',$uid) ->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship - ,purchase_funds,integral,pay_password,label_id') + ,purchase_funds,integral,pay_password,label_id,store_id') ->find(); //判断是不是员工 if($data){ @@ -101,12 +101,10 @@ class UserLogic extends BaseLogic $data['next_limit'] = $new['limit'] - $data['total_recharge_amount']; } $data['is_staff'] = 0; - $data['store_id'] = 0; if(isset($data['mobile']) && $data['mobile']){ $check = DeliveryService::where('phone',$data['mobile'])->find()??[]; if ($check){ $data['is_staff'] = 1; - $data['store_id'] = $check['store_id']; } } $data['label_name']=UserLabel::where('label_id',$data['label_id'])->value('label_name'); @@ -125,6 +123,12 @@ class UserLogic extends BaseLogic $number = UserSign::where('uid',$uid)->where(['status'=>0])->sum('number'); $data['number'] =bcadd($number,0,2); $data['GetNumber'] =bcadd($GetNumber,0,2); + if($data['store_id']){ + $share_name=SystemStore::where('id',$data['store_id'])->value('abbreviation'); + }else{ + $share_name=SystemStore::where('id',4)->value('abbreviation'); + } + $data['share_name']= $share_name.'No.'.preg_replace('/4/','*', $data['id']); }else{ $data = []; } From 2d3b99b37021cf5cb0baca7ec4e0ae962aaf98cb Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 14:39:44 +0800 Subject: [PATCH 16/20] =?UTF-8?q?feat(OrderController):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=80=E6=AC=BE=E7=94=B3=E8=AF=B7=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/OrderController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index f88ec318f..be00fdfb9 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -459,7 +459,10 @@ class OrderController extends BaseApiController OrderLogic::dealRefund($uid, $params); $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->where('status','in',[0,1])->find(); if($detail){ - StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); + $res=StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); + if($res!=false){ + return $this->success($res); + } } return $this->success('申请成功'); } From fa559efd5c87af336690f1462db835e773fde1d7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 15:06:33 +0800 Subject: [PATCH 17/20] =?UTF-8?q?feat(OrderController):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8B=86=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=80=E6=AC=BE=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/OrderController.php | 6 +++--- app/api/logic/order/OrderLogic.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index be00fdfb9..299cbc2bb 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -456,9 +456,9 @@ class OrderController extends BaseApiController $params = (new OrderValidate())->post()->goCheck('add'); $uid = $this->userId; //拆单逻辑 - OrderLogic::dealRefund($uid, $params); - $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->where('status','in',[0,1])->find(); - if($detail){ + $res=OrderLogic::dealRefund($uid, $params); + $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->find(); + if($detail && $res!=2){ $res=StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); if($res!=false){ return $this->success($res); diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 77353be04..d6e84dfff 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -832,7 +832,7 @@ class OrderLogic extends BaseLogic } } - return 1; + return $order['status']??1; } From 6879da096826c6a4293df7ffbecac191008647f6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 15:59:12 +0800 Subject: [PATCH 18/20] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9store?= =?UTF-8?q?=5Fid=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/logic/WorkbenchLogic.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/store/logic/WorkbenchLogic.php b/app/store/logic/WorkbenchLogic.php index 9adaf4a7b..6988ba07d 100644 --- a/app/store/logic/WorkbenchLogic.php +++ b/app/store/logic/WorkbenchLogic.php @@ -66,6 +66,7 @@ class WorkbenchLogic extends BaseLogic $storeFinanceWhere['store_id'] = $params['store_id']; $storeFinanceWhereTwo['store_id'] = $params['store_id']; $attritionWhere['id'] = $params['store_id']; + $all_where['store_id'] = $params['store_id']; } $orderLogic = new StoreOrderLogic(); //订单总金额 From b548c5f5c2094e331914b764cc9c7a18a36d8a76 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 16:42:45 +0800 Subject: [PATCH 19/20] =?UTF-8?q?feat(OrderWetchaPushSend.php):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=BD=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queue/redis/OrderWetchaPushSend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queue/redis/OrderWetchaPushSend.php b/app/queue/redis/OrderWetchaPushSend.php index 0f6315125..2aaa19ec7 100644 --- a/app/queue/redis/OrderWetchaPushSend.php +++ b/app/queue/redis/OrderWetchaPushSend.php @@ -43,7 +43,7 @@ class OrderWetchaPushSend implements Consumer $cart_info=StoreOrderCartInfo::where('oid',$order['id'])->field('cart_info')->select(); $product_info="\r\n>商品信息:------------------"; foreach($cart_info as $k=>$v['cart_info']){ - $a=$v['cart_info']['cart_info']['name'].' 数量:'.$v['cart_info']['cart_info']['cart_num'].' 价格:'.$v['cart_info']['cart_info']['pay_price'].'元'; + $a=$v['cart_info']['cart_info']['name'].' 数量:'.$v['cart_info']['cart_info']['cart_num'].$v['cart_info']['cart_info']['unit_name']??''.' 价格:'.$v['cart_info']['cart_info']['pay_price'].'元'; $product_info.="\r\n>$a"; } $arr = ["msgtype" => "markdown", "markdown" => ["content" => "有新的订单请及时跟踪 From a746ed879ff1d09b4b2e2497dfc8a30431ce7794 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 29 Jul 2024 17:15:46 +0800 Subject: [PATCH 20/20] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9OrderWetchaPush?= =?UTF-8?q?Send=E7=B1=BB=E4=BB=A5=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queue/redis/OrderWetchaPushSend.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/queue/redis/OrderWetchaPushSend.php b/app/queue/redis/OrderWetchaPushSend.php index 2aaa19ec7..60e1ba2f2 100644 --- a/app/queue/redis/OrderWetchaPushSend.php +++ b/app/queue/redis/OrderWetchaPushSend.php @@ -43,7 +43,8 @@ class OrderWetchaPushSend implements Consumer $cart_info=StoreOrderCartInfo::where('oid',$order['id'])->field('cart_info')->select(); $product_info="\r\n>商品信息:------------------"; foreach($cart_info as $k=>$v['cart_info']){ - $a=$v['cart_info']['cart_info']['name'].' 数量:'.$v['cart_info']['cart_info']['cart_num'].$v['cart_info']['cart_info']['unit_name']??''.' 价格:'.$v['cart_info']['cart_info']['pay_price'].'元'; + $unit_name=$v['cart_info']['cart_info']['unit_name']??''; + $a=$v['cart_info']['cart_info']['name'].' 数量:'.$v['cart_info']['cart_info']['cart_num'].$unit_name.' 价格:'.$v['cart_info']['cart_info']['pay_price'].'元'; $product_info.="\r\n>$a"; } $arr = ["msgtype" => "markdown", "markdown" => ["content" => "有新的订单请及时跟踪