lihaiMiddleOffice/app/psi/controller/OutboundProductController.php

98 lines
2.3 KiB
PHP

<?php
namespace app\psi\controller;
use app\admin\controller\BaseAdminController;
use app\admin\logic\warehouse_product\WarehouseProductLogic;
use app\psi\lists\OutboundProductLists;
use app\psi\logic\OutboundProductLogic;
use app\psi\validate\OutboundProductValidate;
/**
* PsiOutboundProduct控制器
* Class OutboundProductController
* @package app\psi\controller
*/
class OutboundProductController extends BaseAdminController
{
/**
* @notes 获取列表
* @author admin
* @date 2025/03/10 11:08
*/
public function lists()
{
return $this->dataLists(new OutboundProductLists());
}
/**
* @notes 添加
* @author admin
* @date 2025/03/10 11:08
*/
public function add()
{
$params = (new OutboundProductValidate())->post()->goCheck('add');
$params['admin_id'] = $this->adminId;
$result = OutboundProductLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(OutboundProductLogic::getError());
}
/**
* @notes 编辑
* @author admin
* @date 2025/03/10 11:08
*/
public function edit()
{
$params = (new OutboundProductValidate())->post()->goCheck('edit');
$result = OutboundProductLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(OutboundProductLogic::getError());
}
/**
* @notes 删除
* @author admin
* @date 2025/03/10 11:08
*/
public function delete()
{
$params = (new OutboundProductValidate())->post()->goCheck('delete');
OutboundProductLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @author admin
* @date 2025/03/10 11:08
*/
public function detail()
{
$params = (new OutboundProductValidate())->goCheck('detail');
$result = OutboundProductLogic::detail($params);
return $this->data($result);
}
public function set_nums()
{
$params=$this->request->post();
OutboundProductLogic::settNums($params);
return $this->success('');
}
}