sku完成,订单、商品上下架管理正在搞

This commit is contained in:
2025-05-21 17:04:10 +08:00
parent 035ab1105c
commit fc503cb95a
18 changed files with 239579 additions and 22 deletions

View File

@@ -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));
}
}