作者 lyh

未续费项目增加搜索

@@ -37,55 +37,23 @@ class SyncTimeFiles extends Command @@ -37,55 +37,23 @@ class SyncTimeFiles extends Command
37 $lists = $fileModel->list(['created_at'=>['between',[$start,$end]]]); 37 $lists = $fileModel->list(['created_at'=>['between',[$start,$end]]]);
38 foreach ($lists as $v){ 38 foreach ($lists as $v){
39 $path = $v['path']; 39 $path = $v['path'];
40 - $this->param['name'] = basename($path);  
41 - $this->param['path'] = str_replace('/'.$this->param['name'],'',$path);  
42 - $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);  
43 - $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';  
44 - echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;  
45 - $code = shell_exec($cmd); 40 + $code = $this->synchronizationFile($path);
46 if(200 != (int)$code){ 41 if(200 != (int)$code){
47 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; 42 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
48 -// $errorFileModel = new ErrorFile();  
49 -// $errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]); 43 + $errorFileModel = new ErrorFile();
  44 + $errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]);
50 } 45 }
51 echo date('Y-m-d H:i:s') . ' | ok:' . $code . PHP_EOL; 46 echo date('Y-m-d H:i:s') . ' | ok:' . $code . PHP_EOL;
52 } 47 }
53 return true; 48 return true;
54 } 49 }
55 50
56 - /**  
57 - * @remark :获取图片文件链接  
58 - * @name :getUrl  
59 - * @author :lyh  
60 - * @method :post  
61 - * @time :2024/5/22 11:53  
62 - */  
63 - public function getUrl($path,$storage_type,$location){  
64 - if(is_array($path)){  
65 - $url =[];  
66 - foreach ($path as $v){  
67 - $url[] = $this->getUrl($v,$storage_type,$location);  
68 - }  
69 - }else{  
70 - if(empty($path)){  
71 - return '';  
72 - }  
73 - if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){  
74 - return $path;  
75 - }  
76 - if(substr($path,0,2) == '//'){  
77 - return 'https:'.$path;  
78 - }  
79 - if($location == 0){  
80 - $cos = config('filesystems.disks.cos');  
81 - $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];  
82 - $url = $cosCdn.$path;  
83 - }else{  
84 - $s3 = config('filesystems.disks.s3');  
85 - $cdn = $s3['cdn'];  
86 - $url = $cdn.$path;  
87 - }  
88 - }  
89 - return $url; 51 + public function synchronizationFile($path_name){
  52 + //同步到大文件
  53 + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
  54 + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
  55 + $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
  56 + return shell_exec($cmd);
90 } 57 }
  58 +
91 } 59 }
@@ -42,7 +42,7 @@ class TicketLogic extends BaseLogic @@ -42,7 +42,7 @@ class TicketLogic extends BaseLogic
42 $date = date('Y-m-d');//今日时间 42 $date = date('Y-m-d');//今日时间
43 $data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单 43 $data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单
44 $data['processed_num'] = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日已处理工单 44 $data['processed_num'] = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日已处理工单
45 - $data['untreated_num'] = $ticketModel->counts(['end_at'=>null]);//今日未处理工单 45 + $data['untreated_num'] = $ticketModel->counts(['end_at'=>null,'plan_end_at'=>['like','%'.date('Y-m-d').'%']]);//今日未处理工单
46 $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side'); 46 $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side');
47 $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side'); 47 $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side');
48 $data['source'] = ['a'=>$submit_a_side,'b'=>$submit_b_side]; 48 $data['source'] = ['a'=>$submit_a_side,'b'=>$submit_b_side];