95 lines
2.2 KiB
PHP
95 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\customer;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\customer\CustomerLists;
|
|
use app\admin\logic\customer\CustomerLogic;
|
|
use app\admin\validate\customer\CustomerValidate;
|
|
|
|
|
|
/**
|
|
* 客户管理控制器
|
|
* Class CustomerController
|
|
* @package app\admin\controller\customer
|
|
*/
|
|
class CustomerController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取客户管理列表
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/23 14:44
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new CustomerLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加客户管理
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/23 14:44
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new CustomerValidate())->post()->goCheck('add');
|
|
$result = CustomerLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CustomerLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑客户管理
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/23 14:44
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new CustomerValidate())->post()->goCheck('edit');
|
|
$result = CustomerLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CustomerLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除客户管理
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/23 14:44
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new CustomerValidate())->post()->goCheck('delete');
|
|
CustomerLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取客户管理详情
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/23 14:44
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new CustomerValidate())->goCheck('detail');
|
|
$result = CustomerLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |