作者 lyh

gx

... ... @@ -132,9 +132,6 @@ class LoginLogic extends BaseLogic
//账号密码没通过时,验证验证码
$smsModel = new SmsLog();
$smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_MANAGER_LOGIN])->orderBy('id','desc')->first()->toArray();
var_dump($smsInfo['created_at']);
var_dump(date('Y-m-d H:i:s',time() - 300));
die();
if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
$this->fail('账号密码错误/验证码错误',Code::USER_REGISTER_ERROE);
}
... ...
... ... @@ -30,7 +30,7 @@ class SmsLog extends Base
*/
public static function createLog($mobile, $code, $type = self::TYPE_LOGIN, $content = '')
{
$created_at = $updated_at = date('Y-m-d H:i:s');
$created_at = $updated_at = date('Y-m-d H:i:s',time());
$array = compact('type', 'mobile', 'code', 'content', 'updated_at', 'created_at');
return self::insert($array);
}
... ...