2025-02-28 16:05:10 +08:00
|
|
|
<?php
|
|
|
|
|
2025-03-04 16:18:22 +08:00
|
|
|
namespace app\psi\controller\supplier;
|
2025-02-28 16:05:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
2025-03-04 16:18:22 +08:00
|
|
|
use app\psi\lists\supplier\SupplierLists;
|
|
|
|
use app\psi\logic\supplier\SupplierLogic;
|
2025-02-28 16:05:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 供应链控制器
|
|
|
|
* Class SupplierController
|
|
|
|
* @package app\admin\controller\supplier
|
|
|
|
*/
|
|
|
|
class SupplierController extends BaseAdminController
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 获取供应链列表
|
|
|
|
* @return \think\response\Json
|
|
|
|
* @author admin
|
|
|
|
* @date 2024/08/15 14:10
|
|
|
|
*/
|
|
|
|
public function lists()
|
|
|
|
{
|
|
|
|
return $this->dataLists(new SupplierLists());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 添加供应链
|
|
|
|
* @return \think\response\Json
|
|
|
|
* @author admin
|
|
|
|
* @date 2024/08/15 14:10
|
|
|
|
*/
|
|
|
|
public function add()
|
|
|
|
{
|
2025-03-04 16:18:22 +08:00
|
|
|
$params = $this->request->post();
|
2025-02-28 16:05:10 +08:00
|
|
|
$result = SupplierLogic::add($params);
|
|
|
|
if (true === $result) {
|
|
|
|
return $this->success('添加成功', [], 1, 1);
|
|
|
|
}
|
|
|
|
return $this->fail(SupplierLogic::getError());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 编辑供应链
|
|
|
|
* @return \think\response\Json
|
|
|
|
* @author admin
|
|
|
|
* @date 2024/08/15 14:10
|
|
|
|
*/
|
|
|
|
public function edit()
|
|
|
|
{
|
2025-03-04 16:18:22 +08:00
|
|
|
$params = $this->request->post();
|
2025-02-28 16:05:10 +08:00
|
|
|
$result = SupplierLogic::edit($params);
|
|
|
|
if (true === $result) {
|
|
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
|
|
}
|
|
|
|
return $this->fail(SupplierLogic::getError());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 删除供应链
|
|
|
|
* @return \think\response\Json
|
|
|
|
* @author admin
|
|
|
|
* @date 2024/08/15 14:10
|
|
|
|
*/
|
|
|
|
public function delete()
|
|
|
|
{
|
2025-03-04 16:18:22 +08:00
|
|
|
$params = $this->request->post();
|
2025-02-28 16:05:10 +08:00
|
|
|
SupplierLogic::delete($params);
|
|
|
|
return $this->success('删除成功', [], 1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 获取供应链详情
|
|
|
|
* @return \think\response\Json
|
|
|
|
* @author admin
|
|
|
|
* @date 2024/08/15 14:10
|
|
|
|
*/
|
|
|
|
public function detail()
|
|
|
|
{
|
2025-03-04 16:18:22 +08:00
|
|
|
$params = $this->request->post();
|
2025-02-28 16:05:10 +08:00
|
|
|
$result = SupplierLogic::detail($params);
|
|
|
|
return $this->data($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|