lizhen_gitee 1 rok pred
rodič
commit
5f972ac1b1
1 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 8 4
      application/api/controller/Lesson.php

+ 8 - 4
application/api/controller/Lesson.php

@@ -159,7 +159,7 @@ class Lesson extends Api
         }
 
         //报名人数不能超限
-        if($info['num_max' > 0]){
+        if($info['num_max'] > 0){
             $pay_number = Db::name('lesson_order')->where('slot_id',$slot_id)->where('order_status',10)->sum('usernumber');
             $num_remain = $info['num_max'] - $pay_number;
             if($num_remain < $number){
@@ -238,7 +238,7 @@ class Lesson extends Api
             }
 
             Db::commit();
-            $this->success('预约成功');
+            $this->success('预约成功',['returntype'=>1]);
         }
         elseif($paytype == 2)
         {
@@ -283,6 +283,7 @@ class Lesson extends Api
             $return = [
                 'url' => $hitpay_return['url'],
                 'id'  => $hitpay_return['id'],
+                'returntype' => 2,
             ];
             $this->success(1,$return);
         }
@@ -298,8 +299,11 @@ class Lesson extends Api
             Db::commit();
 
             //去购买套餐,参数代入过去
-
-            $this->success(1,$lesson_order_id);
+            $return = [
+                'lesson_order_id' => $lesson_order_id,
+                'returntype' => 3,
+            ];
+            $this->success(1,$return);
         }
     }