|
|
|
@ -11,24 +11,5 @@ use App\Models\Product; |
|
|
|
*/ |
|
|
|
class ProductController extends Controller |
|
|
|
{ |
|
|
|
// 产品列表
|
|
|
|
public function index() |
|
|
|
{ |
|
|
|
$list = Product::select(['title', 'price', 'original_price', 'pictures', 'sales'])->simplePaginate(); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
|
|
|
|
// 人气爆款
|
|
|
|
public function hot() |
|
|
|
{ |
|
|
|
$list = Product::get(['title', 'price', 'original_price', 'pictures', 'sales']); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
|
|
|
|
// 猜你喜欢
|
|
|
|
public function guessLike() |
|
|
|
{ |
|
|
|
$list = Product::get(['title', 'price', 'original_price', 'pictures', 'sales']); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
} |