【发布时间】:2019-02-08 17:27:56
【问题描述】:
我开发了注册模块,我想使用电子邮件、nationalCode 或 mobile 检查在我的 web 应用程序中注册的用户,我有两个表 users 和 userInfo ,我将电子邮件存储在 users 表中,并将 nationalCode 和 mobile 存储在 userInfo 表中,我想编写代码来检测我的两个表中是否存在用户的电子邮件或国家代码或手机,我显示用户已在我的站点中注册的警告文本,请帮助我完成这项工作,
我使用步骤表单并编写 ajax 来调用方法来完成此任务, 请注意,用户可能有三个匹配项,或者只有一个匹配项 感谢您的帮助:)
这里是ajax代码:
$.ajax({
url: url',
type: 'POST',
data: {
_token: CSRF_TOKEN ,
code:code,
email:email,
mobile:mobile,
},
dataType: 'JSON',
success:function(data) {
//return data
}
});
这是我的方法是控制器
public function checkUser(Request $request)
{
$email = $request->email;
$mobile = $request->mobile;
$code = $request->code;
//here the query to detect user exist with three params
}
【问题讨论】:
标签: php laravel laravel-5 registration