正在显示
3 个修改的文件
包含
13 行增加
和
11 行删除
@@ -529,7 +529,7 @@ class Home extends Base { | @@ -529,7 +529,7 @@ class Home extends Base { | ||
529 | } | 529 | } |
530 | else{ | 530 | else{ |
531 | // 立即发送 | 531 | // 立即发送 |
532 | - $email['hot_email'] = db()->count("select count(*) from `hot_mail` where ".dbWhere(['email'=>$email['email']])); | 532 | + $email['hot_email'] = db()->cache(86400,false)->count("select count(*) from `hot_mail` where ".dbWhere(['email'=>$email['email']])); |
533 | $result = MailFun::sendEmail($sendData,$email); | 533 | $result = MailFun::sendEmail($sendData,$email); |
534 | if($result[0]){ | 534 | if($result[0]){ |
535 | app()->_json(['messageId' => $result[1]]); | 535 | app()->_json(['messageId' => $result[1]]); |
@@ -303,12 +303,12 @@ trait DbQuery { | @@ -303,12 +303,12 @@ trait DbQuery { | ||
303 | if(redis()->has($key)){ | 303 | if(redis()->has($key)){ |
304 | $this->cache = 0; | 304 | $this->cache = 0; |
305 | $data = redis()->get($key,$default); | 305 | $data = redis()->get($key,$default); |
306 | - if(!$this->cacheNoData){ | ||
307 | - if($data || $data === 0){ | ||
308 | - return $data; | ||
309 | - } | 306 | + if($this->cacheNoData){ |
307 | + return $data; | ||
308 | + } | ||
309 | + if($data){ | ||
310 | + return $data; | ||
310 | } | 311 | } |
311 | - | ||
312 | } | 312 | } |
313 | }catch (\Throwable $e){ | 313 | }catch (\Throwable $e){ |
314 | logs($e->getMessage()); | 314 | logs($e->getMessage()); |
@@ -292,17 +292,19 @@ class MailFun { | @@ -292,17 +292,19 @@ class MailFun { | ||
292 | if($mail->send()){ | 292 | if($mail->send()){ |
293 | return [true,$mail->getLastMessageID()]; | 293 | return [true,$mail->getLastMessageID()]; |
294 | } | 294 | } |
295 | + // 只执行一次 | ||
296 | + break; | ||
295 | } | 297 | } |
296 | 298 | ||
297 | // 以上全部失败了,再次 本服务器发送 | 299 | // 以上全部失败了,再次 本服务器发送 |
298 | $mail->Port = $smtp['port']; | 300 | $mail->Port = $smtp['port']; |
299 | $mail->Host = $smtp['host']; | 301 | $mail->Host = $smtp['host']; |
300 | $mail->send_proxy_host = ''; | 302 | $mail->send_proxy_host = ''; |
301 | - } | ||
302 | - | ||
303 | - // 发送成功直接返回 | ||
304 | - if($mail->send()){ | ||
305 | - return [true,$mail->getLastMessageID()]; | 303 | + }else{ |
304 | + // 发送成功直接返回 | ||
305 | + if($mail->send()){ | ||
306 | + return [true,$mail->getLastMessageID()]; | ||
307 | + } | ||
306 | } | 308 | } |
307 | 309 | ||
308 | } | 310 | } |
-
请 注册 或 登录 后发表评论