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