本文整理汇总了PHP中OmAvailableModel::insertRow方法的典型用法代码示例。如果您正苦于以下问题:PHP OmAvailableModel::insertRow方法的具体用法?PHP OmAvailableModel::insertRow怎么用?PHP OmAvailableModel::insertRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OmAvailableModel
的用法示例。
在下文中一共展示了OmAvailableModel::insertRow方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_insertRow
/**
*添加指定表记录,返回TRUE or FALSE
*/
public static function act_insertRow($tName, $set)
{
$ret = OmAvailableModel::insertRow($tName, $set);
if ($ret !== FALSE) {
return $ret;
} else {
self::$errCode = OmAvailableModel::$errCode;
self::$errMsg = OmAvailableModel::$errMsg;
return false;
}
}
示例2: array
require_once "scripts.comm.php";
$accountArr = UserCacheModel::getOpenSysApi("getaccount", array('add' => 1));
$platformArr = array("aliexpress" => 2, "cndirect" => 8, "DHgate" => 4, "dresslink" => 10, "ebay平台" => 1, "Newegg" => 15, "亚马逊" => 11, "出口通" => 3, "国内销售部" => 16, "天猫哲果" => 13, "天猫芬哲" => 12, "海外仓" => 14, "海外销售平台" => 1, "线下结算客户" => 9);
foreach ($accountArr as $account) {
$insertarr = array();
foreach ($platformArr as $key => $value) {
if ($key == $account['ebay_platform']) {
$platformId = $value;
break;
}
}
$insertarr['id'] = $account['id'];
$insertarr['account'] = $account['ebay_account'];
$insertarr['addTime'] = 0;
$insertarr['addUser'] = $account['ebay_user'];
$insertarr['platformId'] = $platformId;
$insertarr['appname'] = $account['appname'];
$insertarr['email'] = $account['mail'];
$insertarr['suffix'] = $account['account_suffix'];
$insertarr['token'] = $account['ebay_token'];
$count = OmAvailableModel::getTNameList("fb_account", "id", " where id={$account['id']}");
$sql = array2sql($insertarr);
if (!count($count) > 0) {
if (OmAvailableModel::insertRow("fb_account", " set {$sql}")) {
echo "{$account['id']} \n";
} else {
echo "失败";
}
}
unset($insertarr);
}
示例3: foreach
foreach ($v as $v0) {
$sku_price += $v0['real_price'];
$qty += $v0['qty'];
}
//$fedex_remark['ebay_ordersn'] = $order['ebay_ordersn'];
$fedex_remark['price'] = round($sku_price / $qty, 2);
$fedex_remark['amount'] = $qty;
$fedex_remark['hamcodes'] = $v[0]['hamcodes'];
if ($carrierList[$orderdata['transportId']] == 'DHL' || $carrierList[$orderdata['transportId']] == 'EMS') {
$fedex_remark['price'] = round($sku_price, 2);
}
$fedex_remark['createdTime'] = time();
$fedex_remark['omOrderId'] = $omOrderId;
$fedex_remark['creatorId'] = 253;
//$insert_fedex_sql = "INSERT INTO fedex_remark set ".array2sql($fedex_remark);
$info = OmAvailableModel::insertRow("om_express_remark", " set " . array2sql($fedex_remark));
if ($info) {
//echo "----<font color=green> {$order['recordnumber']} 导入海关记录成功!</font><br>";
} else {
//echo $insert_fedex_sql; echo "<br>";
//echo "----<font color=red>{$order['recordnumber']} 导入海关记录失败!</font><br>";
$fail_order[] = $orderdata['recordnumber'];
}
}
//echo "订单".$ebay_id."抓取成功!<br>";
//baseModel::commit();
}
if ($val['ACK'] != "Success") {
if ($val['Errors']['ShortMessage'] != "") {
echo "orderdetails ShortMessage:" . $val['Errors']['ShortMessage'] . "\n";
}
示例4: 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;
}
}
}
示例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: showPrintPartionLabel
public static function showPrintPartionLabel($shipOrderId, $carrier, $countryName)
{
self::initDB();
$result = array();
$sz_array = $sz_namebiref_array = $sz_fromaddresshtml_array = array();
$partions = CommonModel::getChannelNameByIds('all');
foreach ($partions as $partion) {
$sz_array[$partion['partitionCode']] = $partion['countries'];
$sz_namebiref_array[$partion['partitionCode']] = $partion['partitionAli'];
$sz_fromaddresshtml_array[$partion['partitionCode']] = htmlspecialchars_decode($partion['returnAddHtml']);
}
//匹配回邮地址
foreach ($sz_array as $sz_key => $sz_value) {
$sz_value_arr = explode("],[", $sz_value);
$sz_value_arr[0] = str_replace("[", "", $sz_value_arr[0]);
$sz_value_arr[count($sz_value_arr) - 1] = str_replace("]", "", $sz_value_arr[count($sz_value_arr) - 1]);
if (!empty($countryName) && in_array(trim($countryName), $sz_value_arr)) {
$result = array($sz_namebiref_array[$sz_key], $sz_fromaddresshtml_array[$sz_key]);
break;
}
}
//增加因缺少国家直接为福七区的逻辑 add by guanyongjun 2014/03/07
if (!in_array($countryName, array('Australia', 'Australla')) && empty($result)) {
$addUser = empty($_SESSION['sysUserId']) ? 0 : $_SESSION['sysUserId'];
$tName = 'wh_no_country_partion';
$set = "SET shipOrderId='{$shipOrderId}',countryName='[{$countryName}]',userId='{$addUser}',createdTime='" . time() . "'";
$affectRow = OmAvailableModel::insertRow($tName, $set);
$result = array($sz_namebiref_array[7], $sz_fromaddresshtml_array[7]);
}
return $result;
// if(strpos($carrier, '中国邮政')!==false){
// if(in_array(trim($countryName), array('Albania','Algeria','Argentina','Egypt','Ethiopia','Estonia','Anguilla','Austria','Bahrain','Panama','Belarus','Bulgaria','Benin','Belgium','Iceland','Bosnia and Herzegovina','Bolivia','Botswana','Burkina Faso','Burundi','Denmark','Togo','Dominica','Russian Federation','Ecuador','Falkland Islands(Malvinas)','Gambia','Colombia','Costa Rica','Greenland','Georgia','Guyana','Haiti','Djibouti','Guinea','Guinea','Ghana','Cambodia','Czech Republic','Zimbabwe','Cameroon','Qatar','Cote d Ivoire (Ivory Coast)','Kuwait','Kenya','Latvia','Lesotho','Laos','Lebanon','Lithuania','Liberia','Libya','Rwanda','Romania','Madagascar','Malta','Malawi','Mali','Mauritania','Mongolia','Bangladesh','Peru','Morocco','Mozambique','Namibia','Nepal','Niger','Nigeria','Palau','Portugal','Sweden','Senegal','Cyprus','Seychelles','Slovakia','Sudan','Suriname','Tanzania','Trinidad and Tobago','Tunisia','Turkey','Venezuela','Uganda','Uruguay','Western Sahara','Greece','Hungary','Syria','Jamaica','Armenia','Yemen','Iraq','Iran','India','Zambia','Zaire','Chad','Chile','Cuba,Republic of','Congo, Republic of the','Congo, Democratic Republic of the','Russia','Azerbaijan Republic','Azerbaijan','Dominica','Dominican Republic','Equatorial Guinea','Gabon Republic','Papua New Guinea'))/* || $ebay_carrierstyle == 1*/){
// return array($sz_namebiref_array[7], $sz_fromaddresshtml_array[7]);
// }else{
// $mailways = self::getOrderGoodsMailwayIds($shipOrderId);
// if(in_array(2,$mailways) || in_array(5,$mailways)){
// foreach($sz_array as $sz_key => $sz_value){
// $sz_value_arr = explode("],[",$sz_value);
// $sz_value_arr[0] = str_replace("[","",$sz_value_arr[0]);
// $sz_value_arr[count($sz_value_arr)-1] = str_replace("]","",$sz_value_arr[count($sz_value_arr)-1]);
// if(!empty($countryName) && in_array(trim($countryName),$sz_value_arr)){
// return array($sz_namebiref_array[$sz_key], $sz_fromaddresshtml_array[$sz_key]);
// break;
// }
// }
// }else if(in_array(1,$mailways)){
// return array($sz_namebiref_array[7], $sz_fromaddresshtml_array[7]);
// }
// }
// }
}
示例7: view_index
public function view_index()
{
/*$OmAccountAct = new OmAccountAct();
$ebayAccountList = $OmAccountAct->act_getEbayAccountList();
print_r($ebayAccountList);*/
//print_r($_SESSION);
$orderid = isset($_GET['orderid']) ? $_GET['orderid'] : "";
if (isset($_POST['orderid'])) {
$orderid = $_POST['orderid'];
$where = " where omOrderId ={$orderid}";
$details = OmAvailableModel::getTNameList("om_unshipped_order_detail", "*", $where);
$order = OmAvailableModel::getTNameList("om_unshipped_order", "*", "where id={$orderid}");
$accountId = $order[0]['accountId'];
$message = "";
foreach ($details as $detail) {
$sql_arr = array();
$sql_arr['omOrderId'] = $orderid;
$sql_arr['sku'] = $detail['sku'];
$sql_arr['amount'] = $detail['amount'];
$sql_arr['accountId'] = $accountId;
$app = $detail['sku'] . "*app";
$reason1 = $detail['sku'] . "*reason1";
$reason2 = $detail['sku'] . "*reason2";
$remark = $detail['sku'] . "*remark";
$sql_arr['type'] = $_POST[$app];
$sql_arr['reason1'] = $_POST[$reason1];
$sql_arr['reason2'] = $_POST[$reason2];
$sql_arr['remark'] = $_POST[$remark];
$sql_arr['userId'] = $_SESSION['sysUserId'];
$sql_arr['createdTime'] = time();
if ($sql_arr['type'] == "" && $sql_arr['reason1'] == "" && $sql_arr['reason2'] == "" && $sql_arr['remark'] == "") {
continue;
} elseif ($sql_arr['type'] != "" && ($sql_arr['reason1'] != "" || $sql_arr['reason2'] != "")) {
$set = array2sql($sql_arr);
$where = " where omOrderId={$orderid} and sku='{$detail['sku']}'";
$order_appraise = OmAvailableModel::getTNameList("om_order_detail_appraisal", "*", $where);
if ($order_appraise) {
$msg = OmAvailableModel::updateTNameRow("om_order_detail_appraisal", " set " . $set, $where);
if (!$msg) {
$message .= "<font color='red'>料号{$detail['sku']}数据保存失败!</font><br>";
} else {
$message .= "<font color='green'>料号{$detail['sku']}数据保存成功!</font><br>";
}
} else {
$msg = OmAvailableModel::insertRow("om_order_detail_appraisal", " set " . $set);
if (!$msg) {
$message .= "<font color='red'>料号{$detail['sku']}数据保存失败!</font><br>";
} else {
$message .= "<font color='green'>料号{$detail['sku']}数据保存成功!</font><br>";
}
}
} else {
$message .= "<font color='red'>请将料号{$detail['sku']}的数据填写完整!</font><br>";
}
}
$this->smarty->assign("message", $message);
}
$where = " where omOrderId ={$orderid}";
$details = OmAvailableModel::getTNameList("om_unshipped_order_detail", "*", $where);
$reasons = OmAvailableModel::getTNameList("om_order_refund_reason", "*", " where typeId=3");
$reason = array();
foreach ($reasons as $value) {
$reason[$value['id']] = $value['reason'];
}
$appraise = array();
$i = 0;
foreach ($details as $detail) {
$where = " where omOrderId={$orderid} and sku='{$detail['sku']}'";
$order_appraise = OmAvailableModel::getTNameList("om_order_detail_appraisal", "*", $where);
if ($order_appraise) {
foreach ($order_appraise as $key => $value) {
$appraise[$i]['reason1'] = $value['reason1'];
$appraise[$i]['reason2'] = $value['reason2'];
$appraise[$i]['type'] = $value['type'];
$appraise[$i]['sku'] = $detail['sku'];
$appraise[$i]['remark'] = $value['remark'];
}
} else {
$appraise[$i]['reason1'] = "";
$appraise[$i]['reason2'] = "";
$appraise[$i]['type'] = "";
$appraise[$i]['sku'] = $detail['sku'];
$appraise[$i]['remark'] = "";
}
$i++;
}
//print_r($appraise);
$this->smarty->assign("skuinfoList", $appraise);
$this->smarty->assign("reasonList", $reason);
$this->smarty->assign("orderid", $orderid);
$this->smarty->assign("ebayAccountList", $ebayAccountList);
$this->smarty->assign('toptitle', '添加B2B中差评');
$this->smarty->display("negativeFeedback.htm");
}
示例8: act_modifyOrder
//.........这里部分代码省略.........
if (isset($data['countryName'])) {
$update_userinfo['countryName'] = $data['countryName'];
}
if (isset($data['zipCode'])) {
$update_userinfo['zipCode'] = $data['zipCode'];
}
if (isset($data['landline'])) {
$update_userinfo['landline'] = $data['landline'];
}
if (isset($data['phone'])) {
$update_userinfo['phone'] = $data['phone'];
}
if (isset($data['transportId'])) {
$update_order['transportId'] = $data['transportId'];
}
if (isset($data['update_notes'])) {
$update_note = $data['update_notes'];
}
if (isset($data['note_new'])) {
$add_note = $data['note_new'];
}
if ($data['edit_tracknumber']) {
$update_tracknumber['omOrderId'] = $orderid;
$update_tracknumber['tracknumber'] = $data['edit_tracknumber'];
$update_tracknumber['addUser'] = $_SESSION['sysUserId'];
$update_tracknumber['createdTime'] = time();
//var_dump($update_tracknumber); exit;
}
BaseModel::begin();
//开始事务
if ($update_order) {
//$sql = "UPDATE om_unshipped_order set ".array2sql($update_order)." WHERE id = ".$orderid;
//$msg = commonModel::orderLog($orderid,$update_order['orderStatus'],$update_order['orderType'],$sql);
if (OrderindexModel::updateOrder('om_unshipped_order', $update_order, ' WHERE id = ' . $orderid)) {
if ($updatestatus) {
$ProductStatus = new ProductStatus();
if (!$ProductStatus->updateSkuStatusByOrderStatus(array($orderid), $batch_ostatus_val, $batch_otype_val)) {
BaseModel::rollback();
}
}
$modify_showerrorinfo = "<font color='green'>更新成功</font>";
} else {
self::$errCode = "001";
self::$errMsg = "更新订单信息失败!";
BaseModel::rollback();
return false;
}
}
if ($update_userinfo) {
//var_dump($update_userinfo);
if (OrderindexModel::updateOrder('om_unshipped_order_userInfo', $update_userinfo, ' WHERE omOrderId = ' . $orderid)) {
$modify_showerrorinfo = "<font color='green'>更新成功</font>";
} else {
self::$errCode = "002";
self::$errMsg = "更新订单用户信息失败!";
BaseModel::rollback();
return false;
}
}
if ($update_tracknumber) {
//echo $msg;
if (!OrderAddModel::insertOrderTrackRow($update_tracknumber)) {
self::$errCode = "003";
self::$errMsg = "更新订单跟踪号插入失败!";
BaseModel::rollback();
return false;
}
}
if ($update_note) {
foreach ($update_note as $key => $value) {
$notes = explode("###", $value);
$where = " where content='{$notes[0]}' and omOrderId={$orderid}";
$set = "set content='{$notes[1]}',userId={$_SESSION['sysUserId']},createdTime=" . time();
$msg = OmAvailableModel::updateTNameRow("om_order_notes", $set, $where);
if (!$msg) {
self::$errCode = "004";
self::$errMsg = "更新订单备注失败!";
BaseModel::rollback();
return false;
}
}
}
if ($add_note) {
foreach ($add_note as $key => $value) {
$set = "set omOrderId={$orderid},content='{$value}',userId={$_SESSION['sysUserId']},createdTime=" . time();
$msg = OmAvailableModel::insertRow("om_order_notes", $set);
if (!$msg) {
self::$errCode = "005";
self::$errMsg = "插入订单备注失败!";
BaseModel::rollback();
return false;
}
}
}
self::$errCode = "200";
self::$errMsg = "整个订单信息更新成功!";
BaseModel::commit();
BaseModel::autoCommit();
}
}
示例9: act_whShelf
//.........这里部分代码省略.........
/*
if($return_num>0){
$where = " where sku = '{$sku}' and tallyStatus=0";
$list = whShelfModel::selectList($where);
$purchaseId = $list[0]['purchaseId'];
$totalNums = 0;
foreach($list as $key=>$value){
$totalNums += $value['num'];
}
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) {
示例10: view_dresslinkOrderImport
//.........这里部分代码省略.........
$carrier = $rtn_data['carrier'];
$carrierId = $rtn_data['carrierId'];
$status = $rtn_data['status'];
$orderData[$id]['orderData']['id'] = $orderId;
//赋予新系统订单编号,一切数据已老系统返回的为准
if ($orderData[$id]['orderData']['calcWeight'] != $totalweight) {
$insertData['old_totalweight'] = $totalweight;
$insertData['new_totalweight'] = $orderData[$id]['orderData']['calcWeight'];
$orderData[$id]['orderData']['calcWeight'] = $totalweight;
}
if ($orderData[$id]['orderData']['pmId'] != $pmId) {
$insertData['old_pmId'] = $pmId;
$insertData['new_pmId'] = $orderData[$id]['orderData']['pmId'];
$orderData[$id]['orderData']['pmId'] = $pmId;
}
if ($orderData[$id]['orderData']['calcShipping'] != $shipfee) {
$insertData['old_shippfee'] = $shipfee;
$insertData['new_shippfee'] = $orderData[$id]['orderData']['calcShipping'];
$orderData[$id]['orderData']['calcShipping'] = $shipfee;
}
if ($orderData[$id]['orderData']['transportId'] != $carrierId) {
$insertData['old_carrierId'] = $carrierId;
$insertData['new_carrierId'] = $orderData[$id]['orderData']['transportId'];
$orderData[$id]['orderData']['transportId'] = $carrierId;
}
if (!empty($insertData)) {
$insertData['ebay_id'] = $orderId;
$insertData['addtime'] = time();
OldsystemModel::insertTempSyncRecords($insertData);
// 插入临时对比记录表
}
//缺货拦截
$orderData[$id] = AutoModel::auto_contrast_intercept($orderData[$id]);
//插入订单
$info = OrderAddModel::insertAllOrderRowNoEvent($orderData[$id]);
if ($info) {
$dresslinkinfos = $orderData[$id]['dresslinkInfo'];
$dresslinkinfos['omOrderId'] = $orderId;
if (DresslinkinfoModel::insertDresslinkinfoList($dresslinkinfos)) {
$message .= "<font color='green'>订单{$id}上传dresslinkInfo成功!</font><br>";
} else {
$message .= "<font color='red'>订单{$id}上传dresslinkInfo失败!</font><br>";
}
$message .= "<font color='green'>新系统订单{$id}添加成功!</font><br>";
} else {
$message .= "<font color='red'>新系统订单{$id}添加失败!</font><br>";
}
} else {
$message .= "<font color='red'>添加失败,原因为:{$rtn['msg']}!</font><br>";
}
if ($orderId) {
foreach ($ebay_fedex_remark[$id] as $k => $v) {
$fedex_remark = array();
$fedex_remark['description'] = trim("[No Brand]" . $k . "{$v[0]['detail']}");
if (in_array($transportationList[$order['orderData']['transportId']], array('FedEx'))) {
//$fedex_remark['description'] = "[No Brand]". $k."({$v[0]['detail']})";
$fedex_remark['type'] = 1;
} else {
if (in_array($transportationList[$order['orderData']['transportId']], array('DHL', 'EMS', 'UPS美国专线'))) {
//$fedex_remark['description'] = trim($k);
$fedex_remark['type'] = 2;
} else {
continue;
}
}
$sku_price = 0;
$qty = 0;
foreach ($v as $v0) {
$sku_price += $v0['real_price'];
$qty += $v0['qty'];
}
//$fedex_remark['ebay_ordersn'] = $order['ebay_ordersn'];
$fedex_remark['price'] = round($sku_price / $qty, 2);
$fedex_remark['amount'] = $qty;
$fedex_remark['hamcodes'] = $v[0]['hamcodes'];
if (in_array($transportationList[$order['orderData']['transportId']], array('DHL', 'EMS', 'UPS美国专线'))) {
$fedex_remark['price'] = round($sku_price, 2);
}
$fedex_remark['createdTime'] = time();
$fedex_remark['omOrderId'] = $orderId;
$fedex_remark['creatorId'] = $_SESSION['sysUserId'];
//$insert_fedex_sql = "INSERT INTO fedex_remark set ".array2sql($fedex_remark);
$info = OmAvailableModel::insertRow("om_express_remark", " set " . array2sql_bak($fedex_remark));
if ($info) {
$message .= "<font color=green> {$id} 导入海关记录成功!</font><br>";
//echo "----<font color=green> {$order['recordnumber']} 导入海关记录成功!</font><br>";
} else {
//echo $insert_fedex_sql; echo "<br>";
$message .= "<font color=green> {$id} 导入海关记录失败!</font><br>";
//echo "----<font color=red>{$order['recordnumber']} 导入海关记录失败!</font><br>";
//$fail_order[] = $order['orderData']['recordnumber'];
}
}
}
}
}
$this->smarty->assign("showerrorinfo", $message);
}
$this->smarty->display('dresslinkOrderImport.htm');
}
示例11: act_shiftLibrary
//.........这里部分代码省略.........
}
$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 {
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 = 411;
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 = 412;
self::$errMsg = "更新旧仓位库存失败!";
TransactionBaseModel::rollback();
return false;
}
}
$tname_insert = "wh_product_position_relation";
$set_insert = "set pId='{$skuId}',positionId='{$new_location}',nums='{$change_nums}',type={$new_positon_info[0]['type']}";
$relation_insert = OmAvailableModel::insertRow($tname_insert, $set_insert);
if (!$relation_insert) {
self::$errCode = 413;
self::$errMsg = "插入关系表失败!";
TransactionBaseModel::rollback();
return false;
}
/*
//更新仓位使用状态
$update_position = OmAvailableModel::updateTNameRow("wh_position_distribution","set is_enable=1","where id=$new_location");
if(!$update_position){
self::$errCode = 414;
self::$errMsg = "更新仓位使用状态失败!";
TransactionBaseModel :: rollback();
return false;
}
*/
}
//全部转移到新仓位,则将仓位同步到老ERP
if (!$nums) {
$info = CommonModel::updateSkuLocation($sku, $newposition);
//print_r($info);exit;
if ($info['res_code'] != 200) {
self::$errCode = 414;
self::$errMsg = '同步旧ERP仓位失败!';
return FALSE;
}
}
OmAvailableModel::commit();
self::$errMsg = "料号[{$sku}]移库成功!";
return true;
}
示例12: act_applyEUBTrackNumber
//.........这里部分代码省略.........
$skuInfo = $memc_obj->get_extral("sku_info_" . $sku);
$DeclaredValue = $skuInfo['goods_sbjz'] * $amount ? $skuInfo['goods_sbjz'] * $amount : 1; //申报价值
$Weight = $skuInfo['goods_weight'] * $amount ? $skuInfo['goods_weight'] * $amount : 0.01; //重量
$CustomsTitleCN = $skuInfo['goods_zysbmc'] ? $skuInfo['goods_zysbmc'] : $sku; //中文申报名称
$CustomsTitleEN = $skuInfo['goods_ywsbmc'] ? $skuInfo['goods_ywsbmc'] : $sku; //英文申报名称
$OriginCountryCode = 'CN'; //原产地简码
//echo "##".$EBayItemID."##";
/*if((!in_array($ebay_itemid.'-'.$ebay_tid, $unique_item_tid))){
$unique_item_tid[] = $ebay_itemid.'-'.$ebay_tid;
$item[$i] = array(
'CurrencyCode' => $ebay_currency,
'EBayEmail' => $ebay_usermail,
'EBayBuyerID' => $ebay_userid,
'EBayItemID' => $ebay_itemid,
'EBayItemTitle' => $ebay_itemtitle,
'EBayMessage' => $ebay_note,
'EBaySiteID' => "0",
'EBayTransactionID' => $ebay_tid,
'Note' => $ebay_noteb,
'OrderSalesRecordNumber' => $recordnumber,
'PaymentDate' => $ebay_paidtime,
'PayPalEmail' => "0",
'PayPalMessage' => $ebay_note,
'PostedQTY' => $ebay_amount,
'ReceivedAmount' => $ebay_total,
'SalesRecordNumber' => $recordnumber1,
'SoldDate' => $ebay_createdtime,
'SoldPrice' => $ebay_itemprice,
'SoldQTY' => $ebay_amount,
'SKU' =>array(
'SKUID' => $sku,
'Weight' => $weight * $ebay_amount,
'CustomsTitleCN' => $goods_zysbmc,
'CustomsTitleEN' => $goods_ywsbmc.' '.$sku,
'DeclaredValue' => $goods_sbjz*$ebay_amount,
'OriginCountryName' => "China",
'OriginCountryCode' => "CN",
)
);
}*/
$where = "WHERE omOrderId='{$omOrderId}'";
$orderarr = OrderindexModel::showSearchOrderList("om_unshipped_order", $where);
//print_r($orderarr);
$unique_item_tid = array();
foreach ($orderarr as $key => $order) {
foreach ($order['orderDetail'] as $k => $detail) {
$sku = $detail['orderDetailData']['sku'];
$amount = $detail['orderDetailData']['amount'];
//$goods = ExportsToXlsModel::getGoods($detail['orderDetailData']['sku']);
$skus = GoodsModel::get_realskuinfo($detail['orderDetailData']['sku']);
foreach ($skus as $k => $v) {
$goods = GoodsModel::getSkuList($k);
if (!in_array($detail['orderDetailExtenData']['itemId'] . '-' . $detail['orderDetailExtenData']['transId'], $unique_item_tid)) {
$unique_item_tid[] = $detail['orderDetailExtenData']['itemId'] . '-' . $detail['orderDetailExtenData']['transId'];
$Item[] = array('EBayBuyerID' => $order['orderUserInfoData']['platformUsername'], 'EBayItemID' => $detail['orderDetailExtenData']['itemId'], 'EBayEmail' => $order['orderUserInfoData']['email'], 'EBayTransactionID' => $detail['orderDetailExtenData']['transId'], 'PostedQTY' => $detail['orderDetailData']['amount'], 'EBaySiteID' => "0", 'PayPalEmail' => "0", 'EBayItemTitle' => $detail['orderDetailExtenData']['itemTitle'], 'OrderSalesRecordNumber' => $order['orderData']['recordNumber'], 'EBayMessage' => $order['orderExtenData']['feedback'], 'CurrencyCode' => $order['orderExtenData']['currency'], 'SoldDate' => date("Y-m-d", $order['orderData']['ordersTime']), 'SoldPrice' => $detail['orderDetailData']['itemPrice'], 'SoldQTY' => $detail['orderDetailData']['amount'], 'ReceivedAmount' => $order['orderData']['actualTotal'], 'PayPalMessage' => $order['orderExtenData']['feedback'], 'PaymentDate' => date("Y-m-d", $order['orderData']['paymentTime']), 'SalesRecordNumber' => $order['orderData']['recordNumber'], 'Note' => isset($order['orderNote'][0]['content']) ? $order['orderNote'][0]['content'] : "", 'SKU' => array('SKUID' => $detail['orderDetailData']['sku'], 'Weight' => $goods['goodsWeight'] * $amount * $v, 'CustomsTitleCN' => $goods['goodsName'], 'CustomsTitleEN' => $sku, 'DeclaredValue' => $detail['orderDetailData']['itemPrice'] * $amount * $v, 'OriginCountryName' => "China", 'OriginCountryCode' => "CN"));
}
}
}
}
$url_test = "http://epacketws.pushauction.net/v3/orderservice.asmx?WSDL";
$url = "http://shippingapi.ebay.cn/production/v3/orderservice.asmx?wsdl";
$soapclient = new soapclient($url);
$params = array('Version' => "3.0.0", 'APIDevUserID' => $APIDevUserID, 'APIPassword' => $APIPassword, 'APISellerUserID' => $APISellerUserID, "OrderDetail" => array("PickUpAddress" => $PickUpAddress, "ShipFromAddress" => $ShipFromAddress, "ShipToAddress" => $ShipToAddress, "ItemList" => array("Item" => $Item), "EMSPickUpType" => $shiptype, "ReturnAddress" => $ReturnAddress));
try {
//print_r($params);
$functions = $soapclient->AddAPACShippingPackage(array("AddAPACShippingPackageRequest" => $params));
//echo "dfg";
foreach ($functions as $value) {
$bb = (array) $value;
$ack = $bb['Ack'];
if ($ack == 'Success') {
$TrackCode = $bb['TrackCode'];
//这里插入记录到records表中
$tName = 'om_order_tracknumber';
$set = "SET omOrderId='{$omOrderId}',addUser='{$addUser}',tracknumber='{$TrackCode}',createdTime='" . time() . "'";
$affectRow = OmAvailableModel::insertRow($tName, $set);
if ($affectRow) {
self::$errCode = '200';
self::$errMsg = "success";
return 200;
} else {
self::$errCode = '0011';
self::$errMsg = "添加跟踪号失败";
return 11;
}
} else {
$tName = 'om_order_notes';
$set = "SET omOrderId='{$omOrderId}',content='{$bb['Message']}',userId='{$addUser}',createdTime='" . time() . "'";
$affectRow = OmAvailableModel::insertRow($tName, $set);
self::$errCode = '0012';
self::$errMsg = $bb['Message'];
return 12;
}
}
} catch (Exception $e) {
self::$errCode = '0013';
self::$errMsg = $e->getMessage();
return 0;
}
}