Example #1
0
 public function view_getSpuPrefixList()
 {
     //调用action层, 获取列表数据
     $omAvailableAct = new OmAvailableAct();
     $status = $_GET['status'] ? $_GET['status'] : '';
     $tName = 'pc_auto_create_spu_prefix';
     $select = '*';
     $where = 'WHERE 1=1 ';
     $total = $omAvailableAct->act_getTNameCount($tName, $where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by id " . $page->limit;
     $spuPrefixList = $omAvailableAct->act_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=spu&act=getSpuPrefixList', 'title' => 'SPU自动生成前缀管理'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 2);
     $this->smarty->assign('twovar', 24);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', 'SPU自动生成前缀管理');
     $this->smarty->assign('status', $status);
     $this->smarty->assign('spuPrefixList', empty($spuPrefixList) ? null : $spuPrefixList);
     $this->smarty->display("spuPrefixList.htm");
 }
Example #2
0
 public function view_modifyOrderList()
 {
     global $memc_obj;
     $sysUserId = $_SESSION['sysUserId'];
     $modify_showerrorinfo = '';
     $OrderModifyAct = new OrderModifyAct();
     $OrderindexAct = new OrderindexAct();
     $UserCompetenceAct = new UserCompetenceAct();
     //var_dump($_GET); exit;
     if (isset($_GET) && !empty($_GET)) {
         $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
         $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
         $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
     }
     if (isset($_POST) && !empty($_POST)) {
         //var_dump($_POST); echo "<br>"; exit;
         $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : '';
         $ostatus = isset($_POST['edit_ostatus']) ? $_POST['edit_ostatus'] : $_POST['ostatus'];
         $otype = isset($_POST['edit_otype']) ? $_POST['edit_otype'] : $_POST['otype'];
         $update_order = array();
         $update_userinfo = array();
         $update_tracknumber = array();
         //$orderid = $_POST['orderid'];
         //var_dump($_POST); exit;
         $updatestatus = false;
         if ($_POST['action'] == 'addDetail') {
             //var_dump($_GET); echo "<br>"; exit;
             $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
             $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
             $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
             if ($OrderModifyAct->act_batchAdd($orderid, $_POST)) {
                 $modify_showerrorinfo = "<font color='green'>添加成功</font>";
             } else {
                 $modify_showerrorinfo = "<font color='red'>添加失败</font>";
             }
         } else {
             if ($_POST['action'] == 'addNote') {
                 //var_dump($_GET); echo "<br>"; exit;
                 $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
                 $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
                 $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
                 if ($OrderModifyAct->act_addNote($orderid, $_POST)) {
                     $modify_showerrorinfo = "<font color='green'>添加成功</font>";
                 } else {
                     $modify_showerrorinfo = "<font color='red'>添加失败</font>";
                 }
             } else {
                 $visible_movefolder = $UserCompetenceAct->act_getInStatusIds($_POST['otype'], $sysUserId);
                 if (!in_array($_POST['edit_otype'], $visible_movefolder)) {
                     $modify_showerrorinfo = "<font color='red'>您没有改变订单状态的权限</font>";
                 } else {
                     if ($_POST['username'] != $_POST['edit_username']) {
                         $update_userinfo['username'] = $_POST['edit_username'];
                     }
                     if ($_POST['ostatus'] != $_POST['edit_ostatus']) {
                         $update_order['orderStatus'] = $_POST['edit_ostatus'];
                     }
                     if ($_POST['otype'] != $_POST['edit_otype']) {
                         $update_order['orderType'] = $_POST['edit_otype'];
                         $updatestatus = true;
                     }
                     if ($_POST['street'] != $_POST['edit_street']) {
                         $update_userinfo['street'] = $_POST['edit_street'];
                     }
                     if ($_POST['platformUsername'] != $_POST['edit_platformUsername']) {
                         $update_userinfo['platformUsername'] = $_POST['edit_platformUsername'];
                     }
                     if ($_POST['address2'] != $_POST['edit_address2']) {
                         $update_userinfo['address2'] = $_POST['edit_address2'];
                     }
                     if ($_POST['actualShipping'] != $_POST['edit_actualShipping']) {
                         $update_order['actualShipping'] = $_POST['edit_actualShipping'];
                     }
                     if ($_POST['city'] != $_POST['edit_city']) {
                         $update_userinfo['city'] = $_POST['edit_city'];
                     }
                     if ($_POST['state'] != $_POST['edit_state']) {
                         $update_userinfo['state'] = $_POST['edit_state'];
                     }
                     if ($_POST['countryName'] != $_POST['edit_countryName']) {
                         $update_userinfo['countryName'] = $_POST['edit_countryName'];
                     }
                     if ($_POST['zipCode'] != $_POST['edit_zipCode']) {
                         $update_userinfo['zipCode'] = $_POST['edit_zipCode'];
                     }
                     if ($_POST['landline'] != $_POST['edit_landline']) {
                         $update_userinfo['landline'] = $_POST['edit_landline'];
                     }
                     if ($_POST['phone'] != $_POST['edit_phone']) {
                         $update_userinfo['phone'] = $_POST['edit_phone'];
                     }
                     if ($_POST['transportId'] != $_POST['edit_transportId']) {
                         $update_order['transportId'] = $_POST['edit_transportId'];
                     }
                     if ($_POST['edit_tracknumber']) {
                         $update_tracknumber['omOrderId'] = $orderid;
                         $update_tracknumber['tracknumber'] = $_POST['edit_tracknumber'];
                         $update_tracknumber['addUser'] = $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 = OrderLogModel::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 {
                             $modify_showerrorinfo = "<font color='red'>更新失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     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 {
                             $modify_showerrorinfo = "<font color='red'>更新失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     if ($update_tracknumber) {
                         //echo $msg;
                         if (!OrderAddModel::insertOrderTrackRow($update_tracknumber)) {
                             /*self :: $errCode = "001";
                             		self :: $errMsg =  "跟踪号插入失败";
                             		return false;*/
                             $modify_showerrorinfo = "<font color='red'>跟踪号插入失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     BaseModel::commit();
                     BaseModel::autoCommit();
                 }
             }
         }
     }
     $this->smarty->assign('modify_showerrorinfo', $modify_showerrorinfo);
     $omAvailableAct = new OmAvailableAct();
     //平台信息
     $platform = $omAvailableAct->act_getTNameList('om_platform', 'id,platform', 'WHERE is_delete=0');
     //var_dump($platform);
     $platformList = array();
     foreach ($platform as $v) {
         $platformList[$v['id']] = $v['platform'];
     }
     $this->smarty->assign('platformList', $platformList);
     /**导航 start**/
     $this->smarty->assign('ostatus', $ostatus);
     $this->smarty->assign('otype', $otype);
     //二级目录
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $ostatus . '" AND is_delete=0');
     //var_dump($otypeList);
     $this->smarty->assign('otypeList', $otypeList);
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         /*$accountacc = $_SESSION['accountacc'];
         		$oc_where = " where orderStatus='$orderStatus' ";
         		if($accountacc){
         			$oc_where .= ' AND ('.$accountacc.') ';
         		}*/
         $s_total = $OrderindexAct->act_showSearchOrderNum($orderStatus);
         //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $oc_where);
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$orderStatus}' order by sort asc");
         $second_type[$o_secondinfo['statusCode']] = $s_type[0]['statusCode'];
     }
     //var_dump($second_count);
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     $refund_total = $omAvailableAct->act_getTNameCount("om_order_refund", " where is_delete=0");
     $this->smarty->assign('refund_total', $refund_total);
     //三级目录
     $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $three_count = array();
     foreach ($o_threelevel as $o_threeinfo) {
         $orderType = $o_threeinfo['statusCode'];
         $s_total = $OrderindexAct->act_showSearchOrderNum($ostatus, $orderType);
         //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order"," where orderStatus='$ostatus' and orderType='$orderType' and storeId=1 and is_delete=0");
         $three_count[$o_threeinfo['statusCode']] = $s_total;
     }
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '订单显示页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0 ');
     $this->smarty->assign('statusMenu', $statusMenu);
     $value = '';
     $where = '';
     switch ($searchTransportationType) {
         case '1':
             $transportation = CommonModel::getCarrierList(1);
             //快递
             break;
         case '2':
             $transportation = CommonModel::getCarrierList(0);
             //平邮
             break;
         default:
             $transportation = CommonModel::getCarrierList();
             //所有的
             break;
     }
     //var_dump($transportation); exit;
     $transportationList = array();
     foreach ($transportation as $tranValue) {
         $transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
     }
     //var_dump($transportationList); exit;
     $this->smarty->assign('transportation', $transportation);
     $this->smarty->assign('transportationList', $transportationList);
     //var_dump($orderid, $ostatus,$otype);
     $omOrderList = $OrderModifyAct->act_getModifyOrderList($orderid, $ostatus, $otype, $storeId = 1);
     //var_dump($omOrderList);
     //$sku	=	array();
     $account_where = ' WHERE is_delete = 0 ';
     if ($searchPlatformId) {
         $account_where .= ' AND platformId = ' . $searchPlatformId;
     }
     $accountList = $UserCompetenceAct->act_showGlobalUser();
     if ($accountList) {
         $account_where .= ' AND id in ( ' . join(',', $accountList) . ' ) ';
     }
     //帐号信息
     $accountList = $omAvailableAct->act_getTNameList('om_account', '*', $account_where);
     //var_dump($accountList); exit;
     $account = array();
     foreach ($accountList as $v) {
         $account[$v['id']] = $v['account'];
     }
     //包材信息
     $pm = GoodsModel::getMaterInfoByList();
     //获取系统所有状态
     $statusList = copyOrderModel::selectStatusList();
     $CurrencyAct = new CurrencyAct();
     $currencyList = $CurrencyAct->act_getCurrencyListById();
     //echo "<pre>"; print_r($currencyList); exit;
     $this->smarty->assign('currencyList', $currencyList);
     $this->smarty->assign('statusList', $statusList);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('account', $account);
     $this->smarty->assign('accountList', $accountList);
     $this->smarty->assign('pm', $pm);
     $this->smarty->assign('omOrderList', $omOrderList);
     $this->smarty->display('orderModify.htm');
 }
