作者 sgj
1 个管道 的构建 通过 耗费 0 秒

修改预约提交逻辑

@@ -296,8 +296,7 @@ class YuyueController extends UserBaseController @@ -296,8 +296,7 @@ class YuyueController extends UserBaseController
296 $exist_map['yuyue_week'] = $week; 296 $exist_map['yuyue_week'] = $week;
297 $exist_map['yuyue_end'] = [['>',$begin],['<=',$end],'and']; 297 $exist_map['yuyue_end'] = [['>',$begin],['<=',$end],'and'];
298 $is_exist=\db('yuyue')->where($exist_map)->find(); 298 $is_exist=\db('yuyue')->where($exist_map)->find();
299 - dump(\db('yuyue')->getLastSql());  
300 - dump($is_exist); 299 +
301 $exist_map1['yuyue_begin'] = ['>=',$begin]; 300 $exist_map1['yuyue_begin'] = ['>=',$begin];
302 $exist_map1['teach_id'] = intval($tech_id); 301 $exist_map1['teach_id'] = intval($tech_id);
303 $exist_map1['yuyue_day'] = $day; 302 $exist_map1['yuyue_day'] = $day;
@@ -305,8 +304,7 @@ class YuyueController extends UserBaseController @@ -305,8 +304,7 @@ class YuyueController extends UserBaseController
305 $exist_map1['yuyue_end'] = ['<=',$end]; 304 $exist_map1['yuyue_end'] = ['<=',$end];
306 305
307 $is_exist1=\db('yuyue')->where($exist_map1)->find(); 306 $is_exist1=\db('yuyue')->where($exist_map1)->find();
308 - dump(\db('yuyue')->getLastSql());  
309 - dump($is_exist1); 307 +
310 308
311 if (!empty($is_exist)||!empty($is_exist1)){ 309 if (!empty($is_exist)||!empty($is_exist1)){
312 return json(['code' => '0', 'msg' => '您好,您的预约时间与其他学员冲突,请刷新后提交!']); 310 return json(['code' => '0', 'msg' => '您好,您的预约时间与其他学员冲突,请刷新后提交!']);