multi-store/app/admin/controller/inventory_transfer/InventoryTransferController.php
mkm 148e6cf019 refactor(仓储逻辑): 为相关函数增加管理员ID参数
- 在多个控制器和逻辑类中,为相关函数增加了admin_id参数
- 更新了WarehouseProductLogic中的多个方法,使其支持记录管理员ID
- 修改了ChangeLogLogic和SqlChannelLog函数,增加了admin_id字段
2025-01-06 12:04:18 +08:00

96 lines
2.4 KiB
PHP

<?php
namespace app\admin\controller\inventory_transfer;
use app\admin\controller\BaseAdminController;
use app\admin\lists\inventory_transfer\InventoryTransferLists;
use app\admin\logic\inventory_transfer\InventoryTransferLogic;
use app\admin\validate\inventory_transfer\InventoryTransferValidate;
/**
* 商品调拨控制器
* Class InventoryTransferController
* @package app\admin\controller\inventory_transfer
*/
class InventoryTransferController extends BaseAdminController
{
/**
* @notes 获取商品调拨列表
* @return \think\response\Json
* @author admin
* @date 2024/08/13 16:18
*/
public function lists()
{
return $this->dataLists(new InventoryTransferLists());
}
/**
* @notes 添加商品调拨
* @return \think\response\Json
* @author admin
* @date 2024/08/13 16:18
*/
public function add()
{
$params = (new InventoryTransferValidate())->post()->goCheck('add');
$result = InventoryTransferLogic::add($params,$this->adminId);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(InventoryTransferLogic::getError());
}
/**
* @notes 编辑商品调拨
* @return \think\response\Json
* @author admin
* @date 2024/08/13 16:18
*/
public function edit()
{
$params = (new InventoryTransferValidate())->post()->goCheck('edit');
$result = InventoryTransferLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(InventoryTransferLogic::getError());
}
/**
* @notes 删除商品调拨
* @return \think\response\Json
* @author admin
* @date 2024/08/13 16:18
*/
public function delete()
{
return $this->fail('删除功能暂未开放');
$params = (new InventoryTransferValidate())->post()->goCheck('delete');
InventoryTransferLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取商品调拨详情
* @return \think\response\Json
* @author admin
* @date 2024/08/13 16:18
*/
public function detail()
{
$params = (new InventoryTransferValidate())->goCheck('detail');
$result = InventoryTransferLogic::detail($params);
return $this->data($result);
}
}