|
...
|
...
|
@@ -37,7 +37,7 @@ class Temp extends Command |
|
|
|
* @author Akun
|
|
|
|
* @date 2024/11/18 15:07
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
public function handle5()
|
|
|
|
{
|
|
|
|
$projects = Project::select(['id'])->orderBy('id', 'asc')->get();
|
|
|
|
foreach ($projects as $project) {
|
|
...
|
...
|
@@ -236,7 +236,7 @@ class Temp extends Command |
|
|
|
* @author Akun
|
|
|
|
* @date 2024/09/26 10:48
|
|
|
|
*/
|
|
|
|
public function handle1()
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$notify_model = new Notify();
|
|
|
|
$project_model = new Project();
|
|
...
|
...
|
@@ -254,10 +254,12 @@ class Temp extends Command |
|
|
|
$project_info = $project_model->read(['id' => $project_id], ['serve_id']);
|
|
|
|
if (!$project_info) {
|
|
|
|
$this->output('未查询到项目数据');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$serve_ip_info = $serve_ip_model->read(['id' => $project_info['serve_id']], ['servers_id']);
|
|
|
|
if (!$serve_ip_info) {
|
|
|
|
$this->output('未查询到服务器数据');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$servers_id = $serve_ip_info['servers_id'];
|
|
|
|
|
|
...
|
...
|
@@ -290,9 +292,17 @@ class Temp extends Command |
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//其他服务器:请求对应C端接口
|
|
|
|
$c_url = $domain . '/api/update_page/?project_id=' . $project_id . '&type=3';
|
|
|
|
$re = http_get($c_url);
|
|
|
|
$this->output($re['message'] ?? '');
|
|
|
|
$c_url = $domain . '/api/update_page/';
|
|
|
|
$c_params = [
|
|
|
|
'project_id' => $project_id,
|
|
|
|
'type' => 3
|
|
|
|
];
|
|
|
|
$re = http_post($c_url, json_encode($c_params), [], true);
|
|
|
|
if (isset($re['status']) && $re['status'] == 200) {
|
|
|
|
$this->output($c_url . ' | 请求成功');
|
|
|
|
} else {
|
|
|
|
$this->output($c_url . ' | ' . ($re['message'] ?? '未返回失败原因'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->output('项目id:' . $project_id . ',end');
|
|
|
|
}
|
|
...
|
...
|
@@ -300,6 +310,6 @@ class Temp extends Command |
|
|
|
|
|
|
|
public function output($msg)
|
|
|
|
{
|
|
|
|
echo $msg . PHP_EOL;
|
|
|
|
echo date('Y-m-d H:i:s') . ' | ' . $msg . PHP_EOL;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|