正在显示
1 个修改的文件
包含
20 行增加
和
0 行删除
| @@ -4,7 +4,9 @@ namespace App\Console\Commands; | @@ -4,7 +4,9 @@ namespace App\Console\Commands; | ||
| 4 | 4 | ||
| 5 | use App\Helper\Common; | 5 | use App\Helper\Common; |
| 6 | use App\Models\Ai\AiCommand; | 6 | use App\Models\Ai\AiCommand; |
| 7 | +use App\Models\Mail\Mail; | ||
| 7 | use App\Models\Project\DeployOptimize; | 8 | use App\Models\Project\DeployOptimize; |
| 9 | +use App\Models\User\User; | ||
| 8 | use App\Services\ProjectServer; | 10 | use App\Services\ProjectServer; |
| 9 | use Illuminate\Console\Command; | 11 | use Illuminate\Console\Command; |
| 10 | use Illuminate\Support\Facades\DB; | 12 | use Illuminate\Support\Facades\DB; |
| @@ -64,6 +66,8 @@ class UpdateSeoTdk extends Command | @@ -64,6 +66,8 @@ class UpdateSeoTdk extends Command | ||
| 64 | $this->updateNews($project_id); | 66 | $this->updateNews($project_id); |
| 65 | $this->updateNewsCate($project_id); | 67 | $this->updateNewsCate($project_id); |
| 66 | $this->updatePage($project_id); | 68 | $this->updatePage($project_id); |
| 69 | + //发送站内信 | ||
| 70 | + $this->send_message($project_id); | ||
| 67 | DB::disconnect('custom_mysql'); | 71 | DB::disconnect('custom_mysql'); |
| 68 | }catch (\Exception $e){ | 72 | }catch (\Exception $e){ |
| 69 | echo date('Y-m-d H:i:s') . ' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL; | 73 | echo date('Y-m-d H:i:s') . ' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL; |
| @@ -419,4 +423,20 @@ class UpdateSeoTdk extends Command | @@ -419,4 +423,20 @@ class UpdateSeoTdk extends Command | ||
| 419 | return $data['text']; | 423 | return $data['text']; |
| 420 | } | 424 | } |
| 421 | 425 | ||
| 426 | + /** | ||
| 427 | + * @remark :发送站内信 | ||
| 428 | + * @name :send_message | ||
| 429 | + * @author :lyh | ||
| 430 | + * @method :post | ||
| 431 | + * @time :2023/11/4 10:22 | ||
| 432 | + */ | ||
| 433 | + public function send_message($project_id){ | ||
| 434 | + $user = new User(); | ||
| 435 | + $userInfo = $user->read(['project_id'=>$project_id,'role_id'=>0]); | ||
| 436 | + $data["title"] = "seo更新通知---完成"; | ||
| 437 | + $data["user_list"] = $userInfo['id']; | ||
| 438 | + $data["content"] = "seo更新成功,更新完成时间".date('Y-m-d H:i:s'); | ||
| 439 | + $mail = new Mail(); | ||
| 440 | + return $mail->add($data); | ||
| 441 | + } | ||
| 422 | } | 442 | } |
-
请 注册 或 登录 后发表评论