From 19cbb37def28d04591f26372d67c1e9522d2b608 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 30 Jan 2024 14:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B4=A2=E5=8A=A1=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/consumption/CommissionDao.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/common/dao/store/consumption/CommissionDao.php b/app/common/dao/store/consumption/CommissionDao.php index feca73b2..56c4115f 100755 --- a/app/common/dao/store/consumption/CommissionDao.php +++ b/app/common/dao/store/consumption/CommissionDao.php @@ -213,23 +213,20 @@ class CommissionDao */ public function refundByCallback($data) { - $finance = []; $result = []; $users = $this->getUsers($data['user']); $order = StoreOrder::where('order_id', $data['order_id'])->find(); if (empty($order) || empty($users)) { return []; } - $financialRecordRepository = app()->make(FinancialRecordRepository::class); - $financeSn = $financialRecordRepository->getSn(); $financeDao = new FinancialDao(); - foreach ($users as $k => $user) { + foreach ($users as $user) { $commission = bcdiv($user['user_profit'], 100, 2); if ($commission > 0) { $financeDao->user = $user; $financeDao->order = $order; $financialType = ($user['type'] == 3 ? 'order_commission' : 'first_order_commission') . '_refund'; - $finance[] = $financeDao->platformIn($commission, $financialType, $financeSn, $k); + $financeDao->platformIn($commission, $financialType); $result[] = $user; } $redPack = bcmul($order['pay_price'], 0.07, 2); @@ -241,9 +238,7 @@ class CommissionDao } } } - if (count($finance) > 0) { - $financialRecordRepository->insertAll($finance); - } + $financeDao->save(); return $result; }