public function act_applyforB() { $pid = isset($_GET['pid']) ? trim($_GET['pid']) : 0; if ($pid == '') { self::$errCode = 0; self::$errMsg = '输入非法值!'; return; } $idar = explode(',', $pid); foreach ($idar as $key => $idval) { $idar[$key] = intval($idval); } $o_count = count($idar); $orderist = OrderPrintListModel::getPrintList('*', ' where id in (' . implode(',', $idar) . ') and status!=1001 and storeId=2'); $n_count = count($orderist); if ($o_count != $n_count) { self::$errCode = 0; self::$errMsg = '申请提货不能包含未打印地址条订单或包含A仓订单'; return; } $oidar = array(); //发货单id数组 foreach ($orderist as $orlval) { //验证合法性 if ($orlval['is_delete'] == 1) { $data = array('data' => array('包含已经删除单号!', '单号id为' . $orlval['id']), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $tempar = explode(',', $orlval['orderIds']); $oidar = array_merge($oidar, $tempar); } $po_obj = new PackingOrderModel(); $qresult = $po_obj->changeStatusToWaitGetGoodsB(implode(',', $oidar)); OrderPrintListModel::deleteAsetOfPrint(implode(',', $idar)); printLabelModel::inserRecords($oidar, $_SESSION['userId']); if ($qresult) { $time = time(); self::$errCode = 1; self::$errMsg = '申请成功'; return; } else { self::$errCode = 0; self::$errMsg = '失败'; return FALSE; } }