sku完成,订单、商品上下架管理正在搞
This commit is contained in:
@@ -4,6 +4,9 @@ namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\SkuService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class SkuController extends BaseController
|
||||
{
|
||||
@@ -15,4 +18,20 @@ class SkuController extends BaseController
|
||||
$this->updateField = ["id","product_id","cover", "name","inventory","price"];
|
||||
$this->service = SkuService::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sku列表根据商品id
|
||||
* @Method GET
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getSkuByProductId()
|
||||
{
|
||||
$id = request()->get('id');
|
||||
if (!$id) {
|
||||
return jerr('参数错误');
|
||||
}
|
||||
return jok($this->service->getSkuByProductId($id));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user