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

修改预约提交逻辑

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