|
@@ -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 [
|