作者 赵彬吉

update

... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Ai\AiBlog;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
... ... @@ -361,8 +362,19 @@ class WebTraffic extends Command
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
->whereNull('deleted_at')
->inRandomOrder()
->limit(100)
->pluck('route', 'id')->toArray();
//已发布AI博客
$ai_blog_urls = DB::connection('custom_mysql')->table('gl_ai_blog')
->where('project_id', $project_id)->where('status', AiBlog::STATUS_FINISH)
->inRandomOrder()
->limit(20)
->pluck('route', 'id')->toArray();
$data['urls_details'] = array_merge($data['urls_details'], $ai_blog_urls);
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
if(empty($data['urls_cats'])){
$data['urls_cats'] = $data['urls_details'];
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Ai\AiBlog;
use App\Models\HomeCount\Count;
use App\Models\Product\Category;
use App\Models\Product\Product;
... ... @@ -320,6 +321,7 @@ class WebTrafficFix extends Command
* 获取产品分类、单页和详情链接
*/
protected function getProductUrls($project_id){
ProjectServer::useProject($project_id);
//已发布产品分类页面
$data['urls_cats'] = DB::connection('custom_mysql')->table('gl_product_category')
->where('project_id', $project_id)->where('status', Category::STATUS_ACTIVE)
... ... @@ -335,8 +337,19 @@ class WebTrafficFix extends Command
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
->whereNull('deleted_at')
->inRandomOrder()
->limit(100)
->pluck('route', 'id')->toArray();
//已发布AI博客
$ai_blog_urls = DB::connection('custom_mysql')->table('gl_ai_blog')
->where('project_id', $project_id)->where('status', AiBlog::STATUS_FINISH)
->inRandomOrder()
->limit(20)
->pluck('route', 'id')->toArray();
$data['urls_details'] = array_merge($data['urls_details'], $ai_blog_urls);
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
if(empty($data['urls_cats'])){
$data['urls_cats'] = $data['urls_details'];
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Ai\AiBlog;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
... ... @@ -391,8 +392,19 @@ class WebTrafficRussia extends Command
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
->whereNull('deleted_at')
->inRandomOrder()
->limit(100)
->pluck('route', 'id')->toArray();
//已发布AI博客
$ai_blog_urls = DB::connection('custom_mysql')->table('gl_ai_blog')
->where('project_id', $project_id)->where('status', AiBlog::STATUS_FINISH)
->inRandomOrder()
->limit(20)
->pluck('route', 'id')->toArray();
$data['urls_details'] = array_merge($data['urls_details'], $ai_blog_urls);
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
if(empty($data['urls_cats'])){
$data['urls_cats'] = $data['urls_details'];
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Ai\AiBlog;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
... ... @@ -382,8 +383,19 @@ class WebTrafficRussiaSpecial extends Command
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
->whereNull('deleted_at')
->inRandomOrder()
->limit(100)
->pluck('route', 'id')->toArray();
//已发布AI博客
$ai_blog_urls = DB::connection('custom_mysql')->table('gl_ai_blog')
->where('project_id', $project_id)->where('status', AiBlog::STATUS_FINISH)
->inRandomOrder()
->limit(20)
->pluck('route', 'id')->toArray();
$data['urls_details'] = array_merge($data['urls_details'], $ai_blog_urls);
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
if(empty($data['urls_cats'])){
$data['urls_cats'] = $data['urls_details'];
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Ai\AiBlog;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
... ... @@ -348,8 +349,19 @@ class WebTrafficSpecial extends Command
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
->whereNull('deleted_at')
->inRandomOrder()
->limit(100)
->pluck('route', 'id')->toArray();
//已发布AI博客
$ai_blog_urls = DB::connection('custom_mysql')->table('gl_ai_blog')
->where('project_id', $project_id)->where('status', AiBlog::STATUS_FINISH)
->inRandomOrder()
->limit(20)
->pluck('route', 'id')->toArray();
$data['urls_details'] = array_merge($data['urls_details'], $ai_blog_urls);
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
if(empty($data['urls_cats'])){
$data['urls_cats'] = $data['urls_details'];
... ...