作者 lyh

gx

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