本文整理汇总了PHP中OmAvailableModel::addTNameRow2arr方法的典型用法代码示例。如果您正苦于以下问题:PHP OmAvailableModel::addTNameRow2arr方法的具体用法?PHP OmAvailableModel::addTNameRow2arr怎么用?PHP OmAvailableModel::addTNameRow2arr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OmAvailableModel
的用法示例。
在下文中一共展示了OmAvailableModel::addTNameRow2arr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_getProducts2pc
function act_getProducts2pc($select, $where)
{
$listArr = UserCacheModel::getOpenSysApi('pc.getEbayProducts2PcProducts', array('all' => 'all'), 'gw88');
if ($listArr) {
foreach ($listArr as $value) {
$tName = 'pc_products';
$where = "WHERE is_delete=0 and productsStatus=1 and sku='{$value['sku']}'";
$skuCount = OmAvailableModel::getTNameCount($tName, $where);
if (!$skuCount) {
$pc_pro = array();
$pc_pro['id'] = $value['id'];
if (!empty($value['sku'])) {
$tmpArr = explode('_', $value['sku']);
$pc_pro['spu'] = $tmpArr[0];
}
$pc_pro['sku'] = $value['sku'];
$pc_pro['productsStatus'] = 1;
$pc_pro['productsComfirmerId'] = getPersonIdByName($value['comfirmuser']);
$pc_pro['productsComfirmTime'] = $value['comfirmtime'];
OmAvailableModel::addTNameRow2arr($tName, $pc_pro);
}
}
self::$errCode = 200;
self::$errMsg = 'success';
return true;
} else {
self::$errCode = 404;
self::$errMsg = 'error';
return false;
}
}
示例2: foreach
$tName = 'pc_goods_combine';
$select = 'combineSpu,combineUserId,addTime';
$where = "WHERE is_delete=0 limit {$start},{$per}";
$combineSpuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($combineSpuList as $value) {
$combineSpu = $value['combineSpu'];
$combineUserId = $value['combineUserId'];
$addTime = $value['addTime'];
if (empty($combineSpu)) {
continue;
}
$tName = 'pc_auto_create_spu';
$where = "WHERE spu='{$combineSpu}'";
$count1 = OmAvailableModel::getTNameCount($tName, $where);
if (!$count1) {
$dataAuto = array();
$dataAuto['spu'] = $combineSpu;
$dataAuto['purchaseId'] = $combineUserId;
$dataAuto['createdTime'] = $addTime;
$dataAuto['status'] = 2;
$dataAuto['isSingSpu'] = 2;
if (strpos($combineSpu, 'CB') === 0) {
$dataAuto['prefix'] = 'CB';
}
OmAvailableModel::addTNameRow2arr($tName, $dataAuto);
echo "{$combineSpu} insert autoCreateSpu success\n";
} else {
echo "{$combineSpu} has exist autoCreateSpu\n";
}
}
}
示例3: session_start
session_start();
header("Content-type:text/html;charset=utf-8");
date_default_timezone_set("Asia/Shanghai");
session_cache_expire(30);
//session有效时间为30分钟
$tName = 'purchase_sku_conversion';
$select = '*';
$where = "WHERE 1=1";
$purchaseSkuConvertionList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($purchaseSkuConvertionList)) {
$tName = 'pc_sku_conversion';
$where = "WHERE 1=1";
OmAvailableModel::deleteTNameRow($tName, $where);
}
foreach ($purchaseSkuConvertionList as $value) {
$id = $value['id'];
$old_sku = $value['old_sku'];
$new_sku = $value['new_sku'];
$user = $value['user'];
$createdtime = $value['createdtime'];
$modifiedtime = $value['modifiedtime'];
$dataConvertion = array();
$dataConvertion['id'] = $id;
$dataConvertion['old_sku'] = $old_sku;
$dataConvertion['new_sku'] = $new_sku;
$dataConvertion['addUserId'] = getPersonIdByName($user);
$dataConvertion['createdTime'] = strtotime($createdtime);
$dataConvertion['modifiedUserId'] = getPersonIdByName($user);
$dataConvertion['modifiedTime'] = strtotime($modifiedtime);
OmAvailableModel::addTNameRow2arr($tName, $dataConvertion);
}
示例4: view_addOrUpdateSpeicailSpuOn
//.........这里部分代码省略.........
if (move_uploaded_file($_FILES['upfile']['tmp_name'], 'upload/' . $uploadfile)) {
echo "<font color=BLUE>文件上传成功!</font><br>";
} else {
echo "<font color=red> 文件上传失败!</font>";
exit;
}
$fileName = 'upload/' . $uploadfile;
$filePath = $fileName;
$PHPExcel = new PHPExcel();
$PHPReader = new PHPExcel_Reader_Excel2007();
if (!$PHPReader->canRead($filePath)) {
$PHPReader = new PHPExcel_Reader_Excel5();
if (!$PHPReader->canRead($filePath)) {
echo 'no Excel';
return;
}
}
$PHPExcel = $PHPReader->load($filePath);
$currentSheet = $PHPExcel->getSheet(0);
$highestRow = $currentSheet->getHighestRow();
//表格中的最大行数
echo "表格总行数为 {$highestRow} <br />";
if ($highestRow > 30000) {
echo "表格不能超过30000行,请重新整理表格导入,谢谢!";
exit;
}
$status = '';
$flag = true;
//标识检测结果
$tName = 'pc_special_property';
$select = 'id,propertyName';
$where = "WHERE isOn=1";
$pspList = OmAvailableModel::getTNameList($tName, $select, $where);
$IPArr = array();
foreach ($pspList as $value) {
$IPArr[$value['id']] = $value['propertyName'];
}
if (empty($IPArr)) {
echo "启用的特殊属性记录为空,退出";
exit;
}
for ($i = 2; $i <= $highestRow; $i++) {
//先检查导入表格的正确性
$spu = trim($currentSheet->getCell('A' . $i)->getValue());
//spu
$spu = preg_replace("/(\\s|\\ \\;| | )/", "", $spu);
$spu = strpos($spu, '_') === false ? str_pad($spu, 3, '0', STR_PAD_LEFT) : $spu;
$specailPropertyName = trim($currentSheet->getCell('B' . $i)->getValue());
//$specailPropertyName = preg_replace("/(\s|\ \;| |\xc2\xa0)/","",$specailPropertyName);
if (empty($spu)) {
$status .= "第 {$i} 行,SPU为空 <br/>";
$flag = false;
continue;
}
$tName = 'pc_auto_create_spu';
$where = "WHERE is_delete=0 AND isSingSpu=1 AND spu='{$spu}'";
if (!OmAvailableModel::getTNameCount($tName, $where)) {
$status .= "第 {$i} 行,SPU不存在 <br/>";
$flag = false;
continue;
}
$propertyId = intval(array_search($specailPropertyName, $IPArr));
if ($propertyId <= 0) {
$status .= "第 {$i} 行,找不到 {$specailPropertyName} 这个特殊属性记录 <br/>";
$flag = false;
continue;
}
}
if (!$flag) {
//验证不通过
echo "<font color=red>{$status}</font>";
exit;
} else {
$status = '';
for ($i = 2; $i <= $highestRow; $i++) {
//先检查导入表格的正确性
$spu = trim($currentSheet->getCell('A' . $i)->getValue());
//spu
$spu = preg_replace("/(\\s|\\ \\;| | )/", "", $spu);
$spu = strpos($spu, '_') === false ? str_pad($spu, 3, '0', STR_PAD_LEFT) : $spu;
$specailPropertyName = trim($currentSheet->getCell('B' . $i)->getValue());
//spu
$propertyId = intval(array_search($specailPropertyName, $IPArr));
$tName = 'pc_special_property_spu';
$where = "WHERE spu='{$spu}' AND propertyId={$propertyId}";
if (OmAvailableModel::getTNameCount($tName, $where)) {
$status .= "第 {$i} 行,{$spu} 已经存在 {$specailPropertyName} 这个特殊属性<br/>";
} else {
$dataArr = array();
$dataArr['spu'] = $spu;
$dataArr['propertyId'] = $propertyId;
OmAvailableModel::addTNameRow2arr($tName, $dataArr);
$status .= "第 {$i} 行,{$spu} 添加至 {$specailPropertyName} 成功 <br/>";
}
}
echo "<font color=green>{$status}</font>";
exit;
}
}
}
示例5: view_addAppointPerson
public function view_addAppointPerson()
{
$searchDepId = $_GET['searchDepId'] ? post_check(trim($_GET['searchDepId'])) : 0;
$searchUserId = $_GET['searchUserId'] ? post_check(trim($_GET['searchUserId'])) : 0;
$addDepId = $_GET['addDepId'] ? post_check(trim($_GET['addDepId'])) : 0;
$addUserId = $_GET['addUserId'] ? post_check(trim($_GET['addUserId'])) : 0;
$addDepId = intval($addDepId);
$addUserId = intval($addUserId);
$status = '';
if ($addDepId <= 0 || $addUserId <= 0) {
$status = "部门或指派工程师为空,添加失败";
} else {
$addDepName = getDepNameByDepId($addDepId);
$addUserName = getPersonNameById($addUserId);
if (empty($addDepName) || empty($addUserName)) {
$status = "部门或指派工程师不存在,添加失败";
} else {
$tName = 'pc_products_appoint_person';
$where = "WHERE is_delete=0 AND depId='{$addDepId}' AND appointPersonId='{$addUserId}'";
$isExistDU = OmAvailableModel::getTNameCount($tName, $where);
if ($isExistDU) {
$status = "记录已经存在,添加失败";
} else {
$dataArr = array();
$dataArr['depId'] = $addDepId;
$dataArr['appointPersonId'] = $addUserId;
$dataArr['addUserId'] = $_SESSION['userId'];
$dataArr['addTime'] = time();
OmAvailableModel::addTNameRow2arr($tName, $dataArr);
$status = "部门:{$addDepName} 指派工程师:{$addUserName} 添加成功";
}
}
}
header("Location:index.php?mod=products&act=getAppointPersonList&status={$status}&addDepId={$addDepId}&addUserId={$addUserId}&searchDepId={$searchDepId}&searchUserId={$searchUserId}");
}
示例6: array
echo "{$spu} spuArchive update category and purchaseId success! {$value['goods_category']} {$pcGoodsArr['purchaseId']} \n";
//continue;
}
$dataSpuArchive = array();
$dataSpuArchive['spu'] = $spu;
$dataSpuArchive['categoryPath'] = $value['goods_category'];
$dataSpuArchive['spuName'] = $value['goods_name'];
$dataSpuArchive['spuPurchasePrice'] = $value['goods_cost'];
$dataSpuArchive['spuLowestPrice'] = $value['goods_cost'];
$dataSpuArchive['spuCalWeight'] = $value['goods_weight'];
$dataSpuArchive['isPacking'] = $value['ispacking'] == 0 ? 1 : 2;
$dataSpuArchive['spuNote'] = $value['goods_note'];
$dataSpuArchive['spuSort'] = $value['mainsku'];
$dataSpuArchive['purchaseId'] = $purchaseId;
$dataSpuArchive['spuCreatedTime'] = $now;
$dataSpuArchive['spuStatus'] = $value['isuse'] == 1 ? 2 : 1;
//上、下线状态
$dataSpuArchive['auditStatus'] = 2;
$dataSpuArchive['referMonthSales'] = 100;
$dataSpuArchive['lowestUrl'] = 'taobao.com';
$dataSpuArchive['bidUrl'] = 'taobao.com';
if (!$countSpuArchive) {
OmAvailableModel::addTNameRow2arr($tName, $dataSpuArchive);
echo "{$spu} spuArchive insert success\n";
}
}
//}else{
// echo "{$pcGoodsArr['sku']} insert fail!\n";
// }
}
}
示例7: act_confirmReceivingByMFG
function act_confirmReceivingByMFG()
{
$ioStoreId = !empty($_POST['ioStoreId']) ? $_POST['ioStoreId'] : 0;
$comfirmUserId = $_SESSION['userId'];
$now = time();
if (intval($ioStoreId) <= 0) {
self::$errCode = '101';
self::$errMsg = "id有误";
return false;
}
if (intval($comfirmUserId) <= 0) {
self::$errCode = '102';
self::$errMsg = "登陆超时,请重试";
return false;
}
$tName = 'pc_products_iostore';
$select = '*';
$where = "WHERE is_delete=0 AND isAudit=2 AND id='{$ioStoreId}'";
$ioStoreList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($ioStoreList)) {
self::$errCode = '103';
self::$errMsg = "该单据不存在或者未审核通过";
return false;
}
try {
BaseModel::begin();
//标记表头已经确认
$dataIoStore = array();
$dataIoStore['isComfirm'] = 2;
//标记单据已经确认
$dataIoStore['comfirmUserId'] = $comfirmUserId;
$dataIoStore['comfirmTime'] = $now;
OmAvailableModel::updateTNameRow2arr($tName, $dataIoStore, $where);
//标记表体确认
$tName = 'pc_products_iostore_detail';
$dataIoStoreDetail = array();
$dataIoStoreDetail['isComfirm'] = 2;
$where = "WHERE iostoreId='{$ioStoreId}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataIoStoreDetail, $where);
//如果是新品领料单,则产品部确认后,该单据下的sku才进入产品制作表
if ($ioStoreList[0]['iostoreTypeId'] == 1 && $ioStoreList[0]['useTypeId'] == 1) {
$select = 'sku';
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($skuList as $value) {
$sku = $value['sku'];
$tName = 'pc_products';
$dataProducts = array();
$dataProducts['sku'] = $sku;
OmAvailableModel::addTNameRow2arr($tName, $dataProducts);
//将detail中的sku加入到产品制作表中
}
}
BaseModel::commit();
BaseModel::autoCommit();
self::$errCode = '200';
self::$errMsg = "确认收货成功";
return true;
} catch (Exception $e) {
BaseModel::rollback();
BaseModel::autoCommit();
self::$errCode = '404';
self::$errMsg = $e->getMessage();
return false;
}
}
示例8: view_addCombineOn
//.........这里部分代码省略.........
alert("' . $status . '");
</script>';
exit;
}
try {
$ebayGoodsArr = array();
//同步数据数组
BaseModel::begin();
for ($index = 0; $index <= $amount; $index++) {
$combineSku = $_POST['combineSku' . $index] ? post_check(trim($_POST['combineSku' . $index])) : '';
$combineSku = $combineSpu . $combineSku;
if ($index > 0 && $combineSku == $combineSpu) {
//只可能index=0时候,$combineSku==$combineSpu,其他表示无效
continue;
}
$combineLength = $_POST['combineLength' . $index] ? post_check(trim($_POST['combineLength' . $index])) : '';
$combineWidth = $_POST['combineWidth' . $index] ? post_check(trim($_POST['combineWidth' . $index])) : '';
$combineHeight = $_POST['combineHeight' . $index] ? post_check(trim($_POST['combineHeight' . $index])) : '';
$combineNote = $_POST['combineNote' . $index] ? trim($_POST['combineNote' . $index]) : '';
$skuArr = $_POST['sku' . $index];
$countArr = $_POST['count' . $index];
$dataCom = array();
$dataCom['combineSpu'] = $combineSpu;
$dataCom['combineSku'] = $combineSku;
$dataCom['combineCost'] = $combineCost;
$dataCom['combineWeight'] = $combineWeight;
$dataCom['combineLength'] = $combineLength;
$dataCom['combineWidth'] = $combineWidth;
$dataCom['combineHeight'] = $combineHeight;
$dataCom['combineNote'] = $combineNote;
$dataCom['combineUserId'] = $_SESSION['userId'];
$dataCom['addTime'] = time();
$tName = 'pc_goods_combine';
$insertIdCom = OmAvailableModel::addTNameRow2arr($tName, $dataCom);
if (!$insertIdCom) {
throw new Exception('add combine error');
}
$dataRelation = array();
$dataRelationMem = array();
for ($i = 0; $i < count($skuArr); $i++) {
if (!empty($skuArr[$i]) && !empty($countArr[$i])) {
$dataRelation[] = array('combineSku' => $combineSku, 'sku' => $skuArr[$i], 'count' => $countArr[$i]);
$dataRelationMem[] = array('sku' => $skuArr[$i], 'count' => $countArr[$i]);
}
}
if (!empty($dataRelation)) {
$tName = 'pc_sku_combine_relation';
$where = "WHERE combineSku='{$combineSku}'";
$dataRelationCount = OmAvailableModel::getTNameCount($tName, $where);
if ($dataRelationCount) {
OmAvailableModel::deleteTNameRow($tName, $where);
}
foreach ($dataRelation as $value) {
if (!empty($value['combineSku']) && !empty($value['sku']) && !empty($value['count'])) {
$insertId = OmAvailableModel::addTNameRow2arr($tName, $value);
}
}
}
if ($autoSpuList[0]['status'] != 2) {
$tName = 'pc_auto_create_spu';
$set = "SET status=2";
$where = "WHERE spu='{$combineSpu}'";
$affectRow = OmAvailableModel::updateTNameRow($tName, $set, $where);
}
//将新添加的sku添加到mem中
$key = 'pc_goods_combine_' . $combineSku;
示例9: act_addPECountOn
function act_addPECountOn()
{
$PEId = intval($_POST['PEId']);
$count = intval($_POST['count']);
if ($PEId <= 0) {
$status = "无效记录";
echo '<script language="javascript">
alert("' . $status . '");
window.history.back();
</script>';
exit;
}
if ($count <= 0) {
$status = "数量必须为正整数";
echo '<script language="javascript">
alert("' . $status . '");
window.history.back();
</script>';
exit;
}
if (intval($_SESSION['userId']) <= 0) {
$status = "登陆超时";
echo '<script language="javascript">
alert("' . $status . '");
window.history.back();
</script>';
exit;
}
$tName = 'pc_products_pe_count';
$where = "WHERE is_delete=0 AND PEId='{$PEId}'";
$isExsit = OmAvailableModel::getTNameCount($tName, $where);
if ($isExsit) {
$status = "已经存在该产品工程师的指派数量记录";
echo '<script language="javascript">
alert("' . $status . '");
window.history.back();
</script>';
exit;
}
$dataArr = array();
$dataArr['PEId'] = $PEId;
$dataArr['count'] = $count;
$dataArr['addUserId'] = $_SESSION['userId'];
$dataArr['addTime'] = time();
$tName = 'pc_products_pe_count';
OmAvailableModel::addTNameRow2arr($tName, $dataArr);
$status = "添加成功";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
header("Location:index.php?mod=products&act=getProductsPECountList&status={$status}");
exit;
}
示例10: act_batchAddSpecialTMSpuOn
public function act_batchAddSpecialTMSpuOn()
{
$stmnId = $_POST['stmnId'];
$spuArr = $_POST['spuArr'];
if (intval($stmnId) <= 0) {
self::$errCode = '101';
self::$errMsg = "异常,错误";
return false;
}
if (!is_array($spuArr) || empty($spuArr)) {
self::$errCode = '102';
self::$errMsg = "SPU信息为空";
return false;
}
$spuArr = array_filter($spuArr);
//print_r($spuArr);exit;
$returnArr = array();
$spanStatus = '';
$insertSpuArr = array();
foreach ($spuArr as $spu) {
if (preg_match("/^[A-Z0-9]+\$/", $spu)) {
$tName = 'pc_special_transport_manager_spu';
$where = "WHERE spu='{$spu}'";
$pstmnSpuIsExist = OmAvailableModel::getTNameCount($tName, $where);
if (!$pstmnSpuIsExist) {
$tName = 'pc_goods';
$where = "WHERE is_delete=0 AND spu='{$spu}'";
$spuIsExist = OmAvailableModel::getTNameCount($tName, $where);
if ($spuIsExist) {
$tName = 'pc_special_transport_manager_spu';
$dataTmpArr = array();
$dataTmpArr['stmnId'] = $stmnId;
$dataTmpArr['spu'] = $spu;
$insertId = OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
$insertSpuArr[$insertId] = $spu;
$spanStatus .= "<font color='green'>{$spu} 添加成功</font><br/>";
} else {
$spanStatus .= "<font color='red'>{$spu} 在产品信息中不存在</font><br/>";
}
} else {
$spanStatus .= "<font color='red'>{$spu} 已经存在于特殊料号-运输方式管理中</font><br/>";
}
} else {
$spanStatus .= "<font color='red'>{$spu} 格式有误</font><br/>";
}
}
$returnArr['spanStatus'] = $spanStatus;
$returnArr['insertSpuArr'] = $insertSpuArr;
self::$errCode = '200';
self::$errMsg = "操作成功";
return $returnArr;
}
示例11: act_addProductsCategoryAppoint
function act_addProductsCategoryAppoint()
{
$largeCategoryId = intval($_POST['largeCategoryId']);
$appointPEId = intval($_POST['appointPEId']);
$addUserId = $_SESSION['userId'];
if ($largeCategoryId <= 0 || $appointPEId <= 0 || $addUserId <= 0) {
self::$errCode = '101';
self::$errMsg = '必填项为空或登录超时,请检查';
return false;
}
$tName = 'pc_products_large_category_appoint';
$where = "WHERE is_delete=0 AND appointPEId={$appointPEId} AND largeCategoryId={$largeCategoryId}";
if (OmAvailableModel::getTNameCount($tName, $where)) {
self::$errCode = '102';
self::$errMsg = '已经存在该记录';
return false;
}
$dataArr = array();
$dataArr['largeCategoryId'] = $largeCategoryId;
$dataArr['appointPEId'] = $appointPEId;
$dataArr['addUserId'] = $addUserId;
$dataArr['addTime'] = time();
OmAvailableModel::addTNameRow2arr($tName, $dataArr);
self::$errCode = '200';
self::$errMsg = '添加成功';
return true;
}
示例12: view_updateSpuPersonOn
public function view_updateSpuPersonOn()
{
$spu = $_POST['spu'] ? post_check(trim($_POST['spu'])) : '';
$isSingSpu = $_POST['isSingSpu'] ? post_check(trim($_POST['isSingSpu'])) : 0;
$ebaySalerId = $_POST['ebaySalerId'] ? post_check(trim($_POST['ebaySalerId'])) : 0;
$aliexpressSalerId = $_POST['aliexpressSalerId'] ? post_check(trim($_POST['aliexpressSalerId'])) : 0;
$amazonSalerId = $_POST['amazonSalerId'] ? post_check(trim($_POST['amazonSalerId'])) : 0;
$overseaSalerId = $_POST['overseaSalerId'] ? post_check(trim($_POST['overseaSalerId'])) : 0;
$webMakerId = $_POST['webMakerId'] ? post_check(trim($_POST['webMakerId'])) : 0;
if ($isSingSpu != 1 && $isSingSpu != 2) {
$status = "基础数据 单/虚拟料号出错!";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (intval($_SESSION['userId']) <= 0) {
$status = "登陆超时,请重新登陆";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (intval($ebaySalerId) <= 0 && intval($aliexpressSalerId) <= 0 && intval($amazonSalerId) <= 0 && !isAccessAll('autoCreateSpu', 'isCanUpdateWebMakerPower')) {
$status = "ebay/aliexpress/amazon 平台中至少要存在一个销售人员记录才能提交";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
try {
BaseModel::begin();
$status = '';
if ($isSingSpu == 1) {
$tName = 'pc_spu_saler_single';
} else {
$tName = 'pc_spu_saler_combine';
}
$select = 'isAgree,salerId';
if (!empty($ebaySalerId)) {
$where = "WHERE is_delete=0 AND spu='{$spu}' AND platformId=1";
//ebay平台
$ebaySpuSalerList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($ebaySpuSalerList)) {
//更新时如果人员改动会更新是否接手状态,但是不会更新是否被销售同意/拒绝状态
if ($ebaySpuSalerList[0]['salerId'] != $ebaySalerId) {
$dataEbayArr = array();
$dataEbayArr['salerId'] = $ebaySalerId;
$dataEbayArr['isAgree'] = 1;
//add by zqt 20140421,如果换人了的话,则变为待定状态
$dataEbayArr['addTime'] = time();
OmAvailableModel::updateTNameRow2arr($tName, $dataEbayArr, $where);
}
} else {
//插入新数据时,则默认销售同意/拒绝状态为待定
$dataEbayArr = array();
$dataEbayArr['spu'] = $spu;
$dataEbayArr['salerId'] = $ebaySalerId;
$dataEbayArr['platformId'] = 1;
$dataEbayArr['addTime'] = time();
$dataEbayArr['isAgree'] = 1;
OmAvailableModel::addTNameRow2arr($tName, $dataEbayArr);
}
}
if (!empty($aliexpressSalerId)) {
$where = "WHERE is_delete=0 AND spu='{$spu}' AND platformId=2";
//ali平台
$ebaySpuSalerList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($ebaySpuSalerList)) {
//更新时如果人员改动会更新是否接手状态,但是不会更新是否被销售同意/拒绝状态
if ($ebaySpuSalerList[0]['salerId'] != $aliexpressSalerId) {
$dataEbayArr = array();
$dataEbayArr['salerId'] = $aliexpressSalerId;
$dataEbayArr['isAgree'] = 1;
//add by zqt 20140421,如果换人了的话,则变为待定状态
$dataEbayArr['addTime'] = time();
OmAvailableModel::updateTNameRow2arr($tName, $dataEbayArr, $where);
}
} else {
//插入新数据时,则默认销售同意/拒绝状态为待定
$dataEbayArr = array();
$dataEbayArr['spu'] = $spu;
$dataEbayArr['salerId'] = $aliexpressSalerId;
$dataEbayArr['platformId'] = 2;
$dataEbayArr['addTime'] = time();
$dataEbayArr['isAgree'] = 1;
OmAvailableModel::addTNameRow2arr($tName, $dataEbayArr);
}
}
if (!empty($amazonSalerId)) {
$where = "WHERE is_delete=0 AND spu='{$spu}' AND platformId=11";
//amazon平台
$ebaySpuSalerList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($ebaySpuSalerList)) {
//更新时如果人员改动会更新是否接手状态,但是不会更新是否被销售同意/拒绝状态
if ($ebaySpuSalerList[0]['salerId'] != $amazonSalerId) {
$dataEbayArr = array();
$dataEbayArr['salerId'] = $amazonSalerId;
$dataEbayArr['isAgree'] = 1;
//add by zqt 20140421,如果换人了的话,则变为待定状态
//.........这里部分代码省略.........
示例13: addOrUpdateSalerInfo
function addOrUpdateSalerInfo($platformId, $spu, $isSingSpu, $salerId)
{
if ($isSingSpu == 1) {
//单料号
$tName = 'pc_spu_saler_single';
} else {
$tName = 'pc_spu_saler_combine';
}
$select = 'salerId';
$where = "WHERE is_delete=0 AND spu='{$spu}' AND platformId='{$platformId}'";
$oldSalerList = OmAvailableModel::getTNameList($tName, $select, $where);
$dataArr = array();
if (empty($oldSalerList)) {
//如果记录不存在,则插入数据
$dataArr['platformId'] = $platformId;
$dataArr['spu'] = $spu;
$dataArr['salerId'] = $salerId;
$dataArr['addTime'] = time();
OmAvailableModel::addTNameRow2arr($tName, $dataArr);
} else {
//有该平台及该SPU的销售人记录时
if ($oldSalerList[0]['salerId'] != $salerId) {
//如果销售人不同时,则修改
$dataArr['salerId'] = $salerId;
$dataArr['isHandsOn'] = 1;
//更改接手状态
$dataArr['addTime'] = time();
//更新添加时间
OmAvailableModel::updateTNameRow2arr($tName, $dataArr, $where);
}
}
}
示例14: act_updateSkuConversion
function act_updateSkuConversion()
{
$id = $_GET['id'] ? post_check(trim($_GET['id'])) : 0;
$id = intval($id);
$new_sku = $_GET['new_sku'] ? post_check(trim($_GET['new_sku'])) : '';
//new_sku
$modifiedUserId = intval($_SESSION['userId']);
$modifiedTime = time();
if ($modifiedUserId <= 0) {
self::$errCode = '103';
self::$errMsg = "登陆超时,请重试";
return;
}
if ($id <= 0) {
self::$errCode = '100';
self::$errMsg = "异常";
return;
}
if (empty($new_sku)) {
self::$errCode = '101';
self::$errMsg = "新料号不能为空";
return;
}
if (!preg_match("/^[A-Z0-9]+(_[A-Z0-9]+)*\$/", $new_sku)) {
self::$errCode = '100';
self::$errMsg = "新料号 {$new_sku} 格式不合法";
return;
}
if ($modifiedUserId <= 0) {
self::$errCode = '103';
self::$errMsg = "登陆超时,请重试";
return;
}
$tName = 'pc_sku_conversion';
$select = 'new_sku';
$where = "WHERE id={$id} and is_delete=0";
$skuConNewSkuList = OmAvailableModel::getTNameList($tName, $select, $where);
//在料号转换表中找到id所在记录的新料号new_sku
$skuConNewSku = $skuConNewSkuList[0]['new_sku'];
if (empty($skuConNewSku)) {
self::$errCode = '104';
self::$errMsg = "记录的新料号不存在";
return;
}
if ($skuConNewSku == $new_sku) {
self::$errCode = '111';
self::$errMsg = "修改前后料号相同,无修改";
return;
}
$tName = 'pc_goods';
$select = '*';
$where = "WHERE is_delete=0 AND sku='{$skuConNewSku}'";
$newSkuPcList = OmAvailableModel::getTNameList($tName, $select, $where);
//在产品表里找是否存在未修改前的料号
$newSkuPc = $newSkuPcList[0];
//未修改前的料号信息
if (empty($newSkuPc)) {
self::$errCode = '105';
self::$errMsg = "修改前的料号 {$skuConNewSku} 在产品列表中不存在";
return;
}
$newSkuPcSku = $newSkuPc['sku'];
//$newSkuPcArr = array_filter(explode('_',$newSkuPc));//修改前的sku按照_来截取
// $newSpuPc = $newSkuPcArr[0];//取得新料号的SPU
// $newSkuArr = array_filter(explode('_',$new_sku));//修改后的sku按照_来截取
// $newSpu = $newSkuArr[0];//取得新料号的SPU
// if($newSpuPc != $newSpu){
// self::$errCode = '107';
// self::$errMsg = "修改前后的SPU不符,请检查";
// return;
// }
try {
BaseModel::begin();
$tName = 'pc_sku_conversion';
$set = "SET new_sku='{$new_sku}',modifiedUserId='{$modifiedUserId}',modifiedTime='{$modifiedTime}'";
$where = "WHERE id={$id} and is_delete=0";
OmAvailableModel::updateTNameRow($tName, $set, $where);
//先将转换记录修改
$tName = 'pc_goods';
$set = "SET goodsStatus=101,is_delete=1";
//将未修改前的sku状态改为 料号转化,并delete
$where = "WHERE is_delete=0 and sku='{$newSkuPcSku}'";
OmAvailableModel::updateTNameRow($tName, $set, $where);
$where = "WHERE is_delete=0 and sku='{$new_sku}'";
$newSkuCount = OmAvailableModel::getTNameCount($tName, $where);
if ($newSkuCount) {
//如果新料号在产品中已经存在,则只添加转换记录
self::$errCode = '200';
self::$errMsg = "修改转换记录成功,新料号:{$new_sku} 已经存在记录";
} else {
//如果新料号在产品表中不存在,则自动添加旧料号的记录进去
unset($newSkuPc['id']);
//去掉旧记录的id
$newSkuPc['sku'] = $new_sku;
//将旧的sku换成新的sku
OmAvailableModel::addTNameRow2arr($tName, $newSkuPc);
self::$errCode = '200';
self::$errMsg = "修改转换记录成功,新料号:{$new_sku} 记录已插入成功";
}
//下面对关联单料号的组合料号进行修改
//.........这里部分代码省略.........
示例15: array
try {
BaseModel::begin();
$tName = 'pc_goods_whId_location_raletion';
$where = "WHERE sku='{$sku}' AND whId='{$whId}'";
$wlraleCount = OmAvailableModel::getTNameCount($tName, $where);
$tmpArr = array();
$tmpArr['sku'] = $sku;
$tmpArr['isHasStock'] = $isHasStock;
$tmpArr['whId'] = $whId;
$tmpArr['isHasLocation'] = $isHasLocation;
$tmpArr['location'] = $location;
$tmpArr['storageTime'] = $storageTime;
$tmpArr['updateTime'] = time();
if (!$wlraleCount) {
//如果不存在记录
OmAvailableModel::addTNameRow2arr($tName, $tmpArr);
echo "添加记录 成功 \n";
echo "‘ {$sku} ’ ‘ {$isHasStock} ’ ‘ {$whId} ’ ‘ {$isHasLocation} ’ ‘ {$location} ’ ‘ {$storageTime} ’ \n";
} else {
//存在记录
unset($tmpArr['sku'], $tmpArr['whId']);
OmAvailableModel::updateTNameRow2arr($tName, $tmpArr, $where);
echo "更新记录 成功 \n";
echo "‘ {$sku} ’ ‘ {$isHasStock} ’ ‘ {$whId} ’ ‘ {$isHasLocation} ’ ‘ {$location} ’ ‘ {$storageTime} ’ \n";
}
BaseModel::commit();
BaseModel::autoCommit();
} catch (Exception $e) {
//发生错误则进行下次循环
BaseModel::rollback();
BaseModel::autoCommit();