From b03b4f6af50f1cda6e2346011764b6ca94e99179 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 10 Sep 2020 15:33:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=95=86=E6=88=B7=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=81=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E9=80=80=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) { From 39914fee455da7656baafe43007c7b653687b2e3 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 10 Sep 2020 16:10:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=95=86=E5=93=81tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/JsonRpc/OrderService.php | 18 ++++++++++++++++-- app/Model/v3/Goods.php | 10 ---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/JsonRpc/OrderService.php b/app/JsonRpc/OrderService.php index c2d8f43..f13b9cb 100644 --- a/app/JsonRpc/OrderService.php +++ b/app/JsonRpc/OrderService.php @@ -68,12 +68,13 @@ class OrderService implements OrderServiceInterface } /** - * 线上订单退款,整个订单退 + * 线上订单退款,整个订单退,这个是专门用于处理用户的申请退款的同意退款操作 * @param $global_order_id * @param $user_id * @return array */ - public function onlineRefund($global_order_id, $user_id){ + public function onlineRefund($global_order_id, $user_id) + { Db::beginTransaction(); try { @@ -95,4 +96,17 @@ class OrderService implements OrderServiceInterface } } + + /** + * 线上订单单笔退款 + * 支持单商品、单店、整单 + * @param $global_order_id 全局总订单ID + * @param $child_order_id 主订单ID, + * @param $order_goods_id 订单商品ID + * @param $note + */ + public function onlineSingleRefund($global_order_id, $child_order_id, $order_goods_id, $note) + { + + } } \ No newline at end of file diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index 2c110c2..c0718cb 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -92,16 +92,6 @@ class Goods extends Model return $this->attachmentService->switchImgToAliOss($value); } - public function getTagsAttribute($value) - { - if($value){ - $value = str_replace('"','',$value); - $value = explode(',',$value); - return $value; - } - return $value; - } - public function getMonthSalesAttribute() { $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); From 48c6b4b34a3033dc76e8e5f6089d6870f8e87599 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 10 Sep 2020 16:30:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=80=BB=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E9=97=AE=E9=A2=98=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/OrderOnlineService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index bbce864..b4f0e42 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -244,7 +244,13 @@ class OrderOnlineService implements OrderOnlineServiceInterface // 校验订单总金额 if ($totalAmount != $totalMoney) { - throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR); + throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR, json_encode([ + '计算的总订单金额:' => $totalAmount, + '前端的订单总金额:' => $totalMoney, + 'Delivery:' => $deliveryAmount, + 'Service:' => $serviceMoney, + 'Coupon:' => $couponMoney, + ])); } $dataMain = [