Files
nl-mall-api/app/Service/CodeGeneration/ProductLabelRelationsService.php

88 lines
1.9 KiB
PHP
Raw Normal View History

2025-05-19 16:54:25 +08:00
<?php
namespace App\Service\CodeGeneration;
use App\BaseApp\BaseService;
use App\Models\ProductLabelRelationsModel;
2025-05-19 16:54:25 +08:00
use Exception;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class ProductLabelRelationsService extends BaseService
2025-05-19 16:54:25 +08:00
{
public function __construct()
{
parent::__construct();
$this->selectField = ["id", "product_id", "label_id", "status", "created_at", "updated_at", "deleted_at"];
$this->queryField = ['product_id' => '=','label_id' => '=,status='];
$this->model = ProductLabelRelationsModel::class;
2025-05-19 16:54:25 +08:00
}
/**
* 获取商品标签关联列表
2025-05-19 16:54:25 +08:00
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function list(): array
{
return $this->getPageList();
}
/**
* 获取商品标签关联详情
2025-05-19 16:54:25 +08:00
* @param $id
* @return mixed
* @throws Exception
*/
public function detail($id)
{
return $this->getDetail($id);
}
/**
* 商品标签关联下拉列表
2025-05-19 16:54:25 +08:00
* @return mixed
*/
public function option()
{
$this->optionField = ['id', 'name'];
return $this->getOption();
}
/**
* 创建商品标签关联
2025-05-19 16:54:25 +08:00
* @param $params
* @return mixed
* @throws Exception
*/
public function create($params): mixed
{
return $this->insert($params);
}
/**
* 编辑商品标签关联
2025-05-19 16:54:25 +08:00
* @param $id
* @param $params
* @return mixed
* @throws Exception
*/
public function update($id, $params): mixed
{
return $this->save($id, $params);
}
/**
* 删除商品标签关联
2025-05-19 16:54:25 +08:00
* @param $ids
* @return mixed|true
* @throws Exception
*/
public function delete($ids): mixed
{
return $this->del($ids);
}
}