Commit 557e0a9b authored by hujun's avatar hujun

短信验证码以最后一个为准

parent e61e1bd2
......@@ -203,13 +203,14 @@ class Member extends Basic
$jwt_phone = $jwt_data['data']['phone'];
$note = new NoteLog();
$note_data = $note->field('id,code,send_time')->where([
'phone'=> $phone,
'code' => $code,
'is_success' => 1,
])->whereTime('send_time', '>',time()-300)->find();
if (!$note_data) {
$note_data = $note->field('code')
->where('phone',$phone)
->where('is_success',1)
->whereTime('send_time', '>',time()-300)
->order('id DESC')->find();
if ($code != $note_data->code) {
return $this->response(101, '请重新获取验证码');
}
}
......@@ -486,13 +487,14 @@ class Member extends Basic
$data['msg'] = '';
$note = new NoteLog();
$note_data = $note->field('id,code,send_time')->where([
'phone'=> $phone,
'code' => $code,
'is_success' => 1,
])->whereTime('send_time', '>',time()-300)->find();
if ($note_data) {
$note_data = $note->field('code')
->where('phone',$phone)
->where('is_success',1)
->whereTime('send_time', '>',time()-300)
->order('id DESC')->find();
if ($code == $note_data->code) {
$data['status'] = 200;
} else {
$data['msg'] = '验证码错误';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment