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 1/7] =?UTF-8?q?feat(StoreOrderCartInfoLists):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=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 2/7] =?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 3/7] =?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 4/7] =?UTF-8?q?feat(PayNotifyLogic):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=94=AF=E4=BB=98=E9=80=9A=E7=9F=A5=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E8=B0=83=E6=95=B4=E8=B5=84=E9=87=91=E6=B5=81?= =?UTF-8?q?=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 5/7] =?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 6/7] =?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 7/7] =?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; }