作者 李美松

优化程序

... ... @@ -55,10 +55,10 @@ class ProjectFilePDF extends Command
public function start(): int
{
# 1 - 未生成
# 2 - 已生成
# 3 - 其它问题
$is_pdf = 1;
# 0 - 未生成
# 1 - 已生成
# 2 - 其它问题
$is_pdf = 0;
$lists = $this->ProjectAssociation::query()->where('is_pdf', $is_pdf)
->where('project_id', '!=', 0)
->where('friend_id', '!=', 0)
... ... @@ -90,7 +90,7 @@ class ProjectFilePDF extends Command
$isRes = $this->DataFile->saveData(compact('project_id', 'user_id', 'friend_id', 'file_path') + ['time' => $this->time]);
if (!$isRes) {
if ($count == 2) {
$lists->is_pdf = 3;
$lists->is_pdf = 2;
$lists->save();
$this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key);
} else {
... ... @@ -98,7 +98,7 @@ class ProjectFilePDF extends Command
$this->debug_echo('项目文件数据保存失败! - ' . $key);
}
}
$lists->is_pdf = 2;
$lists->is_pdf = 1;
$lists->save();
$this->debug_echo('项目文件数据保存成功!');
return 0;
... ...
... ... @@ -41,10 +41,10 @@ class WebsiteData extends Command
public function start(): int
{
# 1 - 未推送
# 2 - 已推送
# 3 - 其他问题
$status = 1;
# 0 - 未推送
# 1 - 已推送
# 2 - 其他问题
$status = 0;
$lists = DataFile::query()->where('status', $status)
->where('created_at', 'like', $this->time . '%')->first();
if (is_null($lists)) {
... ... @@ -64,7 +64,7 @@ class WebsiteData extends Command
}
if ($status_code != 200) {
if ($count == 2) {
$lists->status = 3;
$lists->status = 2;
$lists->save();
$this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key);
} else {
... ... @@ -72,7 +72,7 @@ class WebsiteData extends Command
$this->debug_echo('项目文件数据保存失败! - ' . $key);
}
}
$lists->status = 2;
$lists->status = 1;
$lists->save();
$this->info('项目文件数据保存成功!');
return 0;
... ...