소스 검색

邮件配置修改

任敬轩 2 년 전
부모
커밋
7899b79bad
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      app/Console/Commands/LogEmailSend.php

+ 7 - 0
app/Console/Commands/LogEmailSend.php

@@ -57,6 +57,8 @@ class LogEmailSend extends Command
     }
 
     public function loginfo($email){
+        $mine_count = DB::table('mine_list')->where('parent_id',0)->where('deleted_at',null)->get();
+
         $mine_array = explode(';',$email->mine_id_list);
         $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
         $mine_use = [];//权限内矿区下所有区域
@@ -79,6 +81,11 @@ class LogEmailSend extends Command
             $mine_export = $mine_export.$v->title.'和';
         }
         $mine_export = substr($mine_export,0,strlen($mine_export)-3).date("Y-m-d",strtotime("yesterday")).'访问记录';
+
+        if(count($mine_list) == count($mine_count)){
+            $mine_export = '全矿'.date("Y-m-d",strtotime("yesterday")).'访问记录';
+        }
+
         $start_time = date("Y-m-d H:i:s",strtotime("yesterday"));
         $end_time = date("Y-m-d H:i:s",strtotime("today"));
         $log_list = $log_list->whereBetween('log.created_at',[$start_time,$end_time]);