本文整理汇总了PHP中OmAvailableModel::updateTNameRow2arr方法的典型用法代码示例。如果您正苦于以下问题:PHP OmAvailableModel::updateTNameRow2arr方法的具体用法?PHP OmAvailableModel::updateTNameRow2arr怎么用?PHP OmAvailableModel::updateTNameRow2arr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OmAvailableModel
的用法示例。
在下文中一共展示了OmAvailableModel::updateTNameRow2arr方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_updateBatchForSalers
/**
*功能:我自己运行的接口,批量更新数据,根据需求批量更新销售是陈智兴的虚拟料号,将其销售人员改为对应真实SPU的销售人员
* */
public function act_updateBatchForSalers()
{
$tName = 'pc_spu_saler_combine';
$select = 'spu';
$where = "WHERE is_delete=0 and platformId=2 and isAgree=2 and salerId=60";
$combineSpuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($combineSpuList as $value) {
$combineSpu = $value['spu'];
$tName = 'pc_goods_combine';
$select = 'combineSku';
$where = "WHERE is_delete=0 and combineSpu='{$combineSpu}'";
$combineSkuList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($combineSkuList)) {
$tName = 'pc_sku_combine_relation';
$select = 'sku';
$where = "WHERE combineSku='{$combineSkuList[0]['combineSku']}'";
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($skuList)) {
$tName = 'pc_goods';
$select = 'spu';
$where = "WHERE is_delete=0 and sku='{$skuList[0]['sku']}'";
$spuList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($spuList)) {
$tName = 'pc_spu_saler_single';
$select = 'salerId';
$where = "WHERE is_delete=0 and platformId=2 and isAgree=2 and spu='{$spuList[0]['spu']}'";
$singleSpuSalerIdList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($singleSpuSalerIdList)) {
$salerId = $singleSpuSalerIdList[0]['salerId'];
$saler = getPersonNameById($salerId);
$tName = 'pc_spu_saler_combine';
$where = "WHERE is_delete=0 and spu='{$combineSpu}'";
$dataArr = array();
$dataArr['salerId'] = $salerId;
OmAvailableModel::updateTNameRow2arr($tName, $dataArr, $where);
echo "{$combineSpu} 的原销售是 陈智兴,真实销售是 {$saler} <br />";
} else {
echo "{$combineSpu} 的原销售是 陈智兴,真实销售为空 <br />";
}
}
}
}
}
}
示例2: view_productsBack
public function view_productsBack()
{
$sku = $_GET['sku'] ? $_GET['sku'] : '';
$id = $_GET['id'] ? $_GET['id'] : '';
$userId = $_SESSION['userId'];
$now = time();
if (intval($userId) <= 0) {
$status = "未登录";
header("Location:index.php?mod=products&act=getProductsTakeList&status={$status}&sku={$sku}");
exit;
}
if (empty($id)) {
$status = "id为空";
header("Location:index.php?mod=products&act=getProductsTakeList&status={$status}&sku={$sku}");
exit;
}
$idArr = array_filter(explode(',', $id));
foreach ($idArr as $value) {
if (intval($value) <= 0) {
$status = "含有非法id";
header("Location:index.php?mod=products&act=getProductsTakeList&status={$status}&sku={$sku}");
exit;
}
}
$newIdArr = implode(',', $idArr);
$tName = 'pc_products';
$set = "SET productsStatus=1";
$where = "WHERE id in({$newIdArr})";
OmAvailableModel::updateTNameRow($tName, $set, $where);
$takeSpuArr = array();
//同步数据到ERP
$tName = 'pc_products';
$select = 'sku';
$where = "WHERE id in({$newIdArr})";
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($skuList as $value) {
$takeInfoArr = array();
$takeInfoArr['sku'] = $value['sku'];
$tName = 'pc_goods';
$select = 'spu';
$where = "WHERE is_delete=0 AND sku='{$value['sku']}'";
$takeSpuList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($takeSpuList)) {
$takeSpuArr[] = $takeSpuList[0]['spu'];
}
$res = OmAvailableModel::newData2ErpInterfOpen('pc.erp.updateEbay_order_productForBack', $takeInfoArr, 'gw88');
}
$takeSpuArr = array_unique($takeSpuArr);
foreach ($takeSpuArr as $value) {
$tName = 'pc_spu_web_maker';
$where = "WHERE is_delete=0 AND spu='{$value}' order by id desc limit 1";
$dataArr = array();
$dataArr['isTake'] = 0;
OmAvailableModel::updateTNameRow2arr($tName, $dataArr, $where);
}
$status = "退还料号成功";
header("Location:index.php?mod=products&act=getProductsComfirmList&status={$status}&sku={$sku}");
}
示例3: view_updateIsNewBatchExcelImportOn
public function view_updateIsNewBatchExcelImportOn()
{
$useId = $_SESSION['userId'];
$personName = getPersonNameById($useId);
if (empty($personName)) {
$status = "<font color=red>系统找不到登录人信息!</font><br/>";
echo $status;
exit;
}
if (isset($_POST['submit']) && $_POST['submit'] != '') {
$uploadfile = 'updateIsNewBatchExcelImport_' . date("Y") . date("m") . date("d") . date("H") . date('i') . date('s') . '_' . $personName . ".xls";
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();
//表格中的最大行数
//var_dump($highestRow);exit;
if ($highestRow > 500) {
echo "表格不能超过500行,请重新整理表格导入,谢谢!";
exit;
}
$status = '';
$flag = true;
//标识检测结果
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;
if (empty($spu)) {
$status .= "第 {$i} 行,SPU为空 <br/>";
$flag = false;
continue;
}
$tName = 'pc_products';
$where = "WHERE is_delete=0 and productsStatus=2 and spu='{$spu}'";
$spuCount = OmAvailableModel::getTNameCount($tName, $where);
if (!$spuCount) {
$status .= "第 {$i} 行,{$spu} 不在领取料号状态 <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;
$tName = 'pc_products';
$where = "WHERE is_delete=0 and productsStatus=2 and spu='{$spu}'";
$dataArr = array();
$dataArr['productsStatus'] = 3;
$dataArr['productsCompleteTime'] = time();
OmAvailableModel::updateTNameRow2arr($tName, $dataArr, $where);
$_POST['spu'] = $spu;
$_POST['isNew'] = 0;
$goodsAct = new GoodsAct();
$goodsAct->act_updateIsNewBatch();
$status .= "第 {$i} 行,{$spu} 更新成功 <br/>";
}
echo "<font color=green>{$status}</font>";
exit;
}
}
}
示例4: view_updateCombineOn
//.........这里部分代码省略.........
if ($count != $countFlip) {
$status = "存在重复的真实料号记录";
echo '<script language="javascript">
alert("' . $status . '");
history.go(-1);
</script>';
exit;
}
$tName = 'pc_goods';
foreach ($skuArr as $value) {
if (!empty($value)) {
$where = "WHERE sku='{$value}' and is_delete=0";
$count = OmAvailableModel::getTNameCount($tName, $where);
if (!$count) {
$status = "真实料号 {$value} 不存在";
echo '<script language="javascript">
alert("' . $status . '");
history.go(-1);
</script>';
exit;
}
}
}
$dataCom = array();
$dataCom['combineSku'] = $combineSku;
$dataCom['combineLength'] = $combineLength;
$dataCom['combineWidth'] = $combineWidth;
$dataCom['combineHeight'] = $combineHeight;
$dataCom['combineNote'] = $combineNote;
try {
BaseModel::begin();
$tName = 'pc_goods_combine';
$where = "WHERE id={$id}";
$affectRow = OmAvailableModel::updateTNameRow2arr($tName, $dataCom, $where);
if ($affectRow === false) {
$status = "更新失败";
throw new Exception('update combine error');
}
$dataRelation = array();
$dataRelationMem = array();
//用来更新mem中的detail数组
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}'";
$affectRow = OmAvailableModel::deleteTNameRow($tName, $where);
if ($affectRow === false) {
throw new Exception('delete combine relation error');
}
foreach ($dataRelation as $value) {
$insertId = OmAvailableModel::addTNameRow2arr($tName, $value);
if ($insertId === false) {
throw new Exception('add combine relation error');
}
}
}
//将新添加的sku添加到mem中
$key = 'pc_goods_combine_' . $combineSku;
$dataCom['combineSpu'] = $combineSpu;
$dataCom['detail'] = $dataRelationMem;
$value = $dataCom;
示例5: 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;
}
}
示例6: act_updateSpuHsRelaById
function act_updateSpuHsRelaById()
{
$id = intval($_POST['id']);
if ($id <= 0) {
self::$errCode = '101';
self::$errMsg = '无效记录';
return false;
}
$userId = $_SESSION['userId'];
if ($id <= 0) {
self::$errCode = '103';
self::$errMsg = '登陆超时';
return false;
}
$personName = getPersonNameById($userId);
$tName = 'pc_spu_tax_hscode';
$select = 'spu';
$where = "WHERE id='{$id}'";
$psthList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($psthList)) {
self::$errCode = '102';
self::$errMsg = "无记录";
return false;
}
$dataTmpArr = array();
$dataTmpArr['customsName'] = !empty($_POST['customsName']) ? $_POST['customsName'] : '';
$dataTmpArr['materialCN'] = !empty($_POST['materialCN']) ? $_POST['materialCN'] : '';
$dataTmpArr['customsNameEN'] = !empty($_POST['customsNameEN']) ? $_POST['customsNameEN'] : '';
$dataTmpArr['materialEN'] = !empty($_POST['materialEN']) ? $_POST['materialEN'] : '';
$dataTmpArr['hsCode'] = !empty($_POST['hsCode']) ? $_POST['hsCode'] : '';
$dataTmpArr['exportRebateRate'] = !empty($_POST['exportRebateRate']) ? $_POST['exportRebateRate'] : '';
$dataTmpArr['importMFNRates'] = !empty($_POST['importMFNRates']) ? $_POST['importMFNRates'] : '';
$dataTmpArr['generalRate'] = !empty($_POST['generalRate']) ? $_POST['generalRate'] : '';
$dataTmpArr['RegulatoryConditions'] = !empty($_POST['RegulatoryConditions']) ? $_POST['RegulatoryConditions'] : '';
$dataTmpArr = array_filter($dataTmpArr);
$jsonData = json_encode($dataTmpArr);
if (!empty($dataTmpArr)) {
OmAvailableModel::updateTNameRow2arr($tName, $dataTmpArr, $where);
error_log(date('Y-m-d_H:i') . "——{$psthList[0]['spu']} 更新成功 BY {$personName}, data: {$jsonData} \r\n", 3, WEB_PATH . "log/spuHscodeTax.txt");
self::$errCode = '200';
self::$errMsg = "更新成功";
return true;
} else {
self::$errCode = '200';
self::$errMsg = "无数据提交";
return true;
}
}
示例7: act_updateSpecialTMTCOn
public function act_updateSpecialTMTCOn()
{
$id = $_POST['id'] ? trim($_POST['id']) : 0;
$specialTransportManagerName = $_POST['specialTransportManagerName'] ? trim($_POST['specialTransportManagerName']) : '';
$isOn = $_POST['isOn'] ? trim($_POST['isOn']) : '';
//$canOrNot = $_POST['canOrNot'] ? (trim($_POST['canOrNot'])) : '';
$transportIdArr = !empty($_POST['transportId']) ? $_POST['transportId'] : array();
//选中的transportId数组
//print_r($transportIdArr);exit;
$tName = 'pc_special_transport_manager';
$where = "WHERE id='{$id}'";
$pspIsExist = OmAvailableModel::getTNameCount($tName, $where);
if (!$pspIsExist) {
$status = "记录不存在,错误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (empty($specialTransportManagerName)) {
$status = "特殊运输方式名称为空";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (intval($isOn) <= 0) {
$status = "是否启用有误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
if (empty($transportIdArr)) {
$status = "所选的运输方式为空,错误";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
$tName = 'pc_special_transport_manager';
$where = "WHERE specialTransportManagerName='{$specialTransportManagerName}' AND id<>'{$id}'";
$properNameIsExist = OmAvailableModel::getTNameCount($tName, $where);
if ($properNameIsExist) {
$status = "该特殊运输方式名称已经存在,请检查";
echo '<script language="javascript">
alert("' . $status . '");
</script>';
exit;
}
try {
BaseModel::begin();
$tName = 'pc_special_transport_manager';
$dataTmpArr = array();
$dataTmpArr['specialTransportManagerName'] = $specialTransportManagerName;
$dataTmpArr['isOn'] = $isOn;
$where = "WHERE id='{$id}'";
OmAvailableModel::updateTNameRow2arr($tName, $dataTmpArr, $where);
$tName = 'pc_special_stmnid_transportid';
$select = '*';
$where = "WHERE stmnId='{$id}'";
$psptList = OmAvailableModel::getTNameList($tName, $select, $where);
$psptIdArr = array();
foreach ($psptList as $value) {
$psptIdArr[] = $value['id'];
}
$psptIdStr = !empty($psptIdArr) ? implode(',', $psptIdArr) : 0;
$tName = 'pc_special_stid_channel';
$where = "WHERE stId in({$psptIdStr})";
OmAvailableModel::deleteTNameRow($tName, $where);
//删除渠道关系表的相关数据
$tName = 'pc_special_stmnid_transportid';
$where = "WHERE stmnId='{$id}'";
OmAvailableModel::deleteTNameRow($tName, $where);
//删除运输方式关系表的相关数据
foreach ($transportIdArr as $transportId) {
if (intval($transportId) > 0) {
$channelIdArr = !empty($_POST['tc' . $transportId]) ? $_POST['tc' . $transportId] : array();
//该transpordeId下的channel数组
$tName = 'pc_special_stmnid_transportid';
$dataTmpArr = array();
$dataTmpArr['stmnId'] = $id;
$dataTmpArr['transportId'] = $transportId;
$insertPTId = OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
if (intval($insertPTId) <= 0) {
throw new Exception('insertPTId 错误');
}
foreach ($channelIdArr as $channelId) {
if (intval($channelId) > 0) {
$tName = 'pc_special_stid_channel';
$dataTmpArr = array();
$dataTmpArr['stId'] = $insertPTId;
$dataTmpArr['channelId'] = $channelId;
OmAvailableModel::addTNameRow2arr($tName, $dataTmpArr);
}
}
}
}
BaseModel::commit();
BaseModel::autoCommit();
//.........这里部分代码省略.........
示例8: 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,如果换人了的话,则变为待定状态
//.........这里部分代码省略.........
示例9: 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);
}
}
}
示例10: time
$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();
echo "‘ {$sku} ’ 记录插入/更新失败,数据回滚,进入下次循环\n";
continue;
}
}
$page++;
} while ($totalPage >= $page);