95 lines
2.2 KiB
PHP
95 lines
2.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace app\psi\controller;
|
||
|
|
||
|
|
||
|
use app\admin\controller\BaseAdminController;
|
||
|
use app\psi\lists\WarehouseProductLists;
|
||
|
use app\psi\logic\WarehouseProductLogic;
|
||
|
use app\psi\validate\WarehouseProductValidate;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* PsiWarehouseProduct控制器
|
||
|
* Class WarehouseProductController
|
||
|
* @package app\psi\controller
|
||
|
*/
|
||
|
class WarehouseProductController extends BaseAdminController
|
||
|
{
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取列表
|
||
|
* @return \think\response\Json
|
||
|
* @author admin
|
||
|
* @date 2025/03/10 11:08
|
||
|
*/
|
||
|
public function lists()
|
||
|
{
|
||
|
return $this->dataLists(new WarehouseProductLists());
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 添加
|
||
|
* @return \think\response\Json
|
||
|
* @author admin
|
||
|
* @date 2025/03/10 11:08
|
||
|
*/
|
||
|
public function add()
|
||
|
{
|
||
|
$params = (new WarehouseProductValidate())->post()->goCheck('add');
|
||
|
$result = WarehouseProductLogic::add($params);
|
||
|
if (true === $result) {
|
||
|
return $this->success('添加成功', [], 1, 1);
|
||
|
}
|
||
|
return $this->fail(WarehouseProductLogic::getError());
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 编辑
|
||
|
* @return \think\response\Json
|
||
|
* @author admin
|
||
|
* @date 2025/03/10 11:08
|
||
|
*/
|
||
|
public function edit()
|
||
|
{
|
||
|
$params = (new WarehouseProductValidate())->post()->goCheck('edit');
|
||
|
$result = WarehouseProductLogic::edit($params);
|
||
|
if (true === $result) {
|
||
|
return $this->success('编辑成功', [], 1, 1);
|
||
|
}
|
||
|
return $this->fail(WarehouseProductLogic::getError());
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 删除
|
||
|
* @return \think\response\Json
|
||
|
* @author admin
|
||
|
* @date 2025/03/10 11:08
|
||
|
*/
|
||
|
public function delete()
|
||
|
{
|
||
|
$params = (new WarehouseProductValidate())->post()->goCheck('delete');
|
||
|
WarehouseProductLogic::delete($params);
|
||
|
return $this->success('删除成功', [], 1, 1);
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取详情
|
||
|
* @return \think\response\Json
|
||
|
* @author admin
|
||
|
* @date 2025/03/10 11:08
|
||
|
*/
|
||
|
public function detail()
|
||
|
{
|
||
|
$params = (new WarehouseProductValidate())->goCheck('detail');
|
||
|
$result = WarehouseProductLogic::detail($params);
|
||
|
return $this->data($result);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|