Example #3
0
 public function view_deleteAccountList()
 {
     $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
     $status = '';
     if (intval($id) == 0) {
         $status = '<font color="red">数据异常,删除失败</font>';
         header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
         exit;
     }
     $omAvailableAct = new OmAvailableAct();
     $tName = 'om_account';
     $where = "WHERE is_delete=0 and id='{$id}'";
     $count = $omAvailableAct->act_getTNameCount($tName, $where);
     if (!$count) {
         $status = '<font color="red">记录不存在,删除失败</font>';
         header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
         exit;
     }
     $set = "SET is_delete=1 ";
     $where = "WHERE id='{$id}'";
     $affectRow = $omAvailableAct->act_updateTNameRow($tName, $set, $where);
     if ($affectRow) {
         $status = '<font color="green">删除成功</font>';
     } else {
         $status = '<font color="red">删除失败</font>';
     }
     header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
 }
Example #4
0
 public function view_getNewGoodsList()
 {
     //调用action层, 获取列表数据
     $start1 = getMicrotime();
     $sku = $_GET['sku'] ? post_check(trim($_GET['sku'])) : '';
     $purchaseId = intval($_GET['purchaseId']) > 0 ? intval($_GET['purchaseId']) : 0;
     $whId = intval($_GET['whId']) > 0 ? intval($_GET['whId']) : 1;
     $omAvailableAct = new OmAvailableAct();
     $tName = 'pc_goods';
     $select = 'spu';
     $where = "WHERE is_delete=0 AND isNew=1 AND substring(sku, 1, 1)<>'M' AND substring(sku, 1, 1)<>'Z' and substring(sku, 1, 1)<>'F' ";
     if (!empty($sku)) {
         $where .= "AND sku like'{$sku}%' ";
     }
     if (!empty($purchaseId)) {
         $where .= "AND purchaseId='{$purchaseId}' ";
     }
     //第一步筛选,选出isNew=1,并且goodsName!=''和'无',sku不已F和Z开头的spu
     $spuList1 = $omAvailableAct->act_getTNameList($tName, $select, $where);
     $spuArr1 = array();
     foreach ($spuList1 as $value) {
         if (!empty($value['spu'])) {
             $spuArr1[] = $value['spu'];
         }
     }
     //此时 $spuSkuRelationArr1中保存的是spu和sku的关系数组,形如 array('1201'=>array('1201_B','1201_W'),'1202'=>array('1202'));
     //此时 $spuSkuRelationArr1中保存的是spu和sku的关系数组,形如 array('1201'=>array('1201_B','1201_W'),'1202'=>array('1202'));
     //第二步,选择出制作表已经存在的数据
     $tName = 'pc_products';
     $select = 'sku';
     $where = "WHERE is_delete=0 ";
     $skuList2 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuArr2 = array();
     foreach ($skuList2 as $value) {
         $tmpArr = explode('_', $value['sku']);
         if (!empty($tmpArr[0])) {
             $spu = $tmpArr[0];
             $spuArr2["{$spu}"] = $spu;
             //SPU
         }
     }
     //第三步,找出新品领料单中存在的sku;
     $tName = 'pc_products_iostore_detail';
     $select = 'sku';
     $where = "WHERE is_delete=0 AND iostoreTypeId=1 AND useTypeId=1 AND isAudit<3 ";
     $skuList3 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuArr3 = array();
     foreach ($skuList3 as $value) {
         $tmpArr = explode('_', $value['sku']);
         if (!empty($tmpArr[0])) {
             $spu = $tmpArr[0];
             $spuArr3["{$spu}"] = $spu;
             //SPU
         }
     }
     $saveSpuArr = array();
     //要保留的SPU
     foreach ($spuArr1 as $value) {
         if (!in_array($value, $spuArr2, true) && !in_array($value, $spuArr3, true)) {
             //SPU不在$spuArr2,$spuArr3时保留
             $saveSpuArr[] = "'" . $value . "'";
         }
         $saveSpuArr = array();
         //要保留的SPU
         foreach ($spuArr1 as $value) {
             if (!in_array($value, $spuArr2) && !in_array($value, $spuArr3)) {
                 //SPU不在$spuArr2,$spuArr3时保留
                 $saveSpuArr[] = "'" . $value . "'";
             }
         }
         if (empty($saveSpuArr)) {
             $saveSpuStr = "'0'";
         } else {
             $saveSpuStr = implode(',', $saveSpuArr);
         }
         $tName = 'pc_goods';
         $select = 'spu,sku,isNew';
         $where = "WHERE is_delete=0 AND spu IN({$saveSpuStr})";
         $skuList4 = OmAvailableModel::getTNameList($tName, $select, $where);
         $spuSkuRelationArr1 = array();
         $unSaveSpu = '';
     }
     $tName = 'pc_goods';
     $select = 'spu,sku,isNew';
     $where = "WHERE is_delete=0 AND spu IN({$saveSpuStr})";
     $skuList4 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuSkuRelationArr1 = array();
     $unSaveSpu = '';
     foreach ($skuList4 as $value) {
         if ($value['isNew'] == 0) {
             //过滤出全是新品的SPU
             $unSaveSpu = $value['spu'];
         }
         if ($unSaveSpu == $value['spu']) {
             continue;
         }
         $spuSkuRelationArr1[$value['spu']][] = $value['sku'];
     }
     $skuArr4 = array();
     foreach ($skuList4 as $value) {
         $skuArr4[] = "'" . $value['sku'] . "'";
     }
     if (empty($skuArr4)) {
         $skuArrStr = "'0'";
     } else {
         $skuArrStr = implode(',', $skuArr4);
     }
     $tName = 'pc_goods_whId_location_raletion';
     $select = 'sku';
     $where = "WHERE location<>'' AND sku In({$skuArrStr}) ";
     $where .= "AND whId={$whId} ";
     $skuList5 = OmAvailableModel::getTNameList($tName, $select, $where);
     $spuSkuRelationArr2 = array();
     foreach ($skuList5 as $value) {
         $tmpSpuArr = explode('_', $value['sku']);
         if (!empty($tmpSpuArr[0])) {
             $spuSkuRelationArr2[$tmpSpuArr[0]][] = $value['sku'];
         }
     }
     $spuLastArr = array();
     foreach ($spuSkuRelationArr1 as $spu => $skuArr) {
         $tmpArray = $spuSkuRelationArr2[$spu];
         if (count($skuArr) == count($tmpArray)) {
             $spuLastArr[] = "'" . $spu . "'";
         }
     }
     if (empty($spuLastArr)) {
         $spuLastStr = "'0'";
     } else {
         $spuLastStr = implode(',', $spuLastArr);
     }
     $tName = 'pc_goods';
     $select = 'spu,sku,goodsName,purchaseId,goodsCreatedTime';
     $where = "WHERE is_delete=0 AND spu IN({$spuLastStr})";
     $total = $omAvailableAct->act_getTNameCount($tName, $where);
     $num = 1000;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by sku " . $page->limit;
     $newGoodsList = $omAvailableAct->act_getTNameList($tName, $select, $where);
     $total = $omAvailableAct->act_getTNameCount($tName, $where);
     $num = 1000;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by sku " . $page->limit;
     $newGoodsList = $omAvailableAct->act_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=products&act=getProductsComfirmList', 'title' => '产品制作'), array('url' => 'index.php?mod=products&act=getProductsComfirmList', 'title' => '新品列表'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 5);
     $this->smarty->assign('twovar', 55);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', '新品列表');
     $whInfo = getWhInfo();
     $whArr = array();
     foreach ($whInfo as $value) {
         $whArr[$value['id']] = $value['whName'];
     }
     if (!empty($newGoodsList)) {
         $countNewGL = count($newGoodsList);
         for ($i = 0; $i < $countNewGL; $i++) {
             $tName = 'pc_goods_whId_location_raletion';
             $select = '*';
             $where = "WHERE sku='{$newGoodsList[$i]['sku']}' ";
             $skuInfoList = OmAvailableModel::getTNameList($tName, $select, $where);
             $newGoodsList[$i]['whId'] = $skuInfoList[0]['whId'];
             $newGoodsList[$i]['wh'] = $whArr[$skuInfoList[0]['whId']];
             $newGoodsList[$i]['location'] = $skuInfoList[0]['location'];
             $newGoodsList[$i]['storageTime'] = $skuInfoList[0]['storageTime'];
         }
     }
     $end1 = getMicrotime();
     //echo 	$end1-$start1;exit;
     $this->smarty->assign('newGoodsList', empty($newGoodsList) ? array() : $newGoodsList);
     $this->smarty->display("newGoodsList.htm");
 }
