海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
826 B

<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Product;
/**
* 产品列表
* Class ProductController
* @package App\Http\Controllers\Api
*/
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);
}
}