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) {