我的代码如下。
我面临问题。当我想通过username
and进行检查时password
。
password
每次都改变。所以我无法给出结果email password
。
public function login()
{
$data = Input::all();
print_r($data);
$email= $data['email'];
$password= bcrypt($data['password']);
echo $password;
$count = User::where('email', '=',$email);
$count->Where('password', '=', $password);
$count_row=$count->get()->count();
echo $count_row; die;
if($count_row==1)
{
$users = User::where('email', '=',$email);
$users->Where('password', '=', $password);
$users->select(
'id','name','email',
'username','address','zip',
'city','country','phone_number',
'domain','type') ;
$result=$users->get();
$response= response()->json(['success'=>true,'message'=>'success', 'data'=>$result]);
return $response;
}
else
{
$response= response()->json(['success'=>false,'message'=>'Not Login successfull']);
return $response;
}
}