kphcdr hace 1 año
padre
commit
2665fa1583
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/Modules/Mini/Services/PageService.php

+ 2 - 2
app/Modules/Mini/Services/PageService.php

@@ -62,7 +62,7 @@ class PageService extends BaseService
 
     public function hotGoods($num = 10)
     {
-        $goods = Goods::orderByDesc("view_total")->limit($num)->get();
+        $goods = Goods::where("status", Goods::STATUS_OK)->orderByDesc("view_total")->limit($num)->get();
 
         return $goods->map(function (Goods $g) {
             return [
@@ -76,7 +76,7 @@ class PageService extends BaseService
 
     public function recommendedGoods($num = 10)
     {
-        $goods = Goods::orderBy(DB::raw("rand() "))->limit($num)->get();
+        $goods = Goods::where("status", Goods::STATUS_OK)->orderBy(DB::raw("rand() "))->limit($num)->get();
 
         return $goods->map(function (Goods $g) {
             return [