作者 xiaohu thinkpad

已经成功报名的用户,不能再次报名 放在确认订单页面

... ... @@ -25,13 +25,13 @@ class IndexController extends HomeBaseController
//step1 在线报名
public function online_baoming()
{
$re = Db::name('user')->where(['openid'=>session('openid')])->find();
// $re = Db::name('user')->where(['openid'=>session('openid')])->find();
if($re && $re['student_type'] == '1'){
$this->success('您已成功报名,无需再次报名',url('user/login/index'));
}elseif ($re['user_type'] == '3'){
$this->success('教练无需报名',url('user/login/index'));
}
// if($re && $re['student_type'] == '1'){
// $this->success('您已成功报名,无需再次报名',url('user/login/index'));
// }elseif ($re['user_type'] == '3'){
// $this->success('教练无需报名',url('user/login/index'));
// }
$res = Db::name('goods')->where(['delete_time' => '0', 'status' => '1'])->select()->toArray();
$this->assign('data', $res);
... ... @@ -63,6 +63,12 @@ class IndexController extends HomeBaseController
//step4 提交报名信息ajax
public function baoming_do()
{
$re = Db::name('user')->where(['openid'=>session('openid')])->find();
if($re && $re['student_type'] == '1'){
return json(['code' => '0', 'msg' => '您已成功报名,无需再次报名']);
}elseif ($re['user_type'] == '3'){
return json(['code' => '0', 'msg' => '教练无需报名']);
}
$rules = [
'name' => 'require',
'sex' => 'require',
... ...