Browse Source

可以用试课预约,第二部分

lizhen_gitee 4 months ago
parent
commit
9cf6293417
1 changed files with 9 additions and 4 deletions
  1. 9 4
      application/admin/controller/Lessonslot.php

+ 9 - 4
application/admin/controller/Lessonslot.php

@@ -106,6 +106,9 @@ class Lessonslot extends Backend
             if($paytype == 4){
                 $number = 1; //试课只能选一个人
             }
+            if(empty($package_order) && empty($trylessonorder_id)){
+                $this->error('请选择任意一种支付方式');
+            }
 
             //课时
             $info = Db::name('lesson_slot')->alias('slot')
@@ -213,8 +216,6 @@ class Lessonslot extends Backend
                     $this->error('预约失败');
                 }
 
-                Db::commit();
-                $this->success('预约成功');
             }
             elseif($paytype == 4){
                 //使用试课单
@@ -263,9 +264,13 @@ class Lessonslot extends Backend
                     $this->error('预约失败');
                 }
 
-                Db::commit();
-                $this->success('预约成功');
             }
+
+            Db::commit();
+
+            //发送通知给用户
+
+            $this->success('预约成功');
         }
         $this->view->assign('row',$info);
         return $this->view->fetch();