erp/app/admin/controller/goods/GoodsLabelController.php
2024-04-27 11:41:34 +08:00

95 lines
2.2 KiB
PHP

<?php
namespace app\admin\controller\goods;
use app\admin\controller\BaseAdminController;
use app\admin\lists\goods\GoodsLabelLists;
use app\admin\logic\goods\GoodsLabelLogic;
use app\admin\validate\goods\GoodsLabelValidate;
/**
* 商品标签控制器
* Class GoodsLabelController
* @package app\admin\controller\goods
*/
class GoodsLabelController extends BaseAdminController
{
/**
* @notes 获取商品标签列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/27 09:23
*/
public function lists()
{
return $this->dataLists(new GoodsLabelLists());
}
/**
* @notes 添加商品标签
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/27 09:23
*/
public function add()
{
$params = (new GoodsLabelValidate())->post()->goCheck('add');
$result = GoodsLabelLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(GoodsLabelLogic::getError());
}
/**
* @notes 编辑商品标签
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/27 09:23
*/
public function edit()
{
$params = (new GoodsLabelValidate())->post()->goCheck('edit');
$result = GoodsLabelLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(GoodsLabelLogic::getError());
}
/**
* @notes 删除商品标签
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/27 09:23
*/
public function delete()
{
$params = (new GoodsLabelValidate())->post()->goCheck('delete');
GoodsLabelLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取商品标签详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/27 09:23
*/
public function detail()
{
$params = (new GoodsLabelValidate())->goCheck('detail');
$result = GoodsLabelLogic::detail($params);
return $this->data($result);
}
}