Bladeren bron

up - 总金额

liugc 10 maanden geleden
bovenliggende
commit
23353092e3
2 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. 2 1
      app/api/controller/DouYinController.php
  2. 4 3
      app/api/service/DouYinService.php

+ 2 - 1
app/api/controller/DouYinController.php

@@ -225,7 +225,8 @@ class DouYinController extends BaseApiController
             $params = $this->request->post();
             Log::info('submitOrderNotify:'.formatLogData($params));
             $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
-            $res = DouYinService::submitOrderNotify($msg);
+            if($params['type'] == 'pre_create_order') $res = DouYinService::submitOrderNotify($msg);
+            //if($params['type'] == 'pre_create_refund') $res = DouYinService::refundOrderNotify($msg);
             Log::info("submitOrderNotify:".formatLogData($res));
             if($res){
                 return json(["err_no"=>0,"err_tips"=>"","data"=>$res], 200);

+ 4 - 3
app/api/service/DouYinService.php

@@ -626,11 +626,12 @@ class DouYinService
 
                 // 尾款订单支付成功后续操作 fun
                 //抖音订单服务完成
+                $rechargeOrderPaidAmount = \app\common\model\recharge\RechargeOrder::where(['work_id'=>$rechargeOrder->work_id,'pay_status'=>1])->sum('paid_amount');
                 $order = DouyinOrder::where(['work_id'=>$rechargeOrder->work_id])->findOrEmpty();
-                $order->order_status = 4;
+                $order->order_status = 3;
                 $order->pay_status = 1;
-                $order->total_amount += $paid_amount;
-                $order->paid_amount += $paid_amount;
+                $order->total_amount = $rechargeOrderPaidAmount;
+                $order->paid_amount = $rechargeOrderPaidAmount;
                 $order->save();
                 //工单完结
                 self::paymentSuccessful(['sn'=>$rechargeOrder->sn,'pay_way'=>4]);