Example #5
0
 public function view_deletePlatformList()
 {
     $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
     $status = '';
     if (intval($id) == 0) {
         $status = '数据异常,删除失败';
         header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
         exit;
     }
     $omAvailableAct = new OmAvailableAct();
     $tName = 'om_platform';
     $where = "WHERE is_delete=0 and id='{$id}'";
     $count = $omAvailableAct->act_getTNameCount($tName, $where);
     if (!$count) {
         $status = '记录不存在,删除失败';
         header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
         exit;
     }
     //获取原始平台账号
     $platformInfo = $omAvailableAct->act_getTNameList($tName, 'platform', ' where id=' . $id);
     $old_platform = $platformInfo[0]['platform'];
     $set = "SET is_delete=1 ";
     $where = "WHERE id='{$id}'";
     $affectRow = $omAvailableAct->act_updateTNameRow($tName, $set, $where);
     if ($affectRow) {
         //更新老系统
         $returnInfo = OldsystemModel::erpSyncPlatform($old_platform, 'delete', $old_platform);
         if ($returnInfo['res_code'] == 200) {
             $status = '删除成功';
         } else {
             $status = '更新老系统失败';
         }
     } else {
         $status = '删除失败';
     }
     header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
 }
Example #6
0
 public function act_getPartnerList()
 {
     $id = isset($_GET['id']) ? trim($_GET['id']) : '';
     $company_name = isset($_GET['company_name']) ? trim($_GET['company_name']) : '';
     $username = isset($_GET['user_name']) ? trim($_GET['user_name']) : '';
     $type_id = isset($_GET['type_id']) ? trim($_GET['type_id']) : '';
     $tel = isset($_GET['tel']) ? trim($_GET['tel']) : '';
     $phone = isset($_GET['phone']) ? trim($_GET['phone']) : '';
     $e_mail = isset($_GET['e_mail']) ? trim($_GET['e_mail']) : '';
     $QQ = isset($_GET['QQ']) ? trim($_GET['QQ']) : '';
     $AliIM = isset($_GET['AliIM']) ? trim($_GET['AliIM']) : '';
     $status = isset($_GET['status']) ? trim($_GET['status']) : '';
     $purchaseuser_id = isset($_GET['purchaseuser_id']) ? trim($_GET['purchaseuser_id']) : '';
     $company_id = isset($_GET['company_id']) ? trim($_GET['company_id']) : '';
     $page = isset($_GET['page']) ? trim($_GET['page']) : 1;
     $pageSize = isset($_GET['pageSize']) ? trim($_GET['pageSize']) : 0;
     $condition = 'WHERE 1 ';
     if ($id != '') {
         $condition .= " AND id = '{$id}' ";
     }
     if ($company_name != '') {
         $condition .= " AND company_name = '{$company_name}' ";
     }
     if ($username != '') {
         $condition .= " AND username = '******' ";
     }
     if ($type_id != '') {
         $condition .= " AND type_id = '{$type_id}' ";
     }
     if ($tel != '') {
         $condition .= " AND tel = '{$tel}' ";
     }
     if ($phone != '') {
         $condition .= " AND phone = '{$phone}' ";
     }
     if ($e_mail != '') {
         $condition .= " AND e_mail = '{$e_mail}' ";
     }
     if ($QQ != '') {
         $condition .= " AND QQ = '{$QQ}' ";
     }
     if ($AliIM != '') {
         $condition .= " AND AliIM = '{$AliIM}' ";
     }
     if ($status != '') {
         $condition .= " AND status = '{$status}' ";
     }
     if ($purchaseuser_id != '') {
         $condition .= " AND purchaseuser_id = '{$purchaseuser_id}' ";
     }
     if ($company_id != '') {
         $condition .= " AND company_id = '{$company_id}' ";
     }
     $totalrow = OmAvailableAct::act_getTNameCount('ph_partner', $condition);
     if ($totalrow == 0) {
         $datalist[0] = 0;
         $datalist[1] = '';
         return json_encode($datalist);
     }
     if ($pageSize != 0) {
         $pageindex = $page;
         $limit = " limit " . ($pageindex - 1) * $pagesize . ",{$pagesize}";
         $condition .= $limit;
     }
     $ret = OmAvailableAct::act_getTNameList('ph_partner', '*', $condition);
     if (empty($ret)) {
         $datalist[0] = 0;
         $datalist[1] = '';
         return json_encode($datalist);
     }
     $datalist[0] = count($ret);
     $datalist[1] = $ret;
     return json_encode($datalist);
 }
