作者 李美松

优化程序

@@ -55,10 +55,10 @@ class ProjectFilePDF extends Command @@ -55,10 +55,10 @@ class ProjectFilePDF extends Command
55 55
56 public function start(): int 56 public function start(): int
57 { 57 {
58 - # 1 - 未生成  
59 - # 2 - 已生成  
60 - # 3 - 其它问题  
61 - $is_pdf = 1; 58 + # 0 - 未生成
  59 + # 1 - 已生成
  60 + # 2 - 其它问题
  61 + $is_pdf = 0;
62 $lists = $this->ProjectAssociation::query()->where('is_pdf', $is_pdf) 62 $lists = $this->ProjectAssociation::query()->where('is_pdf', $is_pdf)
63 ->where('project_id', '!=', 0) 63 ->where('project_id', '!=', 0)
64 ->where('friend_id', '!=', 0) 64 ->where('friend_id', '!=', 0)
@@ -90,7 +90,7 @@ class ProjectFilePDF extends Command @@ -90,7 +90,7 @@ class ProjectFilePDF extends Command
90 $isRes = $this->DataFile->saveData(compact('project_id', 'user_id', 'friend_id', 'file_path') + ['time' => $this->time]); 90 $isRes = $this->DataFile->saveData(compact('project_id', 'user_id', 'friend_id', 'file_path') + ['time' => $this->time]);
91 if (!$isRes) { 91 if (!$isRes) {
92 if ($count == 2) { 92 if ($count == 2) {
93 - $lists->is_pdf = 3; 93 + $lists->is_pdf = 2;
94 $lists->save(); 94 $lists->save();
95 $this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key); 95 $this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key);
96 } else { 96 } else {
@@ -98,7 +98,7 @@ class ProjectFilePDF extends Command @@ -98,7 +98,7 @@ class ProjectFilePDF extends Command
98 $this->debug_echo('项目文件数据保存失败! - ' . $key); 98 $this->debug_echo('项目文件数据保存失败! - ' . $key);
99 } 99 }
100 } 100 }
101 - $lists->is_pdf = 2; 101 + $lists->is_pdf = 1;
102 $lists->save(); 102 $lists->save();
103 $this->debug_echo('项目文件数据保存成功!'); 103 $this->debug_echo('项目文件数据保存成功!');
104 return 0; 104 return 0;
@@ -41,10 +41,10 @@ class WebsiteData extends Command @@ -41,10 +41,10 @@ class WebsiteData extends Command
41 41
42 public function start(): int 42 public function start(): int
43 { 43 {
44 - # 1 - 未推送  
45 - # 2 - 已推送  
46 - # 3 - 其他问题  
47 - $status = 1; 44 + # 0 - 未推送
  45 + # 1 - 已推送
  46 + # 2 - 其他问题
  47 + $status = 0;
48 $lists = DataFile::query()->where('status', $status) 48 $lists = DataFile::query()->where('status', $status)
49 ->where('created_at', 'like', $this->time . '%')->first(); 49 ->where('created_at', 'like', $this->time . '%')->first();
50 if (is_null($lists)) { 50 if (is_null($lists)) {
@@ -64,7 +64,7 @@ class WebsiteData extends Command @@ -64,7 +64,7 @@ class WebsiteData extends Command
64 } 64 }
65 if ($status_code != 200) { 65 if ($status_code != 200) {
66 if ($count == 2) { 66 if ($count == 2) {
67 - $lists->status = 3; 67 + $lists->status = 2;
68 $lists->save(); 68 $lists->save();
69 $this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key); 69 $this->debug_echo('项目文件数据保存失败! - 其他原因 - ' . $key);
70 } else { 70 } else {
@@ -72,7 +72,7 @@ class WebsiteData extends Command @@ -72,7 +72,7 @@ class WebsiteData extends Command
72 $this->debug_echo('项目文件数据保存失败! - ' . $key); 72 $this->debug_echo('项目文件数据保存失败! - ' . $key);
73 } 73 }
74 } 74 }
75 - $lists->status = 2; 75 + $lists->status = 1;
76 $lists->save(); 76 $lists->save();
77 $this->info('项目文件数据保存成功!'); 77 $this->info('项目文件数据保存成功!');
78 return 0; 78 return 0;