本文整理汇总了PHP中OmAvailableModel::getTNameCount方法的典型用法代码示例。如果您正苦于以下问题:PHP OmAvailableModel::getTNameCount方法的具体用法?PHP OmAvailableModel::getTNameCount怎么用?PHP OmAvailableModel::getTNameCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OmAvailableModel
的用法示例。
在下文中一共展示了OmAvailableModel::getTNameCount方法的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: act_getTNameCount
function act_getTNameCount($tName, $where)
{
$ret = OmAvailableModel::getTNameCount($tName, $where);
if ($ret !== false) {
return $ret;
} else {
self::$errCode = OmAvailableModel::$errCode;
self::$errMsg = OmAvailableModel::$errMsg;
return false;
}
}
示例3: act_getTNameCount
function act_getTNameCount()
{
$jsonArr = isset($_GET['jsonArr']) ? $_GET['jsonArr'] : '';
//传过来的base64编码的json字符串
if (empty($jsonArr)) {
self::$errCode = 101;
self::$errMsg = '参数数组为空';
return false;
}
$jsonArr = json_decode(base64_decode($jsonArr), true);
//对base64及json解码
if (!is_array($jsonArr)) {
self::$errCode = 103;
self::$errMsg = '参数数组不是数组格式';
return false;
}
$tName = $jsonArr['tName'];
//表名
$where = $jsonArr['where'];
//where,要带上关键字WHERE
if (empty($tName) || empty($where)) {
self::$errCode = '300';
self::$errMsg = '必要参数不完整';
return false;
}
$count = OmAvailableModel::getTNameCount($tName, $where);
if ($count !== false) {
self::$errCode = '200';
self::$errMsg = '成功';
return $count;
} else {
self::$errCode = '404';
self::$errMsg = '数据库操作错误';
return false;
}
}
示例4: push_ebay_orderid_queue
function push_ebay_orderid_queue($ebay_orderid, $ebay_account, $rabbit = "", $recordNumber = "")
{
global $dbConn, $rabbitMQClass, $FLIP_GLOBAL_EBAY_ACCOUNT;
//var_dump($rabbitMQClass);
if ($rabbit != "") {
$rabbitMQClass = $rabbit;
}
$accountId = $FLIP_GLOBAL_EBAY_ACCOUNT[$ebay_account];
/*
//step 1 check ebay orderid statistic table
$where = " where orderid='".$ebay_orderid."' and accountId='".$accountId."' ";
if(OrderidsModel::judgeOrderidsList('orderid',$where) === true){
echo "ebay orderid[$ebay_orderid] already exists in ebay orderid statistic table\n";
return false;
}else{
//新增
}
*/
$tName = 'om_unshipped_order_extension_ebay';
$where = "WHERE orderId='{$ebay_orderid}'";
$flagCountUnshipped = OmAvailableModel::getTNameCount($tName, $where);
var_dump($flagCountUnshipped);
$tName = 'om_shipped_order_extension_ebay';
$flagCountshipped = OmAvailableModel::getTNameCount($tName, $where);
if (!empty($flagCountUnshipped) || !empty($flagCountshipped)) {
return false;
}
//判断队列中是否有相同的值不能发布
//$table_name='ebay_order_id_queue_'.$ebay_account;
$exchange = 'ebay_order_id_queue_' . $ebay_account;
$rabbitMQClass->queue_publish($exchange, $ebay_orderid);
return true;
/*$check_sql='select * from '.$table_name.' where ebay_orderid="'.$ebay_orderid.'"';
$check=$dbConn->query($check_sql);
$check=$dbConn->fetch_array_all($check);
if(count($check)==0){
$sql='insert into '.$table_name.' (ebay_orderid) value("'.$ebay_orderid.'")';
$try_insert_count=0;
while(1){
$try_insert_count++;
$res=$dbConn->query($sql);
if($res){
echo "Push ebay orderid[$ebay_orderid] into queue table successfully!\n";
break;
}else{
if($try_insert_count==3){
$lost_orderid_path = EBAY_RAW_DATA_PATH.'lost_ebay_orderid/'.$ebay_account.'/lost_sql.txt';
write_lost_sql($lost_orderid_path, $sql."\n");
echo "oops...failed again,give this order[$ebay_orderid] up finally!\n";
break;
}
echo "fail to push ebay orderid[$ebay_orderid] into queue table !Sleep 10 sconds then try again\n";
sleep(10);
}
}
}else{
echo "ebay orderid[$ebay_orderid] already exists in queue\n";
}*/
}
示例5: foreach
echo "\n";
$start = $per * $i;
$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";
}
示例6: view_addOrUpdateSpeicailSpuOn
public function view_addOrUpdateSpeicailSpuOn()
{
$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 = 'addOrUpdateSpeicailSpuExcelImport_' . 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();
//表格中的最大行数
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();
//.........这里部分代码省略.........
示例7: view_getProductsCombineSpuCompleteList
public function view_getProductsCombineSpuCompleteList()
{
$combineSpu = $_GET['combineSpu'] ? post_check(trim($_GET['combineSpu'])) : '';
$userId = $_SESSION['userId'];
$tName = 'pc_spu_web_maker a,(select spu,max(id) as id from pc_spu_web_maker group by spu) b';
$select = 'a.*';
$where = 'where a.is_delete=0 AND a.isSingSpu=2 AND a.isTake=1 AND a.isComplete=1 AND a.spu=b.spu and a.id=b.id ';
if (!isAccessAll('products', 'getAllCombineSpuListPermission')) {
$where .= "AND a.webMakerId='{$userId}' ";
}
if (!empty($combineSpu)) {
$skuArr = array_filter(explode(',', $combineSpu));
$countSkuArr = count($skuArr);
for ($i = 0; $i < $countSkuArr; $i++) {
if (preg_match("/^[A-Z0-9]+\$/", $skuArr[$i])) {
if ($i == 0) {
$where .= " AND (a.spu like'{$skuArr[$i]}%' ";
} else {
$where .= " OR a.spu like'{$skuArr[$i]}%'";
}
if ($i == $countSkuArr - 1) {
$where .= ") ";
}
}
}
}
$total = OmAvailableModel::getTNameCount($tName, $where);
$num = 50;
//每页显示的个数
$page = new Page($total, $num, '', 'CN');
$where .= "order by a.completeTime desc " . $page->limit;
$productsComfirmList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($productsComfirmList)) {
$countProComList = count($productsComfirmList);
for ($i = 0; $i < $countProComList; $i++) {
$tName = 'pc_auto_create_spu';
$select = 'purchaseId';
$where = "WHERE is_delete=0 AND spu='{$productsComfirmList[$i]['spu']}'";
$autoSpuList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($autoSpuList)) {
$productsComfirmList[$i]['purchaseId'] = $autoSpuList[0]['purchaseId'];
}
}
}
if (!empty($_GET['page'])) {
if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
$n = 1;
} else {
$n = (intval($_GET['page']) - 1) * $num + 1;
}
} else {
$n = 1;
}
if ($total > $num) {
//输出分页显示
$show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
} else {
$show_page = $page->fpage(array(0, 2, 3));
}
$navlist = array(array('url' => 'index.php?mod=products&act=getProductsComfirmList', 'title' => '产品制作'), array('url' => 'index.php?mod=products&act=getProductsCombineSpuCompleteList', 'title' => '3.虚拟SPU完成'));
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('onevar', 5);
$this->smarty->assign('twovar', 515);
$this->smarty->assign('show_page', $show_page);
$this->smarty->assign('title', '3.虚拟SPU完成');
$this->smarty->assign('productsCombineSpuList', empty($productsComfirmList) ? array() : $productsComfirmList);
$this->smarty->display("productsCombineSpuCompleteList.htm");
}
示例8: intval
//continue;
}
if (preg_match("/^[A-Z]{2}[0-9]{6}\$/", $spu)) {
$sort = intval(substr($spu, 2));
} else {
$sort = 0;
}
$set = "SET spu='{$spu}',purchaseId='{$purchaseId}',createdTime='{$now}',sort='{$sort}',status=2";
if (!$countAutoCreSpu) {
OmAvailableModel::addTNameRow($tName, $set);
echo "{$spu} autoCreateSpu insert success\n";
}
//添加SPU档案
$tName = 'pc_spu_archive';
$where = "WHERE spu='{$spu}'";
$countSpuArchive = OmAvailableModel::getTNameCount($tName, $where);
if ($countSpuArchive) {
echo "{$spu} spuArchive has exist!\n";
$set = "SET categoryPath='{$value['goods_category']}',purchaseId='{$pcGoodsArr['purchaseId']}'";
OmAvailableModel::updateTNameRow($tName, $set, $where);
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;
示例9: view_getSpuSpecialTMList
public function view_getSpuSpecialTMList()
{
$spu = $_GET['spu'] ? post_check(trim($_GET['spu'])) : '';
$tName = 'pc_special_transport_manager';
$select = '*';
$where = 'WHERE 1=1 ';
$tmpTMIdStr = '';
if (!empty($spu)) {
$tNameSpu = 'pc_special_transport_manager_spu';
$selectSpu = 'stmnId';
$whereSpu = "WHERE spu='{$spu}' group by stmnId";
$propertyIdList = OmAvailableModel::getTNameList($tNameSpu, $selectSpu, $whereSpu);
$tmpArr = array();
foreach ($propertyIdList as $value) {
$tmpArr[] = $value['stmnId'];
}
if (!empty($tmpArr)) {
$tmpTMIdStr = implode(',', $tmpArr);
} else {
$tmpTMIdStr = '0';
}
}
if ($tmpTMIdStr != '') {
$where .= "AND id in({$tmpTMIdStr})";
}
$total = OmAvailableModel::getTNameCount($tName, $where);
$num = 100;
//每页显示的个数
$page = new Page($total, $num, '', 'CN');
$where .= "order by id desc " . $page->limit;
$spuSpecialTMList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($spuSpecialTMList as $key => $value) {
$tName = 'pc_special_stmnid_transportid';
$select = '*';
$where = "WHERE stmnId='{$value['id']}' limit 1";
$psstList = OmAvailableModel::getTNameList($tName, $select, $where);
//$spuSpecialTMList[$key]['canOrNot'] = $psstList[0]['canOrNot'];
}
if (!empty($_GET['page'])) {
if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
$n = 1;
} else {
$n = (intval($_GET['page']) - 1) * $num + 1;
}
} else {
$n = 1;
}
if ($total > $num) {
//输出分页显示
$show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
} else {
$show_page = $page->fpage(array(0, 2, 3));
}
$navlist = array(array('url' => 'index.php?mod=category&act=getCategoryList', 'title' => '类别管理'), array('url' => '#', 'title' => '特殊料号-运输方式管理列表'));
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('onevar', 4);
$this->smarty->assign('twovar', 45);
$this->smarty->assign('show_page', $show_page);
$this->smarty->assign('title', '特殊料号-运输方式管理列表');
$this->smarty->assign('spuSpecialTMList', empty($spuSpecialTMList) ? null : $spuSpecialTMList);
$this->smarty->display("spuSpecialTransportList.htm");
}
示例10: 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;
}
示例11: view_getSpuModityRecordList
public function view_getSpuModityRecordList()
{
$spu = isset($_GET['spu']) ? post_check($_GET['spu']) : '';
$recordType = isset($_GET['recordType']) ? post_check($_GET['recordType']) : '';
$PEId = isset($_GET['PEId']) ? post_check($_GET['PEId']) : '';
$status = isset($_GET['status']) ? post_check($_GET['status']) : '';
$addUserId = isset($_GET['addUserId']) ? post_check($_GET['addUserId']) : '';
$timeSearchType = isset($_GET['timeSearchType']) ? post_check($_GET['timeSearchType']) : '';
$startdate = isset($_GET['startdate']) ? post_check($_GET['startdate']) : '';
$enddate = isset($_GET['enddate']) ? post_check($_GET['enddate']) : '';
$tName = 'pc_spu_modify_record';
$select = '*';
$where = 'WHERE is_delete=0 ';
if (!empty($spu)) {
$where .= "AND spu='{$spu}' ";
}
if (intval($recordType) > 0) {
$where .= "AND recordType='{$recordType}' ";
}
if (intval($PEId) > 0) {
$where .= "AND PEId='{$PEId}' ";
}
if (intval($status) > 0) {
$where .= "AND status='{$status}' ";
}
if (intval($addUserId) > 0) {
if (intval($addUserId) == 9999) {
$where .= "AND addUserId='0' ";
} else {
$where .= "AND addUserId='{$addUserId}' ";
}
}
if (intval($timeSearchType) > 0) {
if ($startdate != '') {
$start = strtotime($startdate . ' 00:00:00');
if ($timeSearchType == 1) {
$where .= "AND addTime>='{$start}' ";
} elseif ($timeSearchType == 2) {
$where .= "AND handleTime>='{$start}' ";
} elseif ($timeSearchType == 3) {
$where .= "AND completeTime>='{$start}' ";
}
}
if ($enddate != '') {
$end = strtotime($enddate . ' 23:59:59');
if ($timeSearchType == 1) {
$where .= "AND addTime<='{$end}' ";
} elseif ($timeSearchType == 2) {
$where .= "AND handleTime<='{$end}' ";
} elseif ($timeSearchType == 3) {
$where .= "AND completeTime<='{$end}' ";
}
}
}
$total = OmAvailableModel::getTNameCount($tName, $where);
$num = 100;
//每页显示的个数
$page = new Page($total, $num, '', 'CN');
$where .= 'order by id desc ';
$where .= $page->limit;
$spuModityRecordList = OmAvailableModel::getTNameList($tName, $select, $where);
if (!empty($_GET['page'])) {
if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
$n = 1;
} else {
$n = (intval($_GET['page']) - 1) * $num + 1;
}
} else {
$n = 1;
}
if ($total > $num) {
//输出分页显示
$show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
} else {
$show_page = $page->fpage(array(0, 2, 3));
}
$navlist = array(array('url' => 'index.php?mod=autoCreateSpu&act=getAutoCreatePrefixList', 'title' => 'SPU管理'), array('url' => 'index.php?mod=autoCreateSpu&act=getSpuModityRecordList', 'title' => 'SPU产品修改/优化管理'));
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('onevar', 2);
$this->smarty->assign('twovar', 26);
$this->smarty->assign('show_page', $show_page);
$this->smarty->assign('title', 'SPU产品修改/优化管理');
$this->smarty->assign('spuModityRecordList', empty($spuModityRecordList) ? array() : $spuModityRecordList);
$this->smarty->display("spuModifyRecordList.htm");
}
示例12: isExistAppointByPEId2
function isExistAppointByPEId2($PEId)
{
$tName = 'pc_products_large_category_appoint';
$where = "WHERE is_delete=0 and appointPEId='{$PEId}'";
$PECount = OmAvailableModel::getTNameCount($tName, $where);
return $PECount;
}
示例13: shiftAllOrderRowNoEvent
/**
* 转移订单对应下的总表信息,没有批量处理事件
* @para $data as array
* @add by Herman.Xi
* @last modified 20131022
* $in 默认为进入订单模式
*/
public static function shiftAllOrderRowNoEvent($orderData, $tName = 'om_shipped_order')
{
self::initDB();
//var_dump($orderData); exit;
$obj_order_data = $orderData['orderData'];
$orderExtenData = $orderData['orderExtenData'];
$orderUserInfoData = $orderData['orderUserInfoData'];
$orderDetailArr = $orderData['orderDetail'];
$orderWhInfoData = $orderData['orderWhInfoData'];
//var_dump($obj_order_data); exit;
//$tName = 'om_unshipped_order';
$where = "WHERE recordNumber='{$obj_order_data['recordNumber']}' AND platformId={$obj_order_data['platformId']}";
$flagCountUnshipped = OmAvailableModel::getTNameCount($tName, $where);
//var_dump($flagCountUnshipped); exit;
/*$tName = 'om_shipped_order';
$flagCountshipped = OmAvailableModel :: getTNameCount($tName, $where);*/
if ($obj_order_data) {
//判断订单是否已经在系统2个订单表(未发货和已发货)中存在
$platfrom = omAccountModel::getPlatformSuffixById($obj_order_data['platformId']);
$extension = $platfrom['suffix'];
//获取后缀名称
//echo $extension; echo "<br>"; exit;
$insertOrderDataRow = self::insertOrderRow($obj_order_data, $tName);
//插入到order表
if (empty($insertOrderDataRow)) {
self::$errCode = "020";
self::$errMsg = "插入订单失败!";
return false;
}
//$orderExtenData['omOrderId'] = $obj_order_data['id'];
//$orderExtenData['omOrderId'] = $insertOrderDataRow;
//$orderUserInfoData['omOrderId'] = $insertOrderDataRow;
//$orderUserInfoData['omOrderId'] = $obj_order_data['id'];
if ($orderExtenData) {
$resultExten = self::insertExtension($orderExtenData, $extension, $tName);
//插入到order_extend表
if (!$resultExten) {
self::$errCode = "021";
self::$errMsg = "插入订单附加表失败!";
return false;
}
}
if ($orderUserInfoData) {
$resultUserInfo = self::insertUserinfoRow($orderUserInfoData, $tName);
//插入到order_userInfo表
if (!$resultUserInfo) {
self::$errCode = "022";
self::$errMsg = "插入用户信息表失败!";
return false;
}
}
if ($orderWhInfoData) {
$resultWhInfo = self::insertWhInfoRow($orderWhInfoData, $tName);
//插入到order_userInfo表
if (!$resultWhInfo) {
self::$errCode = "022";
self::$errMsg = "插入仓库信息表失败!";
return false;
}
}
foreach ($orderDetailArr as $orderDetail) {
$orderDetailData = $orderDetail['orderDetailData'];
$orderDetailExtenData = $orderDetail['orderDetailExtenData'];
//$orderDetailData['omOrderId'] = $insertOrderDataRow;
//$orderDetailData['omOrderId'] = $obj_order_data['id'];
$orderDetailData['createdTime'] = time();
$insertOrderDatilRow = self::insertOrderdetail($orderDetailData, $tName);
//插入到detail表
if (empty($insertOrderDatilRow)) {
self::$errCode = "023";
self::$errMsg = "插入订明细单失败!";
return false;
}
//$orderDetailExtenData['omOrderdetailId'] = $insertOrderDatilRow;
//$orderDetailExtenData['omOrderdetailId'] = $orderDetailData['id'];
if ($orderDetailExtenData) {
$resultOrderDetailExten = self::insertDetailExtension($orderDetailExtenData, $extension, $tName);
//插入到detailExtend
if (!$resultOrderDetailExten) {
self::$errCode = "024";
self::$errMsg = "插入订单明细附带表失败!";
return false;
}
}
}
/*if($obj_order_data['platformId'] == 1 && $in){
$insertOrderidsDada = array('omOrderId'=>$insertOrderDataRow,'PayPalPaymentId'=>$orderData['orderExtenData']['PayPalPaymentId'],'orderid'=>$orderData['orderExtenData']['orderId'],'accountId'=>$orderData['orderData']['accountId'],'saletime'=>time());
$insertOrderids = OrderidsModel::insertOrderidsList($insertOrderidsDada);
if (!$insertOrderids) {
self::$errCode = "025";
self::$errMsg = "插入ebay订单IDS失败!";
return false;
}
//.........这里部分代码省略.........
示例14: view_3WithoutGoodsInfoExcelOutPutOn
public function view_3WithoutGoodsInfoExcelOutPutOn()
{
$fileName = "3WithoutGoodsInfoExcelOutPut.xls";
$excel = new ExportDataExcel('browser', $fileName);
$excel->initialize();
$tableHeader = array('SPU', 'SKU', '仓位', '重量', '包材', '英文品名', '海关编码', '状态');
$excel->addRow($tableHeader);
$visbleSpu = '';
$tName = 'pc_goods';
$select = 'spu';
$where = "WHERE is_delete=0 group by spu ";
$spuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($spuList as $value) {
$spu = $value['spu'];
$tName = 'pc_spu_tax_hscode';
$select = 'customsNameEN,hsCode';
$where = "WHERE spu='{$spu}'";
$spuHscodeList = OmAvailableModel::getTNameList($tName, $select, $where);
$customsNameEN = $spuHscodeList[0]['customsNameEN'];
//英文品名
$hsCode = $spuHscodeList[0]['hsCode'];
//海关编码
$tName = 'pc_goods';
$select = 'sku,goodsWeight,goodsStatus,pmId';
$where = "WHERE is_delete=0 AND spu='{$spu}'";
$skuList = OmAvailableModel::getTNameList($tName, $select, $where);
foreach ($skuList as $v) {
$flag = 0;
//标识是否属于三无产品
$sku = $v['sku'];
$goodsWeight = $v['goodsWeight'];
$pmId = $v['pmId'];
$goodsStatus = $v['goodsStatus'];
$tName = 'pc_goods_whId_location_raletion';
$where = "WHERE sku='{$sku}' AND isHasLocation=1";
$skuWlListCount = OmAvailableModel::getTNameCount($tName, $where);
$isHasLocation = $skuWlListCount ? 1 : 2;
//如果无内容则默认为无仓位
if (empty($customsNameEN)) {
$flag = 1;
}
if (empty($hsCode)) {
$flag = 1;
}
if ($goodsWeight == 0) {
$flag = 1;
}
if (intval($pmId) <= 0) {
$flag = 1;
}
if ($isHasLocation != 1) {
$flag = 1;
}
if ($flag == 0) {
continue;
}
$tableBody = array();
if ($visbleSpu == $spu) {
$tableBody[] = '';
} else {
$tableBody[] = $spu;
}
$tableBody[] = $sku;
$tableBody[] = $isHasLocation == 1 ? '有' : '无';
$tableBody[] = $goodsWeight != 0 ? '有' : '无';
$tableBody[] = intval($pmId) > 0 ? '有' : '无';
$tableBody[] = !empty($customsNameEN) ? '有' : '无';
$tableBody[] = !empty($hsCode) ? '有' : '无';
$tableBody[] = $goodsStatus == 1 || $goodsStatus == 51 ? '在线' : '停售';
$visbleSpu = $spu;
$excel->addRow($tableBody);
}
}
$excel->finalize();
exit;
}
示例15: 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} 记录已插入成功";
}
//下面对关联单料号的组合料号进行修改
//.........这里部分代码省略.........