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; }