function act_sumbAppInv() { $data = array(); $userId = $_SESSION['userId']; $sku = post_check(trim($_POST['sku'])); $reasonId = trim($_POST['reasonId']); $sku_info = InvRecordModel::getSkuInfo($sku); $data = array('sku' => $sku, 'applicantId' => $userId, 'applicantionTime' => time(), 'invReasonId' => $reasonId, 'invStatus' => 0, 'systemNums' => $sku_info['actualStock']); $insertid = WaitInventoryModel::insertRow($data); if ($insertid) { return true; } else { return false; } }
public function act_markUnusual1() { $userId = $_SESSION['userId']; $orderids = isset($_POST['orderids']) ? $_POST['orderids'] : ''; if (empty($orderids)) { self::$errCode = 0; self::$errMsg = '请选择发货单号!'; return; } if (!is_numeric($orderids)) { $tracknumber = $orderids; $info = orderWeighingModel::selectOrderId($tracknumber); if (!$info) { self::$errCode = 501; self::$errMsg = "此跟踪号不存在!"; return false; } $orderids = $info[0]['shipOrderId']; } $order_arr = explode(',', $orderids); OmAvailableModel::begin(); $po_obj = new PackingOrderModel(); $qresult = $po_obj->changeStatusToUnusual($orderids); if ($qresult) { foreach ($order_arr as $order) { $order_info = orderWeighingModel::selectOrderDetail($order); foreach ($order_info as $o_info) { $data = array(); $sku_info = InvRecordModel::getSkuInfo($o_info['sku']); $data = array('sku' => $o_info['sku'], 'applicantId' => $userId, 'applicantionTime' => time(), 'invReasonId' => 4, 'invStatus' => 0, 'systemNums' => $sku_info['actualStock']); $insertid = WaitInventoryModel::insertRow($data); if (!$insertid) { self::$errCode = 0; self::$errMsg = '标记异常发货单失败!'; OmAvailableModel::rollback(); return false; } } } self::$errCode = 200; self::$errMsg = '标记异常发货单成功!'; OmAvailableModel::commit(); return true; } else { self::$errCode = 0; self::$errMsg = '标记异常发货单失败!'; return false; } }