作者 zhl

添加AI blog链接

@@ -9,6 +9,7 @@ namespace App\Http\Controllers\Api; @@ -9,6 +9,7 @@ namespace App\Http\Controllers\Api;
9 9
10 use App\Enums\Common\Code; 10 use App\Enums\Common\Code;
11 use App\Http\Logic\Bside\User\UserLoginLogic; 11 use App\Http\Logic\Bside\User\UserLoginLogic;
  12 +use App\Models\Ai\AiBlog;
12 use App\Models\Blog\Blog; 13 use App\Models\Blog\Blog;
13 use App\Models\Domain\DomainInfo; 14 use App\Models\Domain\DomainInfo;
14 use App\Models\News\News; 15 use App\Models\News\News;
@@ -313,16 +314,17 @@ class PrivateController extends BaseController @@ -313,16 +314,17 @@ class PrivateController extends BaseController
313 ProjectServer::useProject($project->id); 314 ProjectServer::useProject($project->id);
314 $result = []; 315 $result = [];
315 // 查询有效时间后 有效的产品、新闻、博客、聚合页 链接 316 // 查询有效时间后 有效的产品、新闻、博客、聚合页 链接
316 - $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route'); 317 +// $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route');
317 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 318 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
318 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 319 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
319 // $keyword = Keyword::where('created_at', '>', $date)->pluck('route'); 320 // $keyword = Keyword::where('created_at', '>', $date)->pluck('route');
  321 + $ai_blog = AiBlog::where(['status' => AiBlog::STATUS_FINISH])->where('updated_at', '>=', $date)->pluck('route');
320 322
321 // 组装链接 323 // 组装链接
322 - foreach ($product as $item) {  
323 - $url = 'https://' . $domain . '/' . $item;  
324 - array_push($result, $url);  
325 - } 324 +// foreach ($product as $item) {
  325 +// $url = 'https://' . $domain . '/' . $item;
  326 +// array_push($result, $url);
  327 +// }
326 // foreach ($keyword as $item) { 328 // foreach ($keyword as $item) {
327 // $url = 'https://' . $domain . '/' . $item; 329 // $url = 'https://' . $domain . '/' . $item;
328 // array_push($result, $url); 330 // array_push($result, $url);
@@ -335,6 +337,10 @@ class PrivateController extends BaseController @@ -335,6 +337,10 @@ class PrivateController extends BaseController
335 $url = 'https://' . $domain . '/blogs/' . $item; 337 $url = 'https://' . $domain . '/blogs/' . $item;
336 array_push($result, $url); 338 array_push($result, $url);
337 } 339 }
  340 + foreach ($ai_blog as $item) {
  341 + $url = 'https://' . $domain . '/blog/' . $item;
  342 + array_push($result, $url);
  343 + }
338 return $this->success($result); 344 return $this->success($result);
339 } 345 }
340 346
@@ -10,4 +10,7 @@ class AiBlog extends Base @@ -10,4 +10,7 @@ class AiBlog extends Base
10 //连接数据库 10 //连接数据库
11 protected $connection = 'custom_mysql'; 11 protected $connection = 'custom_mysql';
12 12
  13 + const STATUS_INIT = 0;
  14 + const STATUS_RUNNING = 1;
  15 + const STATUS_FINISH = 2;
13 } 16 }