正在显示
1 个修改的文件
包含
1 行增加
和
3 行删除
| @@ -295,7 +295,7 @@ class Demo extends Command | @@ -295,7 +295,7 @@ class Demo extends Command | ||
| 295 | 'keyword_content'=>$keywordInfo['keyword_content'], | 295 | 'keyword_content'=>$keywordInfo['keyword_content'], |
| 296 | 'product_list'=>$thumb ?? [] | 296 | 'product_list'=>$thumb ?? [] |
| 297 | ]; | 297 | ]; |
| 298 | - echo '返回数据'.json_encode($data); | 298 | + echo '返回数据'.$data; |
| 299 | return $data; | 299 | return $data; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| @@ -306,7 +306,6 @@ class Demo extends Command | @@ -306,7 +306,6 @@ class Demo extends Command | ||
| 306 | { | 306 | { |
| 307 | $productIds = []; | 307 | $productIds = []; |
| 308 | $productKeyword = Keyword::where("project_id",$project_id)->where("route",$route)->first(); | 308 | $productKeyword = Keyword::where("project_id",$project_id)->where("route",$route)->first(); |
| 309 | - dd($productKeyword); | ||
| 310 | if (!empty($productKeyword)){ | 309 | if (!empty($productKeyword)){ |
| 311 | $productsQuery = Product::where("project_id", $project_id)->where("status",1)->where("keyword_id","like","%,".$productKeyword->id.",%")->limit(7)->get(); | 310 | $productsQuery = Product::where("project_id", $project_id)->where("status",1)->where("keyword_id","like","%,".$productKeyword->id.",%")->limit(7)->get(); |
| 312 | if (!empty($productsQuery)){ | 311 | if (!empty($productsQuery)){ |
| @@ -323,7 +322,6 @@ class Demo extends Command | @@ -323,7 +322,6 @@ class Demo extends Command | ||
| 323 | $products = Product::where("project_id", $project_id)->where("status",1)->inRandomOrder()->take(13)->get(); | 322 | $products = Product::where("project_id", $project_id)->where("status",1)->inRandomOrder()->take(13)->get(); |
| 324 | } | 323 | } |
| 325 | } | 324 | } |
| 326 | - echo '产品数据:'.json_encode($products); | ||
| 327 | $data = []; | 325 | $data = []; |
| 328 | if (!empty($products)){ | 326 | if (!empty($products)){ |
| 329 | foreach ($products as $item){ | 327 | foreach ($products as $item){ |
-
请 注册 或 登录 后发表评论