作者 lyh

gx

@@ -63,7 +63,7 @@ class DomainInfo extends Command @@ -63,7 +63,7 @@ class DomainInfo extends Command
63 public function startUpdateDomain() 63 public function startUpdateDomain()
64 { 64 {
65 $domainModel = new DomainInfoModel(); 65 $domainModel = new DomainInfoModel();
66 - $list = $domainModel->where('status', '!=', 2)->where(function ($query) { 66 + $list = $domainModel->where('status', '=', 1)->where(function ($query) {
67 $query->whereNull('domain_end_time')->orWhere('domain_end_time', '<', date('Y-m-d H:i:s')); 67 $query->whereNull('domain_end_time')->orWhere('domain_end_time', '<', date('Y-m-d H:i:s'));
68 })->get()->toArray(); 68 })->get()->toArray();
69 foreach ($list as $v) { 69 foreach ($list as $v) {
@@ -87,7 +87,7 @@ class DomainInfo extends Command @@ -87,7 +87,7 @@ class DomainInfo extends Command
87 $domainModel = new DomainInfoModel(); 87 $domainModel = new DomainInfoModel();
88 $projectModel = new Project(); 88 $projectModel = new Project();
89 $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期 89 $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期
90 - $list = $domainModel->where('status', '!=', 2)->where(function ($query) use ($end_day) { 90 + $list = $domainModel->where('status', '=', 1)->where(function ($query) use ($end_day) {
91 $query->whereNull('certificate_end_time')->orWhere('certificate_end_time', '<', $end_day); 91 $query->whereNull('certificate_end_time')->orWhere('certificate_end_time', '<', $end_day);
92 })->get()->toArray(); 92 })->get()->toArray();
93 foreach ($list as $v) { 93 foreach ($list as $v) {
@@ -99,7 +99,7 @@ class DomainInfo extends Command @@ -99,7 +99,7 @@ class DomainInfo extends Command
99 $ssl['to'] && $data['certificate_end_time'] = $ssl['to']; 99 $ssl['to'] && $data['certificate_end_time'] = $ssl['to'];
100 100
101 $project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']); 101 $project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']);
102 - if ($v['type'] == 1 && $ssl['to'] < $end_day && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) { 102 + if ($v['type'] == 1 && $ssl['to'] < $end_day && $project_info && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) {
103 //非自建站项目,申请免费证书 103 //非自建站项目,申请免费证书
104 $this->updatePrivate($v); 104 $this->updatePrivate($v);
105 105
@@ -122,7 +122,7 @@ class DomainInfo extends Command @@ -122,7 +122,7 @@ class DomainInfo extends Command
122 $domainModel = new DomainInfoModel(); 122 $domainModel = new DomainInfoModel();
123 $projectModel = new Project(); 123 $projectModel = new Project();
124 $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期 124 $end_day = date('Y-m-d H:i:s', time() + 3 * 24 * 3600);//3天后到期
125 - $list = $domainModel->where('status', '!=', 2)->where('amp_status', 1)->where(function ($query) use ($end_day) { 125 + $list = $domainModel->where('status', '=', 1)->where('amp_status', 1)->where(function ($query) use ($end_day) {
126 $query->whereNull('amp_certificate_end_time')->orWhere('amp_certificate_end_time', '<', $end_day); 126 $query->whereNull('amp_certificate_end_time')->orWhere('amp_certificate_end_time', '<', $end_day);
127 })->get()->toArray(); 127 })->get()->toArray();
128 foreach ($list as $v) { 128 foreach ($list as $v) {
@@ -143,7 +143,7 @@ class DomainInfo extends Command @@ -143,7 +143,7 @@ class DomainInfo extends Command
143 $ssl['to'] && $data['amp_certificate_end_time'] = $ssl['to']; 143 $ssl['to'] && $data['amp_certificate_end_time'] = $ssl['to'];
144 144
145 $project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']); 145 $project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']);
146 - if ($v['amp_type'] == 1 && $ssl['to'] < $end_day && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) { 146 + if ($v['amp_type'] == 1 && $ssl['to'] < $end_day && $project_info && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) {
147 //非自建站项目,申请免费证书 147 //非自建站项目,申请免费证书
148 $this->updateAmpPrivate($v['domain']); 148 $this->updateAmpPrivate($v['domain']);
149 149
@@ -7,10 +7,7 @@ @@ -7,10 +7,7 @@
7 */ 7 */
8 namespace App\Console\Commands\Test; 8 namespace App\Console\Commands\Test;
9 9
10 -use App\Helper\Common;  
11 -use App\Models\Blog\Blog;  
12 -use App\Models\Devops\ServerConfig;  
13 -use App\Models\Domain\DomainInfo; 10 +
14 use App\Models\File\File; 11 use App\Models\File\File;
15 use App\Models\File\File as FileModel; 12 use App\Models\File\File as FileModel;
16 use App\Models\File\Image; 13 use App\Models\File\Image;
@@ -59,8 +56,8 @@ class Demo extends Command @@ -59,8 +56,8 @@ class Demo extends Command
59 protected $description = 'demo'; 56 protected $description = 'demo';
60 57
61 58
62 -  
63 - public function handle(){ 59 + public function handle()
  60 + {
64 61
65 } 62 }
66 63
@@ -43,7 +43,7 @@ class ServerConfigLogic extends BaseLogic @@ -43,7 +43,7 @@ class ServerConfigLogic extends BaseLogic
43 $projectModel = new Project(); 43 $projectModel = new Project();
44 foreach ($lists['list'] as $k => $v){ 44 foreach ($lists['list'] as $k => $v){
45 if($v['type'] == $this->model::TYPE_SERVER){ 45 if($v['type'] == $this->model::TYPE_SERVER){
46 - $v['count'] = $projectModel->where(['serve_id'=>$v['id']])->count(); 46 + $v['count'] = $projectModel->where(['serve_id'=>$v['id'],'delete_status'=>0])->count();
47 } 47 }
48 $lists['list'][$k] = $v; 48 $lists['list'][$k] = $v;
49 } 49 }
@@ -143,7 +143,7 @@ class ProjectLogic extends BaseLogic @@ -143,7 +143,7 @@ class ProjectLogic extends BaseLogic
143 public function projectSave(){ 143 public function projectSave(){
144 DB::beginTransaction(); 144 DB::beginTransaction();
145 try { 145 try {
146 - $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 146 +// $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
147 if($this->param['type'] == Project::TYPE_SEVEN){ 147 if($this->param['type'] == Project::TYPE_SEVEN){
148 //错误单直接返回,单独处理 148 //错误单直接返回,单独处理
149 $this->setTypeSevenEdit($this->param); 149 $this->setTypeSevenEdit($this->param);
@@ -46,6 +46,7 @@ class CopyImageFileJob implements ShouldQueue @@ -46,6 +46,7 @@ class CopyImageFileJob implements ShouldQueue
46 echo date('Y-m-d H:i:s') . '执行图片的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; 46 echo date('Y-m-d H:i:s') . '执行图片的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
47 $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); 47 $amazonS3Service->syncImageFiles(getImageUrl($v['path']));
48 $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); 48 $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]);
  49 + gc_collect_cycles();
49 } 50 }
50 } 51 }
51 52
@@ -57,6 +58,7 @@ class CopyImageFileJob implements ShouldQueue @@ -57,6 +58,7 @@ class CopyImageFileJob implements ShouldQueue
57 echo date('Y-m-d H:i:s') . '执行文件的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; 58 echo date('Y-m-d H:i:s') . '执行文件的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
58 $amazonS3Service->syncImageFiles(getFileUrl($v['path'])); 59 $amazonS3Service->syncImageFiles(getFileUrl($v['path']));
59 $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); 60 $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]);
  61 + gc_collect_cycles();
60 } 62 }
61 } 63 }
62 return true; 64 return true;