public function view_pda_sumbInv() { $InventoryAct = new InventoryAct(); $reasonId = isset($_POST['reasonId']) ? $_POST['reasonId'] : ""; $inv = $InventoryAct->act_sumbInv(); if (!$inv) { $status = $InventoryAct->{$errMsg}; header("location:index.php?mod=pda_inventory&act=pda_inventory&type=error&reasonId={$reasonId}&state=" . $status); exit; } header("location:index.php?mod=pda_inventory&act=pda_inventory&reasonId={$reasonId}&state=操作成功,请盘点下一料号"); exit; }
public function view_sumbInv() { /** 添加重复提交检测逻辑 edit by GARY**/ $randStr = $_POST['randStr']; if (isset($_SESSION['randStr']) && $randStr == $_SESSION['randStr']) { $InventoryAct = new InventoryAct(); $inv = $InventoryAct->act_sumbInv(); unset($_SESSION['randStr']); $state = $inv ? '操作成功,请盘点下一料号' : '操作失败,请确认sku和仓位是否正确'; } else { $state = '已提交盘点,请勿重复提交!'; } $url = 'location:index.php?mod=inventory&act=inventory&state=' . $state; header($url); exit; /** end**/ }