|
@@ -143,6 +143,14 @@ class Lessonorder extends Backend
|
|
|
$this->error('取消失败');
|
|
|
}
|
|
|
|
|
|
+ //更新已预约人数
|
|
|
+ $pay_number = Db::name('lesson_order')->where('slot_id',$info['slot_id'])->where('order_status',10)->sum('usernumber');
|
|
|
+ $rs_slot = Db::name('lesson_slot')->where('id',$info['slot_id'])->update(['bookednum' => $pay_number]);
|
|
|
+ if($rs_slot === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('取消失败');
|
|
|
+ }
|
|
|
+
|
|
|
Db::commit();
|
|
|
|
|
|
$slot_info = Db::name('lesson_slot')->where('id',$info['slot_id'])->find();
|