Example #7
0
 public function view_deleteBlackList()
 {
     $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
     $status = '';
     if (intval($id) == 0) {
         $status = '数据异常,删除失败';
         header("location:index.php?mod=omBlackList&act=getOmBlackList&status={$status}");
         exit;
     }
     $omAvailableAct = new OmAvailableAct();
     $tName = 'om_blacklist';
     $where = "WHERE is_delete=0 and id='{$id}'";
     $count = $omAvailableAct->act_getTNameCount($tName, $where);
     if (!$count) {
         $status = '记录不存在,删除失败';
         header("location:index.php?mod=omBlackList&act=getOmBlackList&status={$status}");
         exit;
     }
     $set = "SET is_delete=1 ";
     $where = "WHERE id='{$id}'";
     $affectRow = $omAvailableAct->act_updateTNameRow($tName, $set, $where);
     if ($affectRow) {
         $status = '删除成功';
     } else {
         $status = '删除失败';
     }
     header("location:index.php?mod=omBlackList&act=getOmBlackList&status={$status}");
 }
Example #8
0
 public function view_getInputList()
 {
     //调用action层, 获取列表数据
     $omAvailableAct = new OmAvailableAct();
     $status = $_GET['status'] ? $_GET['status'] : '';
     $inputName = $_GET['inputName'] ? post_check(trim($_GET['inputName'])) : '';
     $textStatus = $_GET['textStatus'] ? post_check(trim($_GET['textStatus'])) : '';
     $pid = $_GET['pid'] ? post_check(trim($_GET['pid'])) : '';
     $tName = 'pc_archive_input';
     $select = '*';
     $where = 'WHERE 1=1 ';
     if (!empty($inputName)) {
         $where .= "AND inputName='{$inputName}' ";
     }
     if (!empty($textStatus)) {
         $where .= "AND textStatus='{$textStatus}' ";
     }
     if (!empty($pid)) {
         $where .= "AND categoryPath REGEXP '^{$pid}(-[0-9]+)*\$' ";
         //$where .= "AND categoryPath='$pid' ";
     }
     $total = $omAvailableAct->act_getTNameCount($tName, $where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= $page->limit;
     $inputList = $omAvailableAct->act_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=category&act=getCategoryList', 'title' => '类别管理'), array('url' => 'index.php?mod=property&act=getInputList', 'title' => '文本属性列表'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 4);
     $this->smarty->assign('twovar', 43);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', '文本属性列表');
     $this->smarty->assign('status', $status);
     //取得搜索类别的记录
     $pidArr = explode('-', $pid);
     $this->smarty->assign('pidArr', $pidArr);
     $this->smarty->assign('inputList', empty($inputList) ? null : $inputList);
     $this->smarty->display("inputList.htm");
 }
Example #9
0
 public function view_getNoPassSpuList()
 {
     $omAvailableAct = new OmAvailableAct();
     $spu = isset($_GET['spu']) ? post_check($_GET['spu']) : '';
     $purchaseId = isset($_GET['purchaseId']) ? post_check($_GET['purchaseId']) : '';
     $pid = isset($_GET['pid']) ? post_check($_GET['pid']) : '';
     $isCounterAudit = isset($_GET['isCounterAudit']) ? post_check($_GET['isCounterAudit']) : '';
     $tName = 'pc_spu_archive_no_pass_record';
     $select = '*';
     $where = 'WHERE 1=1 ';
     if (!empty($spu)) {
         $where .= "AND spu='{$spu}' ";
     }
     if (!empty($pid)) {
         $where .= "AND categoryPath REGEXP '^{$pid}(-[0-9]+)*\$' ";
     }
     if (intval($purchaseId) != 0) {
         $where .= "AND purchaseId='{$purchaseId}' ";
     }
     if ($isCounterAudit == 1 || $isCounterAudit == 2) {
         $where .= "AND isCounterAudit='{$isCounterAudit}' ";
     }
     $total = $omAvailableAct->act_getTNameCount($tName, $where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= 'order by id desc ';
     $where .= $page->limit;
     $spuNoPassList = $omAvailableAct->act_getTNameList($tName, $select, $where);
     if (!empty($spuNoPassList)) {
         $platformList = getAllPlatformInfo();
         $platformArr = array();
         $spuStatusArr = displayAllSpuStatus();
         foreach ($platformList as $value) {
             $platformArr[$value['id']] = $value['platform'];
         }
         $countSpuNoPass = count($spuNoPassList);
         for ($i = 0; $i < $countSpuNoPass; $i++) {
             $spuNoPassList[$i]['platformName'] = $platformArr[$spuNoPassList[$i]['platformId']];
             $spuNoPassList[$i]['spuStatusName'] = $spuStatusArr[$spuNoPassList[$i]['spuStatus']]['statusName'];
         }
     }
     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=getNoPassSpuList', 'title' => 'SPU审核不通过管理'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 2);
     $this->smarty->assign('twovar', 25);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', 'SPU审核不通过管理');
     //取得搜索类别的记录
     $pidArr = explode('-', $pid);
     $this->smarty->assign('pidArr', $pidArr);
     $this->smarty->assign('spuNoPassList', empty($spuNoPassList) ? null : $spuNoPassList);
     $this->smarty->display("spuNoPassList.htm");
 }
Example #10
0
 public function view_applyTheLineEUBTrackNumber()
 {
     global $memc_obj;
     $OmEUBTrackNumberAct = new OmEUBTrackNumberAct();
     if (isset($_GET) && !empty($_GET)) {
         $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
         $ostatus = isset($_GET['ostatus']) ? $_GET['ostatus'] : '';
         $otype = isset($_GET['otype']) ? $_GET['otype'] : '';
     }
     $showerrorinfo = '';
     //print_r($_POST);
     if (isset($_FILES) && !empty($_FILES)) {
         $info = $OmEUBTrackNumberAct->act_applyTheLineEUBTrackNumber();
         if ($info) {
             $showerrorinfo = "<font color=\"green\">上传成功!<br></font><font color=\"red\">" . $OmEUBTrackNumberAct::$errMsg . "</font>";
         } else {
             $showerrorinfo = "<font color=\"red\">上传成功!<br>" . $OmEUBTrackNumberAct::$errMsg . "</font>";
         }
     }
     $this->smarty->assign('showerrorinfo', $showerrorinfo);
     $omAvailableAct = new OmAvailableAct();
     //平台信息
     $platform = $omAvailableAct->act_getTNameList('om_platform', 'id,platform', 'WHERE is_delete=0');
     //var_dump($platform);
     $platformList = array();
     foreach ($platform as $v) {
         $platformList[$v['id']] = $v['platform'];
     }
     $this->smarty->assign('platformList', $platformList);
     /**导航 start**/
     $this->smarty->assign('ostatus', $ostatus);
     $this->smarty->assign('otype', $otype);
     //二级目录
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $ostatus . '" AND is_delete=0');
     //var_dump($otypeList);
     $this->smarty->assign('otypeList', $otypeList);
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         $accountacc = $_SESSION['accountacc'];
         $oc_where = " where orderStatus='{$orderStatus}' and storeId=1 and is_delete=0 ";
         if ($accountacc) {
             $oc_where .= ' AND (' . $accountacc . ') ';
         }
         $s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $oc_where);
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$orderStatus}' order by sort asc");
         $second_type[$o_secondinfo['statusCode']] = $s_type[0]['statusCode'];
     }
     //var_dump($second_count);
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     $refund_total = $omAvailableAct->act_getTNameCount("om_order_refund", " where is_delete=0");
     $this->smarty->assign('refund_total', $refund_total);
     //三级目录
     $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $three_count = array();
     foreach ($o_threelevel as $o_threeinfo) {
         $orderType = $o_threeinfo['statusCode'];
         $s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", " where orderStatus='{$ostatus}' and orderType='{$orderType}' and storeId=1 and is_delete=0");
         $three_count[$o_threeinfo['statusCode']] = $s_total;
     }
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '订单显示页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0 ');
     $this->smarty->assign('statusMenu', $statusMenu);
     //var_dump($data); exit;
     $this->smarty->display('eubTheLineApply.htm');
 }