當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OmAvailableModel::addTNameRow方法代碼示例

本文整理匯總了PHP中OmAvailableModel::addTNameRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP OmAvailableModel::addTNameRow方法的具體用法?PHP OmAvailableModel::addTNameRow怎麽用?PHP OmAvailableModel::addTNameRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OmAvailableModel的用法示例。


在下文中一共展示了OmAvailableModel::addTNameRow方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: act_addTNameRow

 /**
  *添加指定表記錄,返回 insertId
  */
 function act_addTNameRow($tName, $set)
 {
     $ret = OmAvailableModel::addTNameRow($tName, $set);
     if ($ret !== FALSE) {
         return $ret;
     } else {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:14,代碼來源:omAvailable.action.php

示例2: act_insertBlackList

 function act_insertBlackList($data, $table)
 {
     //表名,SET,WHERE
     $key = array();
     $value = array();
     foreach ($data as $k => $v) {
         $key[] = $k;
         $value[] = $v;
     }
     $set = " (" . implode(',', $key) . ") VALUE ('" . implode("','", $value) . "')";
     $ret = OmAvailableModel::addTNameRow($table, $set);
     if ($ret) {
         return true;
     } else {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:19,代碼來源:omBlackList.action.php

示例3: act_addTNameRow

 function act_addTNameRow()
 {
     $jsonArr = isset($_GET['jsonArr']) ? $_GET['jsonArr'] : '';
     //傳過來的base64編碼的json字符串
     if (empty($jsonArr)) {
         self::$errCode = 101;
         self::$errMsg = '參數數組為空';
         return false;
     }
     $jsonArr = json_decode(base64_decode($jsonArr), true);
     //對base64及json解碼
     if (!is_array($jsonArr)) {
         self::$errCode = 103;
         self::$errMsg = '參數數組不是數組格式';
         return false;
     }
     $tName = $jsonArr['tName'];
     //表名
     $set = $jsonArr['set'];
     //set,用關鍵字SET
     if (empty($tName) || empty($set)) {
         self::$errCode = '300';
         self::$errMsg = '必要參數不完整';
         return false;
     }
     $insertId = OmAvailableModel::addTNameRow($tName, $set);
     if ($insertId !== FALSE) {
         self::$errCode = '200';
         self::$errMsg = '成功';
         return $insertId;
     } else {
         self::$errCode = '404';
         self::$errMsg = '數據庫操作錯誤';
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:36,代碼來源:omAvailableApi.action.php

示例4: act_updateCostAndAddHistory

 function act_updateCostAndAddHistory()
 {
     $sku = $_GET['sku'] ? post_check(trim($_GET['sku'])) : '';
     //sku
     $purchaseCost = $_GET['purchaseCost'] ? post_check(trim($_GET['purchaseCost'])) : 0;
     //成本
     $addUserId = $_GET['addUserId'] ? post_check(trim($_GET['addUserId'])) : 0;
     //添加人
     $addTime = time();
     if (empty($sku)) {
         self::$errCode = '101';
         self::$errMsg = 'sku為空';
         return false;
     }
     if (!is_numeric($purchaseCost) || $purchaseCost <= 0) {
         self::$errCode = '102';
         self::$errMsg = '成本必須大於0';
         return false;
     }
     if (intval($addUserId) <= 0) {
         self::$errCode = '103';
         self::$errMsg = '添加人id不合法';
         return false;
     }
     $tName = 'pc_goods';
     $select = '*';
     $where = "WHERE sku='{$sku}' and is_delete=0";
     $skuList = OmAvailableModel::getTNameList($tName, $select, $where);
     if (empty($skuList)) {
         self::$errCode = '104';
         self::$errMsg = "找不到 {$sku} 料號";
         return false;
     }
     try {
         BaseModel::begin();
         //先更新goods表中對應sku的goodsCost
         $set = "SET goodsCost='{$purchaseCost}'";
         OmAvailableModel::updateTNameRow($tName, $set, $where);
         //然後再曆史記錄表中添加一條記錄
         $tName = 'pc_goods_cost_history_record';
         $set = "SET sku='{$sku}',purchaseCost='{$purchaseCost}',addUserId='{$addUserId}',addTime='{$addTime}'";
         OmAvailableModel::addTNameRow($tName, $set);
         //更新mem中的sku
         $key = 'pc_goods_' . $sku;
         $value = $skuList[0];
         $value['goodsCost'] = $purchaseCost;
         setMemNewByKey($key, $value);
         //這裏不保證能添加成功
         BaseModel::commit();
         BaseModel::autoCommit();
         self::$errCode = '200';
         self::$errMsg = "更新成功";
         return true;
     } catch (Exception $e) {
         BaseModel::rollback();
         BaseModel::autoCommit();
         self::$errCode = '404';
         self::$errMsg = $e->getMessage();
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:61,代碼來源:omAvailableApi.action.php

示例5: foreach

                     Log::write("INSERT INTO " . $tracknumber_tname . $tracknumber_set, Log::ERR);
                     OmAvailableModel::rollback();
                     continue;
                 }
             }
             $detail_blag = false;
             foreach ($order_detail as $detail) {
                 $insert_detail_arr = array();
                 $insert_detail_arr[] = "shipOrderId = '{$shipOrderId}'";
                 $insert_detail_arr[] = "sku = '{$detail['sku']}'";
                 $insert_detail_arr[] = "amount = '{$detail['amount']}'";
                 $insert_detail_arr[] = "positionId = '{$detail['positionId']}'";
                 $insert_detail_arr[] = "pName = '{$detail['pName']}'";
                 $detail_tname = "wh_shipping_orderdetail";
                 $detail_set = "set " . implode(",", $insert_tracknumber_arr);
                 $detailId = OmAvailableModel::addTNameRow($detail_tname, $detail_set);
                 if (!$detailId) {
                     Log::write("INSERT INTO " . $detail_tname . $detail_set, Log::ERR);
                     OmAvailableModel::rollback();
                     $detail_blag = true;
                     break;
                 }
             }
             if ($detail_blag) {
                 continue;
             }
             OmAvailableModel::commit();
             $channel->basic_ack($msg->delivery_info['delivery_tag']);
         }
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:wh_shipping_order_subscribe.php

示例6: act_checkOrder

 function act_checkOrder()
 {
     $userId = $_SESSION['userId'];
     $order_id = trim($_POST['ebay_id']);
     $state_status = array(PKS_WIQC);
     //先核對訂單
     $p_real_ebayid = '#^\\d+$#';
     if (!preg_match($p_real_ebayid, $order_id)) {
         self::$errCode = "001";
         self::$errMsg = "發貨單號[" . $order_id . "]格式有誤";
         return false;
     }
     $ordercheck = ShippingOrderModel::getShippingOrder("*", "where id='{$order_id}'");
     if (empty($ordercheck)) {
         self::$errCode = '001';
         self::$errMsg = '未找到發貨單[' . $order_id . ']';
         return false;
     }
     if ($ordercheck[0]['isExpressDelivery'] == 1) {
         self::$errCode = '001';
         self::$errMsg = '此發貨單是快遞運輸方式,請轉到快遞複核界麵操作!';
         return false;
     }
     $orderinfos = array();
     $skuinfos = array();
     $orderinfos = get_realskunum($ordercheck[0]['id']);
     //配貨單所有料號及數量
     foreach ($orderinfos as $or_sku => $or_nums) {
         $sku_info = OrderReviewModel::getSkuInfo("goodsName", "where sku='{$or_sku}'");
         $skuinfos[] = array('sku' => $or_sku, 'goodsName' => $sku_info['goodsName'], 'num' => $or_nums);
     }
     $string = "";
     $time = strtotime(date('Y-m-d H:i:s'));
     foreach ($skuinfos as $info) {
         $string .= "('" . $ordercheck[0]['id'] . "','" . $info['sku'] . "','" . $info['goodsName'] . "','0','" . $info['num'] . "','" . $userId . "','" . $time . "','0'),";
     }
     $string = trim($string, ",");
     OrderReviewModel::update(array('is_delete' => 1), "and shipOrderId='{$ordercheck[0]['id']}'");
     $insert_info = OrderReviewModel::insert($string);
     if ($insert_info) {
         if (!in_array($ordercheck[0]['orderStatus'], $state_status)) {
             if ($ordercheck[0]['orderStatus'] == PKS_PROCESS_GET_GOODS) {
                 $where = "where shipOrderId='{$ordercheck[0]['id']}' and is_delete=0";
                 $list = OmAvailableModel::getTNameList("wh_order_picking_records", "*", $where);
                 $eosr_arrlist = array();
                 foreach ($list as $row) {
                     $eosr_arrlist[] = $row['shipOrderdetailId'];
                 }
                 //$skuinfos = get_realskunum($orderid);
                 $skuinfos = OmAvailableModel::getTNameList("wh_shipping_orderdetail", "*", "where shipOrderId='{$ordercheck[0]['id']}' and is_delete = 0");
                 foreach ($skuinfos as $info) {
                     $order_detail = array();
                     if (!in_array($info['id'], $eosr_arrlist)) {
                         $order_detail['shipOrderId'] = $info['shipOrderId'];
                         $order_detail['shipOrderdetailId'] = $info['id'];
                         $order_detail['sku'] = $info['sku'];
                         $order_detail['pName'] = $info['pName'];
                         $order_detail['totalNums'] = $info['amount'];
                         $order_detail['isScan'] = 0;
                         $order_detail['is_delete'] = 0;
                         $field = ' SET ' . array2sql($order_detail);
                         OmAvailableModel::addTNameRow("wh_order_picking_records", $field);
                     }
                 }
                 $where = "where shipOrderId='{$ordercheck[0]['id']}' and is_delete=0 and isScan=0";
                 $p_list = OmAvailableModel::getTNameList("wh_order_picking_records", "*", $where);
                 $str = '';
                 if (!empty($p_list)) {
                     foreach ($p_list as $eo) {
                         $op_amount = empty($eo['amount']) ? 0 : $eo['amount'];
                         $str .= "料號 {$eo['sku']} 未配貨,";
                         $str .= " 已配貨 {$op_amount} 還需配貨 " . ($eo['totalNums'] - $op_amount);
                         $str .= " PDA掃描時間:" . ($eo['scanTime'] ? date('Y-m-d H:i:s', $eo['scanTime']) : ' 無 ');
                         $str .= "<br>";
                     }
                 }
                 self::$errCode = '004';
                 self::$errMsg = "該訂單[{$order_id}]在等待配貨狀態,請確認!<br/>" . $str;
                 return false;
             }
             self::$errCode = '001';
             self::$errMsg = "該訂單[{$order_id}]在" . LibraryStatusModel::getStatusNameByStatusCode($ordercheck[0]['orderStatus']) . "狀態,請確認!";
             return false;
         }
         $fist_skuinfos = OrderReviewModel::getReviewList("*", "where shipOrderId='{$ordercheck[0]['id']}' and is_delete=0 and storeId=1");
         $note_info = OmAvailableModel::getTNameList("wh_shipping_order_note_record", "*", "where shipOrderId='{$ordercheck[0]['id']}'");
         if (!empty($note_info)) {
             self::$errMsg = "訂單有效,請複核該訂單下的料號及數量!<br/>備注:" . $note_info[0]['content'];
         } else {
             self::$errMsg = "訂單有效,請複核該訂單下的料號及數量!";
         }
         return $fist_skuinfos;
     } else {
         self::$errCode = '003';
         self::$errMsg = "訂單料號初始化出錯,請重試";
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:98,代碼來源:orderReview.action.php

示例7: view_tmpModReturnPros

 public function view_tmpModReturnPros()
 {
     //添加sku
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $sku = isset($_GET['sku']) ? post_check(trim($_GET['sku'])) : '';
     $addUserId = intval($_SESSION['userId']);
     if ($addUserId <= 0) {
         $status = '登陸超時,請重試';
         header('Location:index.php?mod=products&act=tmpModReturnPros&status=' . $status);
         exit;
     }
     $now = time();
     if ($type == 'add') {
         if (!empty($sku)) {
             $skuList = getSkuBygoodsCode($sku);
             $sku = $skuList[0]['sku'];
             if (empty($sku)) {
                 $status = "{$_GET['sku']} 找不到對應料號";
                 header('Location:index.php?mod=products&act=tmpModReturnPros&status=' . $status);
                 exit;
             }
             $tName = 'pc_products_iostore_detail';
             $where = "WHERE is_delete=0 AND sku='{$sku}' AND iostoreTypeId=1 AND useTypeId=2 AND isAudit<3";
             //找出領料單中修改領取的該產品記錄數
             $countDetailLL = OmAvailableModel::getTNameCount($tName, $where);
             if (empty($countDetailLL)) {
                 $status = "找不到 {$_GET['sku']} 的 修改領料 記錄";
                 header('Location:index.php?mod=products&act=tmpModReturnPros&status=' . $status);
                 exit;
             }
             $tName = 'pc_products_iostore_detail';
             $where = "WHERE is_delete=0 AND sku='{$sku}' AND iostoreTypeId=2 AND useTypeId=2 AND isAudit<3";
             //找出退料單中修改歸還的該產品記錄數
             $countDetailTL = OmAvailableModel::getTNameCount($tName, $where);
             $allowAddCount = $countDetailLL - $countDetailTL;
             //該料號允許添加的數量
             $tName = 'pc_tmp_products_return';
             $where = "WHERE returnType=3 AND sku='{$sku}'";
             $countSku = OmAvailableModel::getTNameCount($tName, $where);
             $countSku++;
             //當前該sku的數量
             if ($allowAddCount < $countSku) {
                 //如果允許添加的該sku數量小於該sku已經添加的數量,則報錯
                 $status = "{$_GET['sku']} 已經全部歸還,不能再添加";
                 header('Location:index.php?mod=products&act=tmpModReturnPros&status=' . $status);
                 exit;
             }
             $set = "SET returnType=3,sku='{$sku}',addUserId='{$addUserId}',createdTime='{$now}'";
             //type=3 ,修改歸還
             OmAvailableModel::addTNameRow($tName, $set);
             $status = $sku . ' 添加成功';
             header('Location:index.php?mod=products&act=tmpModReturnPros&status=' . $status);
         }
     }
     //展示tmp表中的記錄
     $tName = 'pc_tmp_products_return';
     $select = "*";
     $where = "WHERE returnType=3 order by createdTime desc";
     //修改領料
     $tmpModReturnProsList = OmAvailableModel::getTNameList($tName, $select, $where);
     $navlist = array(array('url' => 'index.php?mod=products&act=getProductsComfirmList', 'title' => '產品製作'), array('url' => 'index.php?mod=products&act=tmpModReturnPros', 'title' => '修改產品歸還'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 5);
     $this->smarty->assign('twovar', 510);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', '修改產品歸還');
     if (!empty($tmpModReturnProsList)) {
         $whInfoList = getWhInfo();
         //根據接口取得對應倉庫信息
         $whArr = array();
         foreach ($whInfoList as $value) {
             if (intval($value['id']) > 0) {
                 $whArr[$value['id']] = $value['whName'];
             }
         }
         $countProsList = count($tmpModReturnProsList);
         for ($i = 0; $i < $countProsList; $i++) {
             $sku = $tmpModReturnProsList[$i]['sku'];
             $tName = 'pc_goods';
             $select = 'goodsName';
             $where = "WHERE sku='{$sku}'";
             $skuInfoList = OmAvailableModel::getTNameList($tName, $select, $where);
             $tmpModReturnProsList[$i]['goodsName'] = $skuInfoList[0]['goodsName'];
             $tName = 'pc_goods_whId_location_raletion';
             $select = 'location,whId';
             $where = "WHERE sku='{$sku}'";
             $skuLocWhInfoList = OmAvailableModel::getTNameList($tName, $select, $where);
             $tmpModReturnProsList[$i]['location'] = $skuLocWhInfoList[0]['location'];
             $tmpModReturnProsList[$i]['whName'] = $whArr[$skuLocWhInfoList[0]['whId']];
         }
     }
     $this->smarty->assign('tmpModReturnProsList', empty($tmpModReturnProsList) ? array() : $tmpModReturnProsList);
     $this->smarty->display("tmpModReturnPros.htm");
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:94,代碼來源:products.view.php

示例8: intval

 //添加自動生成SPU記錄
 $tName = 'pc_auto_create_spu';
 $where = "WHERE spu='{$spu}'";
 $countAutoCreSpu = OmAvailableModel::getTNameCount($tName, $where);
 if ($countAutoCreSpu) {
     echo "{$spu} autoCreateSpu has exist!\n";
     //continue;
 }
 if (preg_match("/^[A-Z]{2}[0-9]{6}\$/", $spu)) {
     $sort = intval(substr($spu, 2));
 } else {
     $sort = 0;
 }
 $set = "SET spu='{$spu}',purchaseId='{$purchaseId}',createdTime='{$now}',sort='{$sort}',status=2";
 if (!$countAutoCreSpu) {
     OmAvailableModel::addTNameRow($tName, $set);
     echo "{$spu} autoCreateSpu insert success\n";
 }
 //添加SPU檔案
 $tName = 'pc_spu_archive';
 $where = "WHERE spu='{$spu}'";
 $countSpuArchive = OmAvailableModel::getTNameCount($tName, $where);
 if ($countSpuArchive) {
     echo "{$spu} spuArchive has exist!\n";
     $set = "SET categoryPath='{$value['goods_category']}',purchaseId='{$pcGoodsArr['purchaseId']}'";
     OmAvailableModel::updateTNameRow($tName, $set, $where);
     echo "{$spu} spuArchive update category and purchaseId success! {$value['goods_category']}  {$pcGoodsArr['purchaseId']} \n";
     //continue;
 }
 $dataSpuArchive = array();
 $dataSpuArchive['spu'] = $spu;
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:crontab_ebay_goods_2_pc_goods2.php

示例9: act_addInput

 function act_addInput()
 {
     //$pidNew = $_POST['pidNew']?post_check($_POST['pidNew']):'';//類別
     $finalIdArr = $_POST['finalIdStr'];
     //新建屬性-類別4
     $inputName = $_POST['inputName'] ? post_check($_POST['inputName']) : '';
     //類別
     $textStatus = $_POST['textStatus'] ? post_check($_POST['textStatus']) : '';
     //文本方式
     if (empty($finalIdArr) || empty($inputName)) {
         self::$errCode = 101;
         self::$errMsg = '類別或屬性名不能為空';
         return false;
     }
     if (intval($textStatus) <= 0) {
         self::$errCode = 102;
         self::$errMsg = '文本方式有誤';
         return false;
     }
     $tmpArr = array();
     if (!is_array($finalIdArr)) {
         $tmpArr[] = $finalIdArr;
         $finalIdArr = $tmpArr;
     }
     $finalPathArr = array();
     foreach ($finalIdArr as $cid) {
         $catePath = CategoryModel::getCategoryPathById($cid);
         if (empty($catePath)) {
             self::$errCode = 109;
             self::$errMsg = '類別有誤';
             return false;
         }
         $finalPathArr[] = $catePath;
     }
     $tName = 'pc_goods_category';
     foreach ($finalPathArr as $value) {
         $where = "WHERE path like'%{$value}-%' and is_delete=0";
         $count = OmAvailableModel::getTNameCount($tName, $where);
         if ($count) {
             self::$errCode = 105;
             self::$errMsg = '隻能在最小分類進行複製';
             return false;
         }
     }
     try {
         $pidNewStr = '';
         BaseModel::begin();
         $tName = 'pc_archive_input';
         foreach ($finalPathArr as $value) {
             $where = "WHERE inputName='{$inputName}' AND categoryPath='{$value}'";
             $countIN = OmAvailableModel::getTNameCount($tName, $where);
             if (!$countIN) {
                 $pidNewStr .= CategoryModel::getCategoryNameByPath($value) . ' ';
                 $set = "SET inputName='{$inputName}',categoryPath='{$value}',textStatus='{$textStatus}'";
                 OmAvailableModel::addTNameRow($tName, $set);
             }
         }
         BaseModel::commit();
         BaseModel::autoCommit();
         self::$errCode = 200;
         self::$errMsg = "{$inputName} 添加到 {$pidNewStr} 成功";
         return true;
     } catch (Exception $e) {
         BaseModel::rollback();
         BaseModel::autoCommit();
         self::$errCode = 201;
         self::$errMsg = $e->getMessage();
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:70,代碼來源:property.action.php

示例10: act_searchPickingInfo

 function act_searchPickingInfo($orderid)
 {
     $p_real_ebayid = '#^\\d+$#';
     $p_trackno_eub = '#^(LK|RA|RB|RC|RR|RF|LN|LX)\\d+(CN|HK|DE200)$#';
     $is_eub_package_type = false;
     if (preg_match($p_real_ebayid, $orderid)) {
     } else {
         if (preg_match($p_trackno_eub, $orderid)) {
             $is_eub_package_type = true;
         } else {
             return "訂單號{$orderid}沒有配貨記錄!訂單號不存在,請確認!";
             exit;
         }
     }
     if ($is_eub_package_type === true) {
         $ordercheck = ShippingOrderModel::getShippingOrderInfo("b.*", "where a.tracknumber='{$orderid}' and a.is_delete=0");
     } else {
         $ordercheck = ShippingOrderModel::getShippingOrder("*", "where id='{$orderid}'");
     }
     if (empty($ordercheck)) {
         return "訂單號{$orderid}沒有配貨記錄!訂單號不存在,請確認!";
         exit;
     } else {
         $orderid = $ordercheck[0]['id'];
     }
     $where = "where shipOrderId='{$orderid}' and is_delete=0";
     $list = OmAvailableModel::getTNameList("wh_order_picking_records", "*", $where);
     $eosr_arrlist = array();
     foreach ($list as $row) {
         $eosr_arrlist[] = $row['shipOrderdetailId'];
     }
     //$skuinfos = get_realskunum($orderid);
     $skuinfos = OmAvailableModel::getTNameList("wh_shipping_orderdetail", "*", "where shipOrderId='{$orderid}'");
     foreach ($skuinfos as $info) {
         $order_detail = array();
         if (!in_array($info['id'], $eosr_arrlist)) {
             $order_detail['shipOrderId'] = $info['shipOrderId'];
             $order_detail['shipOrderdetailId'] = $info['id'];
             $order_detail['sku'] = $info['sku'];
             $order_detail['pName'] = $info['pName'];
             $order_detail['totalNums'] = $info['amount'];
             $order_detail['isScan'] = 0;
             $order_detail['is_delete'] = 0;
             $field = ' SET ' . array2sql($order_detail);
             OmAvailableModel::addTNameRow("wh_order_picking_records", $field);
         }
     }
     $where = "where shipOrderId='{$orderid}'";
     $p_list = OmAvailableModel::getTNameList("wh_order_picking_records", "*", $where);
     $show = '';
     foreach ($p_list as $value) {
         $scan_status = $value['isScan'] == 0 ? '未配貨' : '已配貨';
         if (empty($value['scanUserId'])) {
             $op_name = '無';
         } else {
             //配貨人
             $usermodel = UserModel::getInstance();
             $iqc_user = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id={$value['scanUserId']}", '', '');
             $op_name = $iqc_user[0]['global_user_name'];
         }
         $op_amount = empty($value['amount']) ? 0 : $value['amount'];
         if ($value['is_delete'] == 1) {
             $show .= "<font style='color:red;'>配貨記錄已刪除:訂單{$orderid} 的料號 {$value['sku']} 倉位{$value['pName']} {$scan_status} 配貨人 {$op_name}, ";
             $show .= " 已配貨 {$op_amount} 還需配貨 " . ($value['totalNums'] - $op_amount);
             $show .= " PDA掃描時間:" . ($value['scanTime'] ? date('Y-m-d H:i:s', $value['scanTime']) : ' 無 ') . "</font>";
         } else {
             $show .= "訂單{$orderid} 的料號 {$value['sku']} 倉位{$value['pName']} {$scan_status} 配貨人 {$op_name}, ";
             $show .= " 已配貨 {$op_amount} 還需配貨 " . ($value['totalNums'] - $op_amount);
             $show .= " PDA掃描時間:" . ($value['scanTime'] ? date('Y-m-d H:i:s', $value['scanTime']) : ' 無 ');
         }
         /*					
         			if($value['isScan']==1 && $value['is_delete']==0){
         				$show .= "<input class='del' type='button' name='deletebutton' orderid='{$orderid}' sku='{$value['sku']}' pname='{$value['pName']}'  value='刪除訂單的配貨記錄,回滾庫存' />";
         			}*/
         $show .= "<br>";
     }
     return $show;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:78,代碼來源:pdaManagement.action.php

示例11: act_modify

 public function act_modify()
 {
     $skuNumber = 0;
     $skuAmount = 0;
     $skuSql = '';
     $detailArr = array();
     $num = $_REQUEST['num'];
     $orderId = $_REQUEST['orderId'];
     $detailId = $_REQUEST['detailId'];
     $transport = $_REQUEST['transport'];
     $materials = $_REQUEST['materials'];
     $skuString = $_REQUEST['skuString'];
     $numberString = $_REQUEST['numberString'];
     $countryName = $_REQUEST['countryName'];
     $state = $_REQUEST['state'];
     $city = $_REQUEST['city'];
     $street = $_REQUEST['street'];
     $address2 = $_REQUEST['address2'];
     $address3 = $_REQUEST['address3'];
     $landline = $_REQUEST['landline'];
     $phone = $_REQUEST['phone'];
     $zipCode = $_REQUEST['zipCode'];
     $currency = $_REQUEST['currency'];
     $notes = $_REQUEST['notes'];
     $detailIdArr = explode(',', $detailId);
     $skuArr = explode(',', $skuString);
     $numberArr = explode(',', $numberString);
     for ($i = 0; $i < $num; $i++) {
         $detailArr[$i]['id'] = $detailIdArr[$i];
         $detailArr[$i]['sku'] = $skuArr[$i];
         $detailArr[$i]['amount'] = $numberArr[$i];
     }
     $orderData = OmAvailableModel::getTNameList(' om_unshipped_order ', ' * ', ' WHERE id = ' . $orderId);
     $set = ' SET transportId = "' . $transport . '" , pmId	=	"' . $materials . '" ';
     $where = ' WHERE id = ' . $orderId;
     $ret1 = OmAvailableModel::updateTNameRow('om_unshipped_order', $set, $where);
     if ($ret1 === false) {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
     foreach ($detailArr as $k => $v) {
         $skuData = OmAvailableModel::getTNameList(' om_unshipped_order_detail ', ' * ', ' WHERE id = ' . $v['id']);
         $set = ' SET sku = "' . $v['sku'] . '" , amount = "' . $v['amount'] . '" ';
         $where = ' WHERE id = ' . $v['id'];
         $ret2 = OmAvailableModel::updateTNameRow('om_unshipped_order_detail', $set, $where);
         if ($ret2 === false) {
             self::$errCode = OmAvailableModel::$errCode;
             self::$errMsg = OmAvailableModel::$errMsg;
             return false;
         }
         if ($ret2 !== 0) {
             $skuSql .= ' UPDATE om_unshipped_order_detail SET sku = \\"' . $v['sku'] . '\\" , amount = \\"' . $v['amount'] . '\\" WHERE id = ' . $v['id'];
             if ($skuData[0]['sku'] != $v['sku']) {
                 $skuNumber = 1;
             }
             if ($skuData[0]['amount'] != $v['amount']) {
                 $skuAmount = 1;
             }
         }
     }
     $set = ' SET countryName = "' . $countryName . '" , state = "' . $state . '" , city	=	"' . $city . '" , street	=	"' . $street . '" , address2	=	"' . $address2 . '" , address3	=	"' . $address3 . '" , landline	=	"' . $landline . '" , phone	=	"' . $phone . '" , zipCode	=	"' . $zipCode . '" , currency	=	"' . $currency . '" ';
     $where = ' WHERE omOrderId = ' . $orderId;
     $ret3 = OmAvailableModel::updateTNameRow('om_unshipped_order_userInfo', $set, $where);
     if ($ret3 === false) {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
     if ($ret3 !== 0) {
         $userInfoSql .= ' UPDATE om_unshipped_order_userInfo  SET countryName = \\"' . $countryName . '\\" , state = \\"' . $state . '\\" , city	=	\\"' . $city . '\\" , street	=	\\"' . $street . '\\" , address2	=	\\"' . $address2 . '\\" , address3	=	\\"' . $address3 . '\\" , landline	=	\\"' . $landline . '\\" , phone	=	\\"' . $phone . '\\" , zipCode	=	\\"' . $zipCode . '\\" , currency	=	\\"' . $currency . '\\" WHERE omOrderId = ' . $orderId;
     }
     $currencyData = OmAvailableModel::getTNameList(' om_order_notes ', ' * ', ' WHERE omOrderId = ' . $orderId);
     if (!empty($currencyData)) {
         $set = ' SET content = "' . $notes . '" , userId = "' . $_SESSION['sysUserId'] . '" ,createdTime = "' . time() . '" ';
         $ret4 = OmAvailableModel::updateTNameRow('om_order_notes', $set, $where);
         if ($ret4 === false) {
             self::$errCode = OmAvailableModel::$errCode;
             self::$errMsg = OmAvailableModel::$errMsg;
             return false;
         }
         if ($ret4 !== 0) {
             $notesSql .= ' UPDATE om_unshipped_order_userInfo  SET notes = \\"' . $notes . '\\" , userId = \\"' . $_SESSION['sysUserId'] . '\\" ,createdTime = \\"' . time() . '\\"   WHERE omOrderId = ' . $orderId;
         }
     } else {
         $addNotes = ' (omOrderId,content,userId,createdTime) VALUES ("' . $orderId . '","' . $notes . '","' . $_SESSION['sysUserId'] . '","' . time() . '")';
         $ret4 = OmAvailableModel::addTNameRow('om_order_notes', $addNotes);
         if ($ret4 === false) {
             self::$errCode = OmAvailableModel::$errCode;
             self::$errMsg = OmAvailableModel::$errMsg;
             return false;
         }
         if ($ret4 !== 0) {
             $notesSql .= ' INSERT INTO om_order_notes (omOrderId,content,userId,createdTime) VALUES (\\"' . $orderId . '\\",\\"' . $notes . '\\",\\"' . $_SESSION['sysUserId'] . '\\",\\"' . time() . '\\")';
         }
     }
     if ($ret1 !== 0 || $ret2 !== 0 || $ret3 !== 0 || $ret4 !== 0) {
         $value = ' (`operatorId`,`omOrderId`,`oldStatus`,`newStatus`,`sql`,`note`,`createdTime`) VALUES (';
         $value .= '"' . $_SESSION['sysUserId'] . '",';
         $value .= '"' . $orderId . '",';
//.........這裏部分代碼省略.........
開發者ID:ohjack,項目名稱:newErp,代碼行數:101,代碼來源:orderModify.action.php

示例12: explode

        $affectRowCom = 1;
        if ($affectRowCom !== false) {
            //echo "{$pcGoodsArr['combineSku']} insert success\n";
            $goods_sncombine = $value['goods_sncombine'];
            $tmpArr1 = explode(',', $goods_sncombine);
            //按逗號截取字符串,生成對應真實料號及對應數量的數組數量
            //$tName = 'pc_sku_combine_relation';
            //            $where = "WHERE combineSku='{$pcGoodsArr['combineSku']}'";
            //            OmAvailableModel::deleteTNameRow($tName, $where);//刪除舊的關係
            //            echo "{$pcGoodsArr['combineSku']} old relation delete success\n";
            foreach ($tmpArr1 as $value1) {
                $tmpArr2 = explode('*', $value1);
                //按*截取,獲取真實料號及數量
                $trueSku = trim($tmpArr2[0]);
                $amount = trim($tmpArr2[1]);
                if (!empty($trueSku) && !empty($amount)) {
                    $tName = 'pc_sku_combine_relation';
                    $set = "SET combineSku='{$pcGoodsArr['combineSku']}',sku='{$trueSku}',count='{$amount}'";
                    $affectRow = OmAvailableModel::addTNameRow($tName, $set);
                    if ($affectRow !== false) {
                        echo "{$pcGoodsArr['combineSku']} {$trueSku} {$amount} insert success in relation\n";
                    } else {
                        echo "{$pcGoodsArr['combineSku']} {$trueSku} {$amount} insert fail in relation\n";
                    }
                }
            }
        } else {
            echo "{$pcGoodsArr['combineSku']} insert fail\n";
        }
    }
}
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:crontab_ebay_productscombine_2_pc_combine2.php

示例13: view_addInputOn

 public function view_addInputOn()
 {
     $inputName = $_GET['inputName'] ? post_check(trim($_GET['inputName'])) : '';
     $pid = $_GET['pid'] ? post_check(trim($_GET['pid'])) : '';
     if (empty($inputName)) {
         $status = "屬性名不能為空";
         header("Location:index.php?mod=property&act=addInput&status={$status}");
         exit;
     }
     if (empty($pid)) {
         $status = "類別不能為空";
         header("Location:index.php?mod=property&act=addInput&status={$status}");
         exit;
     }
     $categoryName = getAllCateNameByPath($pid);
     $pathImplodeStr = getAllPathBypid($pid);
     $tName = 'pc_archive_input';
     $where = "WHERE inputName='{$inputName}' and categoryPath IN ({$pathImplodeStr})";
     $count = OmAvailableModel::getTNameCount($tName, $where);
     if ($count) {
         $status = "{$categoryName} 或其父類下已經存在 {$inputName} 屬性";
         header("Location:index.php?mod=property&act=addInput&status={$status}");
         exit;
     }
     $set = "SET inputName='{$inputName}',categoryPath='{$pid}'";
     $insertId = OmAvailableModel::addTNameRow($tName, $set);
     if (!$insertId) {
         $status = "係統插入數據錯誤";
         header("Location:index.php?mod=property&act=addInput&status={$status}");
         exit;
     }
     $status = "{$categoryName} 中添加 {$inputName} 文本屬性成功";
     header("Location:index.php?mod=property&act=addInput&status={$status}");
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:34,代碼來源:property.view.php

示例14: act_addSkuConversion

 function act_addSkuConversion()
 {
     $old_sku = $_POST['old_sku'] ? post_check(trim($_POST['old_sku'])) : '';
     //old_sku
     $new_sku = $_POST['new_sku'] ? post_check(trim($_POST['new_sku'])) : '';
     //new_sku
     $addUserId = intval($_SESSION['userId']);
     $createdTime = time();
     if (empty($old_sku) || empty($new_sku)) {
         self::$errCode = '101';
         self::$errMsg = "新/舊料號不能為空";
         return;
     }
     if ($old_sku == $new_sku) {
         self::$errCode = '109';
         self::$errMsg = "新/舊料號相同,不能轉換";
         return;
     }
     if (!preg_match("/^[A-Z0-9]+(_[A-Z0-9]+)*\$/", $new_sku)) {
         self::$errCode = '100';
         self::$errMsg = "新料號 {$new_sku} 格式不合法";
         return;
     }
     if ($addUserId <= 0) {
         self::$errCode = '103';
         self::$errMsg = "登陸超時,請重試";
         return;
     }
     $tName = 'pc_sku_conversion';
     $where = "WHERE is_delete=0 AND old_sku='{$old_sku}'";
     $countOldSkuCon = OmAvailableModel::getTNameCount($tName, $where);
     //在料號轉換表裏查找是否已經存在該舊料號的信息
     if ($countOldSkuCon) {
         self::$errCode = '104';
         self::$errMsg = "舊料號 {$old_sku} 已經存在料號轉換列表中";
         return;
     }
     $tName = 'pc_goods';
     $select = '*';
     $where = "WHERE is_delete=0 AND sku='{$old_sku}' order by id desc limit 1";
     $oldSkuList = OmAvailableModel::getTNameList($tName, $select, $where);
     //在產品表裏找是否存在舊料號
     $oldSku = $oldSkuList[0];
     //舊料號的信息
     if (empty($oldSku)) {
         self::$errCode = '105';
         self::$errMsg = "舊料號 {$old_sku} 在產品列表中不存在";
         return;
     }
     try {
         BaseModel::begin();
         $tName = 'pc_sku_conversion';
         $set = "SET old_sku='{$old_sku}',new_sku='{$new_sku}',addUserId='{$addUserId}',createdTime='{$createdTime}'";
         $flag = OmAvailableModel::addTNameRow($tName, $set);
         //添加轉換記錄
         if ($flag) {
             self::$errCode = '200';
             self::$errMsg = "舊料號 {$old_sku}轉{$new_sku}添加成功";
         }
         BaseModel::commit();
         BaseModel::autoCommit();
         return;
     } catch (Exception $e) {
         BaseModel::rollback();
         BaseModel::autoCommit();
         self::$errCode = '404';
         self::$errMsg = $e->getMessage();
         return;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:70,代碼來源:skuConversion.action.php

示例15: view_addSpuPrefixOn

 public function view_addSpuPrefixOn()
 {
     $prefix = $_GET['prefix'] ? post_check(trim($_GET['prefix'])) : '';
     $isSingSpu = $_GET['isSingSpu'] ? post_check(trim($_GET['isSingSpu'])) : '';
     $companyId = $_GET['companyId'] ? post_check(trim($_GET['companyId'])) : '';
     $isUse = $_GET['isUse'] ? post_check(trim($_GET['isUse'])) : '';
     if (!preg_match("/^[A-Z]{2}\$/", $prefix)) {
         $status = "前綴必須是兩個大寫字母的組合";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     if (intval($isSingSpu) != 1 && intval($isSingSpu) != 2) {
         $status = "單/組合料號有誤";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     $companyInfo = getCompanyNameById($companyId);
     if (empty($companyInfo)) {
         $status = "公司信息有誤";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     if (intval($isUse) == 0) {
         $status = "啟動/禁用不能為空";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     $tName = 'pc_auto_create_spu_prefix';
     $where = "WHERE prefix='{$prefix}' AND companyId='{$companyId}'";
     $count = OmAvailableModel::getTNameCount($tName, $where);
     if ($count) {
         $status = "該公司下已經存在 {$prefix} 前綴";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     $set = "SET prefix='{$prefix}',isSingSpu='{$isSingSpu}',companyId='{$companyId}',isUse='{$isUse}'";
     $insertId = OmAvailableModel::addTNameRow($tName, $set);
     if (!$insertId) {
         $status = "係統插入數據錯誤";
         header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
         exit;
     }
     $status = "添加 {$prefix} 前綴成功";
     header("Location:index.php?mod=spu&act=getSpuPrefixList&status={$status}");
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:45,代碼來源:spu.view.php


注:本文中的OmAvailableModel::addTNameRow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。