作者 lyh

gx

@@ -10,6 +10,7 @@ namespace App\Console\Commands\Test; @@ -10,6 +10,7 @@ namespace App\Console\Commands\Test;
10 use App\Helper\Common; 10 use App\Helper\Common;
11 use App\Models\Blog\Blog; 11 use App\Models\Blog\Blog;
12 use App\Models\Devops\ServerConfig; 12 use App\Models\Devops\ServerConfig;
  13 +use App\Models\Domain\DomainInfo;
13 use App\Models\File\Image; 14 use App\Models\File\Image;
14 use App\Models\Manage\BelongingGroup; 15 use App\Models\Manage\BelongingGroup;
15 use App\Models\Manage\Dept; 16 use App\Models\Manage\Dept;
@@ -43,10 +44,10 @@ class Demo extends Command @@ -43,10 +44,10 @@ class Demo extends Command
43 * 44 *
44 * @return void 45 * @return void
45 */ 46 */
46 - public function __construct()  
47 - {  
48 - parent::__construct();  
49 - } 47 +// public function __construct()
  48 +// {
  49 +// parent::__construct();
  50 +// }
50 51
51 public function curlRequest($url, $data, $method = 'POST', $header = [], $time_out = 60) 52 public function curlRequest($url, $data, $method = 'POST', $header = [], $time_out = 60)
52 { 53 {
@@ -77,6 +78,7 @@ class Demo extends Command @@ -77,6 +78,7 @@ class Demo extends Command
77 */ 78 */
78 public function handle() 79 public function handle()
79 { 80 {
  81 + return $this->domain();
80 $result = app(SyncService::class)->projectAcceptAddress(1); 82 $result = app(SyncService::class)->projectAcceptAddress(1);
81 dd($result); 83 dd($result);
82 $data = [ 84 $data = [
@@ -293,4 +295,26 @@ class Demo extends Command @@ -293,4 +295,26 @@ class Demo extends Command
293 } 295 }
294 dd(1); 296 dd(1);
295 } 297 }
  298 +
  299 + /**
  300 + * @remark :获取域名
  301 + * @name :domain
  302 + * @author :lyh
  303 + * @method :post
  304 + * @time :2023/11/29 18:47
  305 + */
  306 + public function domain(){
  307 + $domainModel = new DomainInfo();
  308 + $lists = $domainModel->list();
  309 + foreach ($lists as $k => $v){
  310 + if($v['project_id'] != 0){
  311 + echo date('Y-m-d H:i:s') . ' start: ' . $v['project_id'] . PHP_EOL;
  312 + $domain = 'https://'.$v['domain'].'/';
  313 + $url = $domain.'/api/update_robots/?project_id='.$v['project_id'];
  314 + http_get($url);
  315 + echo date('Y-m-d H:i:s') . ' end: ' . $v['project_id'] . PHP_EOL;
  316 + }
  317 + }
  318 + return true;
  319 + }
296 } 320 }