multi-store/app/store/controller/change_price_log/ChangePriceLogController.php

95 lines
2.3 KiB
PHP
Raw Normal View History

<?php
namespace app\store\controller\change_price_log;
use app\store\lists\change_price_log\ChangePriceLogLists;
use app\store\logic\change_price_log\ChangePriceLogLogic;
use app\store\validate\change_price_log\ChangePriceLogValidate;
use app\store\controller\BaseAdminController;
/**
* 价格变更记录控制器
* Class ChangePriceLogController
* @package app\store\controller\change_price_log
*/
class ChangePriceLogController extends BaseAdminController
{
/**
* @notes 获取价格变更记录列表
* @return \think\response\Json
* @author admin
* @date 2025/01/10 15:54
*/
public function lists()
{
return $this->dataLists(new ChangePriceLogLists());
}
/**
* @notes 添加价格变更记录
* @return \think\response\Json
* @author admin
* @date 2025/01/10 15:54
*/
public function add()
{
$params = (new ChangePriceLogValidate())->post()->goCheck('add');
$result = ChangePriceLogLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ChangePriceLogLogic::getError());
}
/**
* @notes 编辑价格变更记录
* @return \think\response\Json
* @author admin
* @date 2025/01/10 15:54
*/
public function edit()
{
$params = (new ChangePriceLogValidate())->post()->goCheck('edit');
$result = ChangePriceLogLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ChangePriceLogLogic::getError());
}
/**
* @notes 删除价格变更记录
* @return \think\response\Json
* @author admin
* @date 2025/01/10 15:54
*/
public function delete()
{
$params = (new ChangePriceLogValidate())->post()->goCheck('delete');
ChangePriceLogLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取价格变更记录详情
* @return \think\response\Json
* @author admin
* @date 2025/01/10 15:54
*/
public function detail()
{
$params = (new ChangePriceLogValidate())->goCheck('detail');
$result = ChangePriceLogLogic::detail($params);
return $this->data($result);
}
}