From 4b9c717ec6ba1fef4f72b2ff14299fa967fd16e2 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Wed, 28 Feb 2024 16:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E6=88=B7=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E9=87=91=E9=A2=9D=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/system/merchant/MerchantRepository.php | 5 +++++ crmeb/listens/OrderDeliveryListen.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index 6ca00e06..64f48c67 100755 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -591,6 +591,11 @@ class MerchantRepository extends BaseRepository if ($money > 0) { //订单确认收货,增加商户销售金额 Merchant::where('mer_id', $bill->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $money)]); + //订单确认收货,增加商户采购金额 + $merId = Merchant::where('uid', $bill->uid)->value('mer_id'); + if (!empty($merId)) { + Merchant::where('mer_id', $merId)->update(['purchase_amount' => Db::raw('purchase_amount+' . $money)]); + } app()->make(UserBillRepository::class)->incBill($bill->uid, 'mer_computed_money', 'order', [ 'link_id' => $order->order_id, 'mer_id' => $bill->mer_id, diff --git a/crmeb/listens/OrderDeliveryListen.php b/crmeb/listens/OrderDeliveryListen.php index 6640fc30..8f88926d 100644 --- a/crmeb/listens/OrderDeliveryListen.php +++ b/crmeb/listens/OrderDeliveryListen.php @@ -16,7 +16,7 @@ class OrderDeliveryListen implements ListenerInterface { $order = $event['order']; foreach ($order->orderProduct as $orderProduct) { - $merchantCate = $orderProduct->product->merCateId; + $merchantCate = $orderProduct->product->merCateId->toArray(); if (empty($merchantCate) || $merchantCate[0]['mer_cate_id'] != env('PLATFORM_CARD_CATE_ID')) { continue; }