Update
parent
008c7ec903
commit
4ee2c6d2a1
|
|
@ -7,7 +7,7 @@ use App\Endpoint\Api\Http\Resources\ProductCategoryResource;
|
|||
use App\Models\ProductCategory;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CategoryController extends Controller
|
||||
class ProductCategoryController extends Controller
|
||||
{
|
||||
/**
|
||||
* 商品分类
|
||||
|
|
@ -34,9 +34,10 @@ class ProductController extends Controller
|
|||
* 商品详情
|
||||
*
|
||||
* @param int $id
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function show($id)
|
||||
public function show($id, Request $request)
|
||||
{
|
||||
$sku = ProductSku::findOrFail($id);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use App\Endpoint\Api\Http\Controllers\AdController;
|
|||
use App\Endpoint\Api\Http\Controllers\CaptchaController;
|
||||
use App\Endpoint\Api\Http\Controllers\LoginController;
|
||||
use App\Endpoint\Api\Http\Controllers\LogoutController;
|
||||
use App\Endpoint\Api\Http\Controllers\Product\CategoryController;
|
||||
use App\Endpoint\Api\Http\Controllers\Product\HotController;
|
||||
use App\Endpoint\Api\Http\Controllers\Product\ProductCategoryController;
|
||||
use App\Endpoint\Api\Http\Controllers\Product\ProductController;
|
||||
use App\Endpoint\Api\Http\Controllers\RegisterController;
|
||||
use App\Endpoint\Api\Http\Controllers\SmsCodeController;
|
||||
|
|
@ -29,10 +29,13 @@ Route::group([
|
|||
Route::get('ads', [AdController::class, 'index']);
|
||||
|
||||
Route::prefix('product')->group(function () {
|
||||
Route::get('categories', [CategoryController::class, 'index']);
|
||||
|
||||
// 商品分类
|
||||
Route::get('categories', [ProductCategoryController::class, 'index']);
|
||||
// 热销商品
|
||||
Route::get('hot', HotController::class);
|
||||
// 筛选商品
|
||||
Route::get('products', [ProductController::class, 'index']);
|
||||
// 查看商品
|
||||
Route::get('products/{product}', [ProductController::class, 'show']);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue