作者 邓超

增加代理

@@ -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){ 306 + if($this->cacheNoData){
308 return $data; 307 return $data;
309 } 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,18 +292,20 @@ class MailFun { @@ -292,18 +292,20 @@ 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 + }else{
303 // 发送成功直接返回 304 // 发送成功直接返回
304 if($mail->send()){ 305 if($mail->send()){
305 return [true,$mail->getLastMessageID()]; 306 return [true,$mail->getLastMessageID()];
306 } 307 }
  308 + }
307 309
308 } 310 }
309 311