Browse Source

短信次数限制

lizhen_gitee 11 months ago
parent
commit
fb078ee687
2 changed files with 3 additions and 3 deletions
  1. 2 2
      application/api/controller/Match.php
  2. 1 1
      application/api/controller/Sms.php

+ 2 - 2
application/api/controller/Match.php

@@ -691,7 +691,7 @@ class Match extends Api
         $this->success('亲密度等级信息', $data);
     }
 
-//////////////////////////////////////////////////////////////
+
     //聊天匹配
     public function gettypinguser(){
 
@@ -727,7 +727,7 @@ class Match extends Api
 
         $this->success('success',$lists);
     }
-
+//////////////////////////////////////////////////////////////
     //过滤规则
     private function fliter_user($lists){
 

+ 1 - 1
application/api/controller/Sms.php

@@ -47,7 +47,7 @@ class Sms extends Api
         if ($last && time() - $last['createtime'] < 60) {
             $this->error(__('发送频繁'));
         }
-        $ipSendTotal = \app\common\model\Sms::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count();
+        $ipSendTotal = \app\common\model\Sms::where(['ip' => $this->request->ip()])->whereTime('createtime', 'today')->count();
         if ($ipSendTotal >= 5) {
             $this->error(__('ip发送频繁'));
         }