作者 lyh

gx

... ... @@ -295,7 +295,7 @@ class Demo extends Command
'keyword_content'=>$keywordInfo['keyword_content'],
'product_list'=>$thumb ?? []
];
echo '返回数据'.json_encode($data);
echo '返回数据'.$data;
return $data;
}
... ... @@ -306,7 +306,6 @@ class Demo extends Command
{
$productIds = [];
$productKeyword = Keyword::where("project_id",$project_id)->where("route",$route)->first();
dd($productKeyword);
if (!empty($productKeyword)){
$productsQuery = Product::where("project_id", $project_id)->where("status",1)->where("keyword_id","like","%,".$productKeyword->id.",%")->limit(7)->get();
if (!empty($productsQuery)){
... ... @@ -323,7 +322,6 @@ class Demo extends Command
$products = Product::where("project_id", $project_id)->where("status",1)->inRandomOrder()->take(13)->get();
}
}
echo '产品数据:'.json_encode($products);
$data = [];
if (!empty($products)){
foreach ($products as $item){
... ...