Pārlūkot izejas kodu

套餐卡券类型到账

zhangxiaobin 1 gadu atpakaļ
vecāks
revīzija
f6e77c7734
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      application/common/service/OrderService.php

+ 7 - 0
application/common/service/OrderService.php

@@ -257,6 +257,13 @@ class OrderService
             if (!$orderRes) {
                 throw new Exception('生成订单失败');
             }
+            //订单套餐卡券类型商家直接到账
+            if ($package['type'] == 2) {//卡券类型直接已完成
+                $wallet_rs = model('walletcompany')->lockChangeAccountRemain($companyId, 'money', $package['price'], 203, '套餐订单完成服务', 'order', $orderRes);
+                if($wallet_rs['status'] === false){
+                    throw new Exception($wallet_rs['msg']);
+                }
+            }
             $newNum = $package['num'] - 1;
             $packageRes = Db::name('package')->where($packageWhere)->update(['num'=>$newNum]);
             if (!$packageRes) {