|
@@ -235,7 +235,7 @@ class VideoTask extends Command |
|
@@ -235,7 +235,7 @@ class VideoTask extends Command |
|
235
|
}
|
235
|
}
|
|
236
|
}
|
236
|
}
|
|
237
|
//TODO::所有产品
|
237
|
//TODO::所有产品
|
|
238
|
- $thumb = $this->getRecommendAndHotProducts($keywordInfo['route'],$project_id);
|
238
|
+ $thumb = $this->getRecommendAndHotProducts($keyword_id,$project_id);
|
|
239
|
$keyword_arr = Keyword::where("project_id",$project_id)->where("status",1)->inRandomOrder()->take(10)->pluck('title')->toArray();
|
239
|
$keyword_arr = Keyword::where("project_id",$project_id)->where("status",1)->inRandomOrder()->take(10)->pluck('title')->toArray();
|
|
240
|
$data = [
|
240
|
$data = [
|
|
241
|
'url'=> 'https://' . $domain.'/'.$keywordInfo['route'],
|
241
|
'url'=> 'https://' . $domain.'/'.$keywordInfo['route'],
|
|
@@ -251,11 +251,10 @@ class VideoTask extends Command |
|
@@ -251,11 +251,10 @@ class VideoTask extends Command |
|
251
|
/**
|
251
|
/**
|
|
252
|
* 关键词聚合页-推荐&热门产品
|
252
|
* 关键词聚合页-推荐&热门产品
|
|
253
|
*/
|
253
|
*/
|
|
254
|
- public function getRecommendAndHotProducts($route,$project_id): ?array
|
254
|
+ public function getRecommendAndHotProducts($keyword_id,$project_id): ?array
|
|
255
|
{
|
255
|
{
|
|
256
|
$productIds = [];
|
256
|
$productIds = [];
|
|
257
|
- $productKeyword = Keyword::where("project_id",$project_id)->where("route",$route)->first();
|
|
|
|
258
|
- if (!empty($productKeyword)){
|
257
|
+ $productKeyword = Keyword::where("project_id",$project_id)->where("id",$keyword_id)->first();
|
|
259
|
$productsQuery = Product::where("project_id", $project_id)->where("status",1)->where("keyword_id","like","%,".$productKeyword->id.",%")->limit(7)->get();
|
258
|
$productsQuery = Product::where("project_id", $project_id)->where("status",1)->where("keyword_id","like","%,".$productKeyword->id.",%")->limit(7)->get();
|
|
260
|
if (!empty($productsQuery)){
|
259
|
if (!empty($productsQuery)){
|
|
261
|
foreach ($productsQuery as $item){
|
260
|
foreach ($productsQuery as $item){
|
|
@@ -283,7 +282,7 @@ class VideoTask extends Command |
|
@@ -283,7 +282,7 @@ class VideoTask extends Command |
|
283
|
$products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
|
282
|
$products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
|
|
284
|
}
|
283
|
}
|
|
285
|
}
|
284
|
}
|
|
286
|
- }
|
285
|
+
|
|
287
|
$data = [];
|
286
|
$data = [];
|
|
288
|
if (!empty($products)){
|
287
|
if (!empty($products)){
|
|
289
|
foreach ($products as $item){
|
288
|
foreach ($products as $item){
|