From ec41ef4e92b68e52efabf93484c3b90f08bd7d97 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 26 May 2023 16:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=B9=B3=E5=8F=B0=E6=89=8B?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E5=88=86=E6=B6=A6=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/AfterRefund.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/listener/AfterRefund.php b/app/listener/AfterRefund.php index b434e303..50424fcd 100644 --- a/app/listener/AfterRefund.php +++ b/app/listener/AfterRefund.php @@ -9,6 +9,7 @@ use app\common\model\system\merchant\FinancialRecord; use app\common\model\system\serve\ServeOrder; use app\common\repositories\system\merchant\FinancialRecordRepository; use app\common\repositories\system\merchant\MerchantRepository; +use think\facade\Log; /** * 订单退款之后,退佣金 @@ -20,8 +21,10 @@ class AfterRefund public function handle($event) { + Log::info('refundCommissionStart'); $this->refundOrder = $event['res']; $financialRecords = FinancialRecord::getInstance()->where('order_id', $this->refundOrder['order_id'])->select(); + Log::info('refundCommissionCount:' . count($financialRecords)); foreach ($financialRecords as $financialRecord) { if (in_array($financialRecord['financial_type'], ['commission_to_cloud_warehouse', 'commission_to_entry_merchant', 'commission_to_service_team', 'commission_to_village', 'commission_to_town', ])) { //佣金类型的退还佣金 @@ -29,6 +32,7 @@ class AfterRefund $this->saveFinanceRecord($financialRecord); } if ($financialRecord['financial_type'] == 'auto_margin') { + Log::info("refundMargin, mer_id: {$financialRecord['mer_id']}, money: {$financialRecord['number']}"); //佣金类型的扣除保证金 ServeOrder::getInstance()->where('store_order_id', $financialRecord['order_id'])->update(['is_del' => 1]); $merchant = app()->make(MerchantDao::class)->get($financialRecord['mer_id']); @@ -41,10 +45,12 @@ class AfterRefund $this->saveFinanceRecord($financialRecord); } } + Log::info('refundCommissionEnd'); } public function subMoney($financialRecord) { + Log::info("refundCommission, mer_id: {$financialRecord['mer_id']}, money: {$financialRecord['number']}"); /** @var MerchantRepository $merchantRepository */ $merchantRepository = app()->make(MerchantRepository::class); $merchantRepository->subLockMoney($financialRecord['mer_id'], 'order', $this->refundOrder['order_id'], (float)$financialRecord['number']);