作者 zhaozzwei

更新 YuyueController.php

... ... @@ -127,14 +127,12 @@ class YuyueController extends UserBaseController
} else {
$data['teach_id'] = intval($tech_id);
$data['uid'] = session('user.id');
$data['status'] = array('neq','3');
$w['uid'] = session('user.id');
$w['status'] = array('neq','3');
//预约订单完成后才可以再次预约
$rr = Db::name('yuyue')->where($data)->order('create_time', 'desc')->find();
unset($data['status']);
$ytime = strtotime($rr['yuyue_day'].''.$rr['yuyue_end'].':00');
$tt = time();
if ( $ytime >$tt) {
$rr = Db::name('yuyue')->where($w)->find();
if ( $rr) {
return json(['code' => '0', 'msg' => '您好,您有待学车预约']);
}
... ... @@ -144,9 +142,9 @@ class YuyueController extends UserBaseController
$data['yuyue_begin'] = session('yuyue_pre.begin');
$ress = Db::name('yuyue')->where($data)->find();
if($ress){
return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
}
// if($ress){
// return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
// }
$data['status'] = '1';
$data['create_time'] = time();
... ... @@ -281,12 +279,15 @@ class YuyueController extends UserBaseController
$data['yuyue_begin'] = $begin;
$data['yuyue_end'] = $end;
$data['yuyue_week'] = $week;
$data['status'] = array('neq','3');
$ress = Db::name('yuyue')->where($data)->find();
unset($data['status']);
if($ress){
return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
$w['uid'] = session('user.id');
$w['status'] = array('neq','3');
//预约订单完成后才可以再次预约
$rr = Db::name('yuyue')->where($w)->find();
if ( $rr) {
return json(['code' => '0', 'msg' => '您好,您有待学车预约']);
}
$data['status'] = 1;
$data['create_time'] = time();
... ...