作者 xiaohu thinkpad

修复预约后不能再预约的问题

... ... @@ -135,9 +135,11 @@ class YuyueController extends UserBaseController
} else {
$data['teach_id'] = intval($tech_id);
$data['uid'] = session('user.id');
$data['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) {
... ... @@ -286,7 +288,9 @@ 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'=>'抱歉,您已经预约过']);
}
... ...