当前位置: 首页>>代码示例>>PHP>>正文


PHP OmAvailableModel::updateTNameRow方法代码示例

本文整理汇总了PHP中OmAvailableModel::updateTNameRow方法的典型用法代码示例。如果您正苦于以下问题:PHP OmAvailableModel::updateTNameRow方法的具体用法?PHP OmAvailableModel::updateTNameRow怎么用?PHP OmAvailableModel::updateTNameRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OmAvailableModel的用法示例。


在下文中一共展示了OmAvailableModel::updateTNameRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: act_updateTNameRow

 function act_updateTNameRow($tName, $set, $where)
 {
     $ret = OmAvailableModel::updateTNameRow($tName, $set, $where);
     if ($ret !== FALSE) {
         return $ret;
     } else {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:11,代码来源:omAvailable.action.php

示例2: view_updateSpuArchiveOn


//.........这里部分代码省略.........
                 //多选
                 //多选时,$_POST['pro'.$value['id']]存放的是一个数组,固定某个propertyId下的多个值
                 $tmpPostValueArr = $_POST['pro' . $value['id']];
                 if (!empty($tmpPostValueArr)) {
                     foreach ($tmpPostValueArr as $value2) {
                         $tmpArr['spu'] = $spu;
                         $tmpArr['propertyId'] = $value['id'];
                         $tmpArr['propertyValueId'] = $value2;
                         $dataPro[] = $tmpArr;
                     }
                 }
             }
         }
     }
     $dataInp = array();
     $tName = 'pc_archive_input';
     $select = '*';
     $where = "WHERE categoryPath IN ({$pathImplodeStr})";
     $inpList = OmAvailableModel::getTNameList($tName, $select, $where);
     if (!empty($inpList)) {
         foreach ($inpList as $value) {
             $tmpArr = array();
             $tmpArr['spu'] = $spu;
             $tmpArr['inputId'] = $value['id'];
             $tmpArr['inputValue'] = $_POST['inp' . $value['id']];
             $dataInp[] = $tmpArr;
         }
     }
     try {
         BaseModel::begin();
         //pc_spu_archive中插入数据
         $tName = 'pc_spu_archive';
         $where = "WHERE spu='{$spu}'";
         $affectRowSpu = OmAvailableModel::updateTNameRow2arr($tName, $dataSpu, $where);
         if ($affectRowSpu === false) {
             throw new Exception('add pc_spu_archive error');
         }
         //add zqt 20140711 添加特殊属性
         if (!empty($spId) && is_array($spId)) {
             $tName = 'pc_special_property_spu';
             $where = "WHERE spu='{$spu}'";
             OmAvailableModel::deleteTNameRow($tName, $where);
             foreach ($spId as $propertyIdValue) {
                 $propertyIdValue = intval($propertyIdValue);
                 $dataTmpArr = array();
                 $dataTmpArr['propertyId'] = $propertyIdValue;
                 $dataTmpArr['spu'] = $spu;
                 OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
             }
         }
         //add 20140526 更新PK细分SKU
         $tName = 'pc_spu_archive_pk_sku';
         $where = "WHERE spu='{$spu}'";
         OmAvailableModel::deleteTNameRow($tName, $where);
         //先删掉之前关联的记录
         foreach ($pkSkuArr as $value) {
             $tName = 'pc_spu_archive_pk_sku';
             $dataPkSkuArr['spu'] = $spu;
             $dataPkSkuArr['sku'] = $value;
             OmAvailableModel::addTNameRow2arr($tName, $dataPkSkuArr);
         }
         //pc_archive_spu_link中插入数据
         $tName = 'pc_archive_spu_link';
         if (!empty($dataLink)) {
             $affectRowDelLnk = OmAvailableModel::deleteTNameRow($tName, $where);
             if ($affectRowDelLnk === false) {
开发者ID:ohjack,项目名称:newErp,代码行数:67,代码来源:autoCreateSpu.view.php

示例3: act_packingTracknumber

 public function act_packingTracknumber()
 {
     $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : "";
     $tracknumber = isset($_POST['tracknumber']) ? $_POST['tracknumber'] : "";
     $userId = $_SESSION['userId'];
     //先核对订单
     //兼容 EUB或者 包裹 扫描的是 trackno 而非ebayid
     $p_real_ebayid = '#^\\d+$#';
     $p_trackno_eub = '#^(LK|RA|RB|RC|RR|RF|LN)\\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 {
             self::$errCode = "001";
             self::$errMsg = "订单号[" . $orderid . "]格式有误";
             return false;
         }
     }
     if ($is_eub_package_type === true) {
         $record = ShippingOrderModel::getShippingOrderInfo("b.*", "where a.tracknumber='{$orderid}' and a.is_delete=0");
     } else {
         $record = ShippingOrderModel::getShippingOrder("*", "where id='{$orderid}'");
     }
     //验证发货单号 以及所属状态
     if (!$record) {
         self::$errCode = 404;
         self::$errMsg = "发货单号不存在!";
         return false;
     }
     if ($record[0]['orderStatus'] != 404) {
         self::$errCode = 405;
         self::$errMsg = "此发货单不在待包装!";
         if ($record[0]['orderStatus'] == 900) {
             self::$errMsg = "此发货单已废弃!";
         }
         return false;
     }
     //挂号的单需要再输入挂号条码
     $carrier = CommonModel::getShipingNameById($record[0]['transportId']);
     $partion = CommonModel::getChannelNameByIds($record[0]['transportId'], $record[0]['countryName']);
     $total_num = 0;
     $skuinfos = get_realskunum($record[0]['id']);
     foreach ($skuinfos as $or_sku => $or_nums) {
         $total_num += $or_nums;
     }
     if (carrier == '中国邮政挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(CN)\$/", $tracknumber)) {
         self::$errCode = 111;
         self::$errMsg = "录入失败,中国邮政挂号跟踪码不符合规范";
         return false;
     }
     if ($carrier == '香港小包挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(HK)\$/", $tracknumber)) {
         self::$errCode = 111;
         self::$errMsg = "录入失败,香港小包挂号跟踪码不符合规范";
         return false;
     }
     $p_str = "挂号条码:" . "<font color='#FF0000'>" . $tracknumber . "</font> <br>";
     TransactionBaseModel::begin();
     //更新订单状态
     $msg = OmAvailableModel::updateTNameRow("wh_shipping_order", "set orderStatus=405", "where id={$record[0]['id']}");
     if (!$msg) {
         self::$errCode = 409;
         self::$errMsg = "更新发货单状态记录失败!";
         $arr['partion'] = $partion;
         $arr['carrier'] = $carrier;
         TransactionBaseModel::rollback();
         return json_encode($arr);
         exit;
     }
     //更新操作记录
     $msg = packingScanOrderModel::updateOrderRecord($record[0]['id'], $userId);
     if (!$msg) {
         self::$errCode = 406;
         self::$errMsg = "更新发货单操作记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     //插入包装记录
     $msg = packingScanOrderModel::insertPackingRecord($record[0]['id'], $userId);
     if (!$msg) {
         self::$errCode = 407;
         self::$errMsg = "插入包装记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     $msg = packingScanOrderModel::deleteTrackRecord($record[0]['id']);
     if (!$msg) {
         self::$errCode = 409;
         self::$errMsg = "删除跟踪记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     //录入挂号条码
     $msg = packingScanOrderModel::insertTrackRecord($tracknumber, $record[0]['id']);
     if (!$msg) {
         self::$errCode = 408;
         self::$errMsg = "插入包装记录失败!";
         TransactionBaseModel::rollback();
         return false;
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:packingOrder.action.php

示例4: act_setSkuWeightInWh

 /**
  *功能:提供给仓库系统的接口,重量拦截重新得到重量
  * */
 public function act_setSkuWeightInWh()
 {
     $sku = isset($_GET['sku']) ? $_GET['sku'] : "";
     $skuweight = isset($_GET['skuweight']) ? $_GET['skuweight'] / 1000 : "";
     //传递过来的重量为g
     $userId = isset($_GET['userId']) ? $_GET['userId'] : 0;
     if (intval($userId) <= 0) {
         self::$errCode = 111;
         self::$errMsg = "登陆超时,请重新登陆!";
         return false;
     }
     if (empty($sku) || empty($skuweight)) {
         self::$errCode = 333;
         self::$errMsg = "料号或重量不能为空!";
         return false;
     }
     $skuList = getSkuBygoodsCode($sku);
     //根据条码获取真实sku
     if (empty($skuList)) {
         self::$errCode = 404;
         self::$errMsg = '料号不存在';
         return false;
     }
     $oldWeight = !empty($skuList[0]['goodsWeight']) ? $skuList[0]['goodsWeight'] : 0;
     //先找出该sku的重量
     if ($oldWeight != $skuweight) {
         //如果新旧重量不相等时,则更新
         try {
             BaseModel::begin();
             $tName = 'pc_goods';
             $set = "SET goodsWeight='{$skuweight}'";
             $where = "WHERE sku='{$skuList[0]['sku']}'";
             OmAvailableModel::updateTNameRow($tName, $set, $where);
             //$info = UserCacheModel::getOpenSysApi('pc.updateTNameRow',array(array('tName'=>"pc_goods",'set'=>"goodsWeight='{$skuweight}'",'where'=>"WHERE sku='{$sku}' and is_delete = 0")));
             //添加重量备份记录
             //$tName = 'pc_goods_weight_backups';
             //    			$backupsArr = array ();
             //    			$backupsArr['sku'] = $skuList[0]['sku'];
             //    			$backupsArr['goodsWeight'] = $skuweight;
             //    			$backupsArr['addUserId'] = $userId;
             //    			$backupsArr['addTime'] = time();
             //    			OmAvailableModel :: addTNameRow2arr($tName, $backupsArr);
             addWeightBackupsModify($skuList[0]['sku'], $skuweight, $userId);
             //
             //$url = "add2ebay_goods_weight.php?goods_sn=".$skuList[0]['sku']."&goods_weight=".$skuweight;
             //            OmAvailableModel::newData2ErpInterf($url);
             $paraArr['goods_sn'] = $skuList[0]['sku'];
             $paraArr['goods_weight'] = $skuweight;
             $res = OmAvailableModel::newData2ErpInterfOpen('pc.erp.addGoodsSnWeight', $paraArr, 'gw88');
             //print_r($res);
             //            exit;
             BaseModel::commit();
             BaseModel::autoCommit();
             $string = empty($oldWeight) ? "(Kg) 录入成功!" : "(Kg) 更新成功,原来重量为 {$oldWeight}(Kg)";
             self::$errCode = 200;
             self::$errMsg = $skuList[0]['sku'] . " 重量 " . $skuweight . $string;
             return true;
         } catch (Exception $e) {
             BaseModel::rollback();
             BaseModel::autoCommit();
             self::$errCode = 404;
             self::$errMsg = $skuList[0]['sku'] . " 重量 " . $skuweight . "(Kg) 录入失败! " . $e->getMessage();
             return false;
         }
     } else {
         self::$errCode = 200;
         self::$errMsg = $skuList[0]['sku'] . " 重量 无修改,为 {$skuweight}(Kg)";
         return true;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:73,代码来源:omAvailableApi.action.php

示例5: act_whReturnSkuShelf

 public function act_whReturnSkuShelf()
 {
     //print_r($_POST);
     $sku = trim($_POST['sku']);
     $sku = get_goodsSn($sku);
     $nums = $_POST['nums'];
     $select_now_position = $_POST['select_now_position'];
     $select_now_store = $_POST['select_now_store'];
     $select_hope_position = $_POST['select_hope_position'];
     $select_hope_store = $_POST['select_hope_store'];
     if (empty($sku)) {
         self::$errCode = 401;
         self::$errMsg = "sku不能为空";
         return false;
     }
     if (empty($select_now_position) && empty($select_now_store) && empty($select_hope_position) && empty($select_hope_store)) {
         self::$errCode = 401;
         self::$errMsg = "上架位置不能为空";
         return false;
     }
     $where = "where sku='{$sku}' and status=0";
     $tallying_list = PostReturnModel::getReturnList("*", $where);
     if (empty($tallying_list)) {
         self::$errCode = 402;
         self::$errMsg = "无该料号退回信息";
         return false;
     } else {
         $tallying_num = 0;
         foreach ($tallying_list as $tallying) {
             $tallying_num += $tallying['ichibanNums'] - $tallying['shelvesNums'];
         }
         if ($nums > $tallying_num) {
             self::$errCode = 402;
             self::$errMsg = "上架数不能大于qc良品数[{$tallying_num}]";
             return false;
         }
     }
     if ($nums < 1) {
         self::$errCode = 403;
         self::$errMsg = "入库数量不能小于1";
         return false;
     }
     $where = " where sku = '{$sku}'";
     $skuinfo = whShelfModel::selectSku($where);
     if (empty($skuinfo)) {
         self::$errCode = 404;
         self::$errMsg = "无该料号信息";
         return false;
     } else {
         $skuId = $skuinfo['id'];
         $purchaseId = $skuinfo['purchaseId'];
     }
     $userId = $_SESSION['userId'];
     $in_positionId = 0;
     TransactionBaseModel::begin();
     /***无料号对应仓位的关系时更新关系表***/
     if ($select_hope_store != 0 || $select_hope_position != 0) {
         $type = 1;
         $positionId = $select_hope_position;
         if ($select_hope_store != 0) {
             $type = 2;
             $positionId = $select_hope_store;
         }
         $in_positionId = $positionId;
         $tname = "wh_product_position_relation";
         $set = "set pId='{$skuId}',positionId='{$positionId}',nums='{$nums}',type='{$type}'";
         $insert_relation = OmAvailableModel::insertRow($tname, $set);
         if (!$insert_relation) {
             self::$errCode = 408;
             self::$errMsg = "插入关系表失败!";
             TransactionBaseModel::rollback();
             return false;
         }
         //更新仓位使用状态
         $update_position = OmAvailableModel::updateTNameRow("wh_position_distribution", "set is_enable=1", "where id={$positionId}");
         if ($update_position === false) {
             self::$errCode = 409;
             self::$errMsg = "更新仓位使用状态失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     }
     //更新指定仓位存货数量
     if ($select_now_store != 0) {
         $positioninfo = whShelfModel::selectRelation("where id={$select_now_store}");
         $in_positionId = $positioninfo[0]['positionId'];
         $update_position = whShelfModel::updateProductPositionRelation($nums, "where id='{$select_now_store}'");
         if (!$update_position) {
             self::$errCode = 410;
             self::$errMsg = "更新仓位库存失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     }
     if ($select_now_store == 0 && $select_hope_position == 0 && $select_hope_store == 0) {
         $positioninfo = whShelfModel::selectRelation("where id={$select_now_position}");
         $in_positionId = $positioninfo[0]['positionId'];
         $update_position = whShelfModel::updateProductPositionRelation($nums, "where id='{$select_now_position}'");
         if (!$update_position) {
             self::$errCode = 411;
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:whShelf.action.php

示例6: act_operatUnusualOrder

 function act_operatUnusualOrder()
 {
     $purid = isset($_GET['purid']) ? $_GET['purid'] : '';
     $oid = isset($_GET['oid']) ? base64_decode($_GET['oid']) : '';
     $category = isset($_GET['category']) ? $_GET['category'] : '';
     if (empty($purid) || empty($oid) || empty($category)) {
         //参数不完整
         self::$errCode = 101;
         self::$errMsg = '参数信息不完整';
         return false;
     }
     $nowtime = time();
     if ($category == 'comfirmorder') {
         $rtn = OmAvailableModel::updateTNameRow("wh_abnormal_purchase_orders", "set isConfirm=1,confirmUserId='{$purid}'", "where id in {$oid}");
     } else {
         if ($category == 'patchorder') {
             $recordnumber = isset($_GET['recordnumber']) ? $_GET['recordnumber'] : '';
             $rtn = OmAvailableModel::updateTNameRow("wh_abnormal_purchase_orders", "set abStatus=1,ioOrdersn='{$recordnumber}'", "where isConfirm=1 and id in {$oid}");
         } else {
             if ($category == 'setzero') {
                 $rtn = OmAvailableModel::updateTNameRow("wh_abnormal_purchase_orders", "set abStatus=3,nums=0", "where isConfirm=1 and id in {$oid}");
             } else {
                 if ($category == 'secondstockin') {
                     $rtn = OmAvailableModel::updateTNameRow("wh_abnormal_purchase_orders", "set abStatus=3,nums=0", "where isConfirm=1 and id in {$oid}");
                 } else {
                     if ($category == 'backorder') {
                         $rtn = OmAvailableModel::updateTNameRow("wh_abnormal_purchase_orders", "set abStatus=2,cancelTime='{$nowtime}',cancelUserId='{$purid}'", "where isConfirm=1 and id in {$oid}");
                     }
                 }
             }
         }
     }
     if ($rtn === false) {
         self::$errCode = 102;
         self::$errMsg = '操作失败';
         return false;
     } else {
         return true;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:40,代码来源:whOpenApi.action.php

示例7: act_completion

 public function act_completion()
 {
     $order_id = $_POST['ebay_id'];
     //先核对订单
     $p_real_ebayid = '#^\\d+$#';
     if (!preg_match($p_real_ebayid, $order_id)) {
         self::$errCode = "100";
         self::$errMsg = "订单号[" . $order_id . "]格式有误";
         return false;
     }
     $complete = ShippingOrderModel::update(array('orderStatus' => PKS_UNUSUAL_SHIPPING_INVOICE), "and id='{$order_id}'");
     //	$complete = 111;
     if ($complete) {
         $time = time();
         OmAvailableModel::updateTNameRow("wh_order_review_records", "set scanUserId='{$_SESSION['userId']}',scanTime={$time},isScan = 1", "where shipOrderId={$order_id}");
         //	WhPushModel::pushOrderStatus($ordercheck[0]['id'],PKS_UNUSUAL_SHIPPING_INVOICE,$_SESSION['userId'],$time);        //状态推送,需要改为异常发货单(订单系统提供状态常量)
         self::$errCode = 200;
         self::$errMsg = '订单[' . $order_id . ']复核(拍照)成功,请扫描复核下一订单';
         $res['shipOrderId'] = $order_id;
         return $res;
     } else {
         self::$errCode = "006";
         self::$errMsg = '订单复核出现异常,请重新复核';
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:26,代码来源:orderReview.action.php

示例8: updateNewPostion

function updateNewPostion($sku, $location)
{
    global $dbConn;
    $goodsinfos = OmAvailableModel::getTNameList("pc_goods", "sku,id", "where sku='{$sku}'");
    $pId = $goodsinfos[0]['id'];
    //产品id
    if ($location) {
        $sql1 = "select * from `wh_position_distribution` where pName = '{$location}'";
        $query = $dbConn->query($sql1);
        $wh_position_distribution = $dbConn->fetch_array($query);
        if ($wh_position_distribution) {
            $positionId = $wh_position_distribution['id'];
            //$postionId = OmAvailableModel::insertRow2("wh_position_distribution","set pName='$location',x_alixs=0,y_alixs=0,z_alixs=0,floor=0,is_enable=0,type=1,storeId=2");
            if ($positionId) {
                $positioninfos = OmAvailableModel::getTNameList("wh_product_position_relation", "id", "where pId='{$pId}' and storeId = '{$wh_position_distribution['storeId']}'");
                if (!empty($positioninfos)) {
                    if ($data = OmAvailableModel::updateTNameRow("wh_product_position_relation", "set positionId='{$positionId}', storeId={$wh_position_distribution['storeId']}", " where pId='{$pId}' and storeId = '{$wh_position_distribution['storeId']}'")) {
                        //echo "update <".$sku."> ===(".$positionId.") success\n";
                        return true;
                    } else {
                        return false;
                    }
                } else {
                    //$infos = OmAvailableModel::getTNameList("wh_sku_location","sku,actualStock","where sku='{$sku}'");
                    //					$num = $info['actualStock'];
                    $data = OmAvailableModel::insertRow("wh_product_position_relation", "set pId='{$pId}',positionId='{$positionId}', storeId={$wh_position_distribution['storeId']}");
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
}
开发者ID:ohjack,项目名称:newErp,代码行数:35,代码来源:updateSkuStock.php

示例9: act_whShelf


//.........这里部分代码省略.........
     	}
     	if ($return_num==$nums){
     		$reach_note = "sku[{$sku}]到货{$nums}个,未找到该料号的订单,请物料点货确认和采购补单!";
     	}else{
     		$reach_note = "sku[{$sku}]到货{$nums}个,入库完毕后还多余{$return_num}个,请物料点货确认和采购补单!";
     	}
     	$msg = whShelfModel::insertNoOrder($sku,$return_num,$totalNums,$purchaseId,$userId,$reach_note);
     	if(!$msg){
     		self::$errCode = whShelfModel::$errCode;
     		self::$errMsg  = whShelfModel::$errMsg;
     		return false;
     	}
     }
     */
     /***无料号对应仓位的关系时更新关系表***/
     if ($select_hope_store != 0 || $select_hope_position != 0) {
         $type = 1;
         $positionId = $select_hope_position;
         if ($select_hope_store != 0) {
             $type = 2;
             $positionId = $select_hope_store;
         }
         $in_positionId = $positionId;
         $tname = "wh_product_position_relation";
         $set = "set pId='{$skuId}',positionId='{$positionId}',nums='{$nums}',type='{$type}',storeId=2";
         $insert_relation = OmAvailableModel::insertRow($tname, $set);
         if (!$insert_relation) {
             self::$errCode = 408;
             self::$errMsg = "插入关系表失败!";
             TransactionBaseModel::rollback();
             return false;
         }
         //更新仓位使用状态
         $update_position = OmAvailableModel::updateTNameRow("wh_position_distribution", "set is_enable=1", "where id={$positionId}");
         if ($update_position === false) {
             self::$errCode = 409;
             self::$errMsg = "更新仓位使用状态失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     }
     //更新指定仓位存货数量
     if ($select_now_store != 0) {
         $positioninfo = whShelfModel::selectRelation("where id={$select_now_store}");
         $in_positionId = $positioninfo[0]['positionId'];
         $update_position = whShelfModel::updateProductPositionRelation($nums, "where id='{$select_now_store}'");
         if (!$update_position) {
             self::$errCode = 410;
             self::$errMsg = "更新仓位库存失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     }
     if ($select_now_store == 0 && $select_hope_position == 0 && $select_hope_store == 0) {
         $positioninfo = whShelfModel::selectRelation("where id={$select_now_position}");
         $in_positionId = $positioninfo[0]['positionId'];
         $update_position = whShelfModel::updateProductPositionRelation($nums, "where id='{$select_now_position}'");
         if (!$update_position) {
             self::$errCode = 411;
             self::$errMsg = "更新仓位库存失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     }
     /**** 更新总库存 *****/
     $actualStock = whShelfModel::selectSkuNums($sku, 2);
开发者ID:ohjack,项目名称:newErp,代码行数:67,代码来源:whShelfB.action.php

示例10: act_deleteSkuConversion

 function act_deleteSkuConversion()
 {
     $id = intval($_GET['id']);
     if ($id <= 0) {
         $status = "无效记录";
         echo '<script language="javascript">
                 alert("' . $status . '");
                 window.history.back();
               </script>';
         exit;
     }
     $tName = 'pc_sku_conversion';
     $set = "SET is_delete=1";
     $where = "WHERE auditStatus=1 AND id={$id}";
     OmAvailableModel::updateTNameRow($tName, $set, $where);
     $status = "删除成功";
     echo '<script language="javascript">
             alert("' . $status . '");
             window.history.back();
           </script>';
     exit;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:22,代码来源:goods.action.php

示例11: act_invokeListOrders

 function act_invokeListOrders(MarketplaceWebServiceOrders_Interface $service, $request, $account, $site, $accountId, $flip_transportList, $message)
 {
     //		/global $account, $site, $accountId, $flip_transportList , $message;
     try {
         $response = $service->getOrder($request);
         //echo ("Service Response\n");
         //echo ("=============================================================================\n");
         if ($response->isSetGetOrderResult()) {
             //echo ("ListOrdersResult\n");
             $listOrdersResult = $response->getGetOrderResult();
             /*if ($listOrdersResult->isSetNextToken()) {
             			//echo ("	NextToken----");
             			//echo ($listOrdersResult->getNextToken() . "\n");
             		}
             		
             		if ($listOrdersResult->isSetCreatedBefore()) {
             			//echo ("CreatedBefore----");
             			//echo ($listOrdersResult->getCreatedBefore() . "\n");
             		}
             		if ($listOrdersResult->isSetLastUpdatedBefore()) {
             			//echo ("LastUpdatedBefore----");
             			//echo ($listOrdersResult->getLastUpdatedBefore() . "\n");
             		}*/
             if ($listOrdersResult->isSetOrders()) {
                 $orders = $listOrdersResult->getOrders();
                 $orderList = $orders->getOrder();
                 $orderIndex = 1;
                 $now = time();
                 //BaseModel :: begin(); //开始事务
                 foreach ($orderList as $order) {
                     //echo ("***********Orders $orderIndex************\n\n");
                     $orderIndex++;
                     $orderData = array();
                     //om_unshipped_order
                     $orderUserInfoData = array();
                     //om_unshipped_order_userInfo
                     $orderExtenData = array();
                     //om_unshipped_order_extension
                     $street2 = '';
                     //街道2
                     $street3 = '';
                     //街道3
                     if ($order->isSetAmazonOrderId() && $order->isSetOrderStatus() && $order->getOrderStatus() == 'Unshipped') {
                         //$orderData['ebay_status'] = 1; //同步进来的订单的状态
                         $orderData['recordNumber'] = $order->getAmazonOrderId();
                         //平台上的订单id
                         //echo "AmazonOrderId ==== {$orderData['recordNumber']}\n";
                     } else {
                         //echo 'getOrderStatus======' . $order->getOrderStatus() . "\n";
                         if ($order->getOrderStatus() == 'Shipped') {
                             //表示已经发货了的订单
                             $shippedRecordNum = $order->getAmazonOrderId();
                             $tName = 'om_shipped_order';
                             $where = "WHERE recordNumber='{$shippedRecordNum}' and accountId='{$accountId}' and ShippedTime=''";
                             $set = "SET ShippedTime='{$now}'";
                             //标记发货时间
                             $affectRow = OmAvailableModel::updateTNameRow($tName, $set, $where);
                             if ($affectRow) {
                                 $message .= "<font color='green'>update {$shippedRecordNum} ShippedTime success" . "</font><br>";
                             } else {
                                 $message .= "<font color='red'>update {$shippedRecordNum} ShippedTime fail may be has shippedTime or had no this recordNumber" . "</font><br>";
                             }
                         }
                         continue;
                     }
                     if ($order->isSetPurchaseDate()) {
                         //亚马逊平台上的下单时间
                         $orderData['ordersTime'] = strtotime($order->getPurchaseDate());
                         //echo ("addTime  ==== {$order->getPurchaseDate()}\n");
                     }
                     if ($order->isSetLastUpdateDate()) {
                         //支付时间
                         $orderData['paymentTime'] = strtotime($order->getLastUpdateDate());
                         //echo ("paidTime  ==== {$order->getLastUpdateDate()}\n");
                     }
                     $orderstatus = '';
                     //订单状态
                     //if ($order->isSetOrderStatus()) {
                     //                    	if($order->getOrderStatus() == 'Unshipped'){
                     //							$orderstatus				= 1;
                     //						}
                     //					}
                     if ($order->isSetFulfillmentChannel()) {
                         $orderExtenData['FulfillmentChannel'] = $order->getFulfillmentChannel();
                         //echo ("FulfillmentChannel  ==== "); //订单配送方式
                         //echo ($orderExtenData['FulfillmentChannel'] . "\n");
                     }
                     if ($order->isSetSalesChannel()) {
                         $orderExtenData['SalesChannel'] = $order->getSalesChannel();
                         //echo ("SalesChannel ==== ");
                         //echo ($orderExtenData['SalesChannel'] . "\n");
                     }
                     if ($order->isSetOrderChannel()) {
                         $orderExtenData['OrderChannel'] = $order->getOrderChannel();
                         //echo ("OrderChannel ====");
                         //echo ($orderExtenData['OrderChannel'] . "\n");
                     }
                     if ($order->isSetShipServiceLevel()) {
                         $orderExtenData['ShipServiceLevel'] = $order->getShipServiceLevel();
                         //echo ("ShipServiceLevel ==== ");
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:fetchAmazonOrder.action.php

示例12: act_shiftLibrary

 public function act_shiftLibrary()
 {
     $sku = trim($_POST['sku']);
     $sku = get_goodsSn($sku);
     $oldposition = trim($_POST['oldposition']);
     $newposition = trim($_POST['newposition']);
     $nums = intval(trim($_POST['nums']));
     if (empty($sku)) {
         self::$errCode = 401;
         self::$errMsg = "sku不能为空";
         return false;
     }
     if (empty($oldposition)) {
         self::$errCode = 402;
         self::$errMsg = "旧仓位号不能为空";
         return false;
     }
     if (empty($newposition)) {
         self::$errCode = 403;
         self::$errMsg = "新仓位号不能为空";
         return false;
     }
     if ($oldposition == $newposition) {
         self::$errCode = 404;
         self::$errMsg = "新旧仓位号不能相同";
         return false;
     }
     $where = " where sku = '{$sku}'";
     $skuinfo = whShelfModel::selectSku($where);
     if (empty($skuinfo)) {
         self::$errCode = 404;
         self::$errMsg = "无该料号信息";
         return false;
     } else {
         $skuId = $skuinfo['id'];
     }
     $old_positon_info = OmAvailableModel::getTNameList("wh_position_distribution", "id", "where pName='{$oldposition}' and storeId in(1,2)");
     if (empty($old_positon_info)) {
         self::$errCode = 405;
         self::$errMsg = "无旧仓位号信息";
         return false;
     } else {
         $old_location = $old_positon_info[0]['id'];
     }
     $new_positon_info = OmAvailableModel::getTNameList("wh_position_distribution", "id,type", "where pName='{$newposition}' and storeId in(1,2)");
     if (empty($new_positon_info)) {
         self::$errCode = 406;
         self::$errMsg = "无新仓位号信息";
         return false;
     } else {
         $new_location = $new_positon_info[0]['id'];
     }
     $old_sku_pos_info = OmAvailableModel::getTNameList("wh_product_position_relation", "*", "where pId='{$skuId}' and positionId='{$old_location}' and storeId in(1,2) and is_delete=0");
     if (empty($old_sku_pos_info)) {
         self::$errCode = 407;
         self::$errMsg = "无sku对应的旧仓位号信息";
         return false;
     }
     $new_sku_pos_info = OmAvailableModel::getTNameList("wh_product_position_relation", "*", "where pId='{$skuId}' and positionId='{$new_location}' and storeId in(1,2) and is_delete=0");
     if ($nums > $old_sku_pos_info[0]['nums'] || empty($nums)) {
         $change_nums = $old_sku_pos_info[0]['nums'];
     } else {
         $change_nums = $nums;
     }
     OmAvailableModel::begin();
     if (!empty($new_sku_pos_info)) {
         if (empty($nums)) {
             $tname_old = "wh_product_position_relation";
             $set_old = "set nums=0,is_delete=1";
             $where_old = "where id={$old_sku_pos_info[0]['id']}";
             $update_old = OmAvailableModel::updateTNameRow($tname_old, $set_old, $where_old);
             if (!$update_old) {
                 self::$errCode = 408;
                 self::$errMsg = "更新旧仓位库存失败!";
                 TransactionBaseModel::rollback();
                 return false;
             }
         } else {
             $tname_old = "wh_product_position_relation";
             $set_old = "set nums=nums-{$change_nums}";
             $where_old = "where id={$old_sku_pos_info[0]['id']}";
             $update_old = OmAvailableModel::updateTNameRow($tname_old, $set_old, $where_old);
             if (!$update_old) {
                 self::$errCode = 409;
                 self::$errMsg = "更新旧仓位库存失败!";
                 TransactionBaseModel::rollback();
                 return false;
             }
         }
         $tname_new = "wh_product_position_relation";
         $set_new = "set nums=nums+{$change_nums}";
         $where_new = "where id={$new_sku_pos_info[0]['id']}";
         $update_new = OmAvailableModel::updateTNameRow($tname_new, $set_new, $where_new);
         if (!$update_new) {
             self::$errCode = 410;
             self::$errMsg = "更新新仓位库存失败!";
             TransactionBaseModel::rollback();
             return false;
         }
     } else {
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:shiftLibrary.action.php

示例13: view_updateInputOn

 public function view_updateInputOn()
 {
     $id = $_GET['id'];
     $inputName = $_GET['inputName'] ? post_check(trim($_GET['inputName'])) : '';
     $textStatus = $_GET['textStatus'] ? post_check(trim($_GET['textStatus'])) : '';
     $pid = $_GET['pid'] ? post_check(trim($_GET['pid'])) : '';
     if (intval($id) == 0) {
         $status = "属性Id错误";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     if (intval($textStatus) <= 0) {
         $status = "文本方式有误";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     if (empty($inputName)) {
         $tName = 'pc_archive_spu_input_value_relation';
         $where = "WHERE inputId={$id}";
         $countIN = OmAvailableModel::getTNameCount($tName, $where);
         if ($countIN) {
             $status = "该属性已经绑定了SPU,不能删除";
             header("Location:index.php?mod=property&act=getInputList&status={$status}");
             exit;
         }
         $tName = 'pc_archive_input';
         $where = "WHERE id={$id}";
         OmAvailableModel::deleteTNameRow($tName, $where);
         $status = "删除成功";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     if (empty($pid)) {
         $status = "类型不能为空";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     $tName = 'pc_archive_input';
     $select = '*';
     $where = "WHERE id='{$id}'";
     $inputList = OmAvailableModel::getTNameList($tName, $select, $where);
     if (empty($inputList)) {
         $status = "不存在该属性记录";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     $categoryName = getAllCateNameByPath($pid);
     $pathImplodeStr = getAllPathBypid($pid);
     $pathImplodeStr = getAllPathBypid($pid);
     $i = strrpos($pathImplodeStr, ',');
     if ($i !== false) {
         $pathImplodeStr = substr($pathImplodeStr, 0, $i);
     }
     $where = "WHERE inputName='{$inputName}' and categoryPath IN ({$pathImplodeStr}) and id<>{$id}";
     $count = OmAvailableModel::getTNameCount($tName, $where);
     if ($count) {
         $status = "{$categoryName} 或其父类下已经存在 {$inputName} 属性";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     $set = "SET inputName='{$inputName}',categoryPath='{$pid}',textStatus='{$textStatus}'";
     $where = "WHERE id='{$id}'";
     $affectRow = OmAvailableModel::updateTNameRow($tName, $set, $where);
     if (!$affectRow) {
         $status = "无数据修改";
         header("Location:index.php?mod=property&act=getInputList&status={$status}");
         exit;
     }
     $categoryName1 = getAllCateNameByPath($inputList[0]['categoryPath']);
     $categoryName2 = getAllCateNameByPath($pid);
     $status = "{$categoryName1} 下 {$inputList[0]['inputName']} 修改为 {$categoryName2} 下 {$inputName} 成功";
     header("Location:index.php?mod=property&act=getInputList&status={$status}");
 }
开发者ID:ohjack,项目名称:newErp,代码行数:73,代码来源:property.view.php

示例14: error_reporting

<?php

error_reporting(E_ALL);
header("Content-type: text/html; charset=utf-8");
date_default_timezone_set('Asia/Shanghai');
require "/data/web/qc.valsun.cn/framework.php";
Core::getInstance();
$now = time();
$weekago = $now - 7 * 24 * 3600;
$where = " where printTime < {$weekago}  and (getUserId is null OR getUserId = 0) AND is_delete=0";
$records = OmAvailableModel::getTNameList("qc_sample_info", "*", $where);
if ($records) {
    echo date('Y-m-d H:i:s', $now) . "共有" . count($records) . "条记录需要删除!\n";
    $info = OmAvailableModel::updateTNameRow("qc_sample_info", "set is_delete=1", $where);
    if ($info) {
        echo "删除成功!\n";
    } else {
        echo "删除失败!\n";
    }
} else {
    echo date('Y-m-d H:i:s', $now) . "没有超过一周的无用记录!\n";
}
开发者ID:ohjack,项目名称:newErp,代码行数:22,代码来源:del_record_before_week.php

示例15: act_delProductsCategoryAppoint

 function act_delProductsCategoryAppoint()
 {
     $id = intval($_POST['id']);
     if ($id <= 0) {
         self::$errCode = '101';
         self::$errMsg = '无效记录,删除失败';
         return false;
     }
     $tName = 'pc_products_large_category_appoint';
     $where = "WHERE id={$id}";
     $set = "SET is_delete=1";
     OmAvailableModel::updateTNameRow($tName, $set, $where);
     self::$errCode = '200';
     self::$errMsg = '删除成功';
     return true;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:16,代码来源:products.action.php


注:本文中的OmAvailableModel::updateTNameRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。