From b03b4f6af50f1cda6e2346011764b6ca94e99179 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 10 Sep 2020 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E6=88=B7=E6=8F=90=E7=8E=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=81=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7=E9=80=80?= =?UTF-8?q?=E6=AC=BE=E5=90=8C=E6=84=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/WithdrawController.php | 2 +- app/Model/v3/FinancialRecord.php | 1 + app/Service/v3/Implementations/FinancialRecordService.php | 2 +- app/Service/v3/Implementations/OrderOnlineService.php | 4 ---- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Controller/v3/WithdrawController.php b/app/Controller/v3/WithdrawController.php index 9a6f99f..660ce6f 100644 --- a/app/Controller/v3/WithdrawController.php +++ b/app/Controller/v3/WithdrawController.php @@ -180,7 +180,7 @@ class WithdrawController extends BaseController // 打款成功,写流水 if ($res === true) { - $this->financialService->storeWithdrawByWx($store->user_id, 0, $withdraw->real_cash); + $this->financialService->storeWithdrawByWx($store->user_id, $withdraw->id, $withdraw->real_cash); } } diff --git a/app/Model/v3/FinancialRecord.php b/app/Model/v3/FinancialRecord.php index 3a24229..98ac1e2 100644 --- a/app/Model/v3/FinancialRecord.php +++ b/app/Model/v3/FinancialRecord.php @@ -49,6 +49,7 @@ class FinancialRecord extends Model */ const SOURCE_TYPE_NONE = 0; const SOURCE_TYPE_ORDER = 1; + const SOURCE_TYPE_STORE_WITHDRAW = 2; /** * 流水类型,大的分类,<100是奖励分账等收入项 >=100是提现消费等支出项 diff --git a/app/Service/v3/Implementations/FinancialRecordService.php b/app/Service/v3/Implementations/FinancialRecordService.php index b09920d..62be94e 100644 --- a/app/Service/v3/Implementations/FinancialRecordService.php +++ b/app/Service/v3/Implementations/FinancialRecordService.php @@ -342,7 +342,7 @@ class FinancialRecordService implements FinancialRecordServiceInterface $source_id, $money, $user_type = UserType::STORE, - $source_type = FinancialRecord::SOURCE_TYPE_NONE, + $source_type = FinancialRecord::SOURCE_TYPE_STORE_WITHDRAW, $money_type = FinancialRecord::MONEY_TYPE_STORE_WITHDRAW, $desc = '商户提现', $comment = '商户提现打款' diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index c953aa9..a9db67a 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -551,10 +551,6 @@ class OrderOnlineService implements OrderOnlineServiceInterface { $orderMain = $this->check($globalOrderId, $userId, OrderState::REFUNDING); - $orderMain->state = OrderState::REFUNDED; - if (!$orderMain->save()) { - throw new ErrorCodeException(ErrorCode::ORDER_REFUND_FAIL); - } // 微信退款 if ($orderMain->pay_type == Payment::WECHAT) {