Browse Source

支付成功状态变化

shish 5 năm trước cách đây
mục cha
commit
4d5459b73d

+ 1 - 1
app-hd/controllers/OrderController.php

@@ -526,7 +526,7 @@ class OrderController extends BaseController
         $get = Yii::$app->request->get();
         $search = isset($get['search']) ? $get['search'] : '';
         $where = [];
-        $where['merchantId'] = $this->sjId;
+        $where['shopId'] = $this->shopId;
         if (!empty($get['status'])) {
             $where['status'] = $get['status'];
         }

+ 1 - 0
app-mall/controllers/OrderController.php

@@ -270,6 +270,7 @@ class OrderController extends BaseController
         $payWay = isset($post['payWay']) ? $post['payWay'] : 0;
         $shopId = $this->shopId;
         $post['shopId'] = $shopId;
+        $post['merchantId'] = $this->sjId;
         //默认门店订单
         $store = isset($post['store']) ? $post['store'] : 1;
         $post['store'] = $store;

+ 1 - 1
biz-mall/order/services/OrderService.php

@@ -83,7 +83,7 @@ class OrderService extends BaseService
         if (isset($order['userId']) && $order['userId'] != $userId) {
             util::fail('非法访问');
         }
-        if ($order['status'] != 0) {
+        if ($order['status'] != 1) {
             util::fail('订单不是待付款状态');
         }
         if (!empty($order['deadline']) && $now > $order['deadline']) {

+ 22 - 22
common/services/xhPayToolService.php

@@ -309,28 +309,28 @@ class xhPayToolService
 //            $merchantCapital = xhSjCapitalService::add($capitalData);//商家资金流水记录增加
 //            $merchantCapitalId = $merchantCapital['id'];
 //            $updateData['capitalId'] = $merchantCapitalId;
-//            $updateData['payStatus'] = 1;//支付成功
-//            $updateData['status'] = 1;//支付成功待配送
-//            $updateData['couponId'] = $couponId;
-//            $updateData['payWay'] = $payWay;
-//            $updateData['payTime'] = $now;
-//            //确认h5还是小程序支付
-//            $updateData['wxPayType'] = $wxPayType;
-//            switch ($capitalType) {
-//                case $capitalTypeList['xhOrder']['id']:
-//                    OrderClass::payAfter($order, $updateData);
-//                    break;
-//                case $capitalTypeList['xhActiveOrder']['id']://活动报名
-//                    xhActiveOrderService::updateById($orderId, $updateData);
-//                    break;
-//                case $capitalTypeList['xhApplyOrder']['id']://申请服务
-//                    $updateData['inviteCodeStatus'] = 1;
-//                    xhApplyOrderService::updateById($orderId, $updateData);
-//                    break;
-//                default:
-//                    Yii::warning('更新订单失败,回调的capitalType不符合要求,capitalType:' . $capitalType . ' orderSn:' . $orderSn);
-//                    util::fail('订单流水类型不明确');
-//            }
+            $updateData['payStatus'] = 1;//支付成功
+            $updateData['status'] = 2;//待配送
+            $updateData['couponId'] = $couponId;
+            $updateData['payWay'] = $payWay;
+            $updateData['payTime'] = $now;
+            //确认h5还是小程序支付
+            $updateData['wxPayType'] = $wxPayType;
+            switch ($capitalType) {
+                case $capitalTypeList['xhOrder']['id']:
+                    OrderClass::payAfter($order, $updateData);
+                    break;
+                case $capitalTypeList['xhActiveOrder']['id']://活动报名
+                    xhActiveOrderService::updateById($orderId, $updateData);
+                    break;
+                case $capitalTypeList['xhApplyOrder']['id']://申请服务
+                    $updateData['inviteCodeStatus'] = 1;
+                    xhApplyOrderService::updateById($orderId, $updateData);
+                    break;
+                default:
+                    Yii::warning('更新订单失败,回调的capitalType不符合要求,capitalType:' . $capitalType . ' orderSn:' . $orderSn);
+                    util::fail('订单流水类型不明确');
+            }
 
             //累计消费
             //$userTotalExpend = stringUtil::calcAdd($userAsset['totalExpend'], $totalFee);