Commit 51ad8e25 authored by hujun's avatar hujun

5分钟内不能获取短信

parent 3c56424e
......@@ -100,16 +100,20 @@ class Member extends Basic
if ($this->request->param('phone')) {
$phone = $this->request->param('phone');
$noteLog = new NoteLog();
$num = $noteLog->where('phone', $phone)
if (check_phone($phone)) {
$noteLog = new NoteLog();
$send_time = $noteLog->field('send_time')->where('phone', $phone)
->where('is_success',1)
->where('send_time','between time',[date('Y-m-d').' 00:00:00',date('Y-m-d').' 23:59:59'])
->count();
if (check_phone($phone)) {
// if ($num > 7) {
// $data['msg'] = '短信发送超过上限';
// } else {
->select();
$num = count($send_time); //发送数量
if ((time() - strtotime($send_time[$num-1]->send_time) < 300) && $num != 0) {
$data['msg'] = '5分钟内不能再次获取验证码';
} elseif ($num > 7){
$data['msg'] = '短信发送超过上限';
} else {
$result['statusMsg'] = '';
$result['statusCode'] = '';
......@@ -143,7 +147,7 @@ class Member extends Basic
$data['msg'] = '短信发送失败';
}
$noteLog->save();
// }
}
} else {
$data['msg'] = '手机号码错误';
}
......
......@@ -10,6 +10,8 @@
// +----------------------------------------------------------------------
use think\Route;
Route::rule('/','index/login/login');
Route::group('app', [
'index' => [ 'app/index/index', [ 'method' => 'get' ] ],
'agent_detail' => [ 'app/index/agent_detail', [ 'method' => 'get' ] ],
......
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