本文整理匯總了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;
}
}
示例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) {
示例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;
//.........這裏部分代碼省略.........
示例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;
}
}
示例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;
//.........這裏部分代碼省略.........
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
示例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);
示例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;
}
示例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 ==== ");
//.........這裏部分代碼省略.........
示例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 {
//.........這裏部分代碼省略.........
示例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}");
}
示例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";
}
示例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;
}