Ejemplo n.º 1
0
 public function view_categoryListAli()
 {
     /* -----  获取全部的分类列表  -----*/
     $msgcat_obj = new messagecategoryModel();
     $lp_ojb = new LocalPowerModel();
     $powerlist = $lp_ojb->getAliPowerlist($_SESSION['userId']);
     // print_r($powerlist);exit;
     if (empty($powerlist['field'])) {
         $filsql = '0';
     } else {
         $filsql = implode(', ', $powerlist['field']);
     }
     //echo $filsql;exit;
     $arrlist = $msgcat_obj->getAllCategoryInfoList(' and id in (' . $filsql . ') and platform=2 order by category_name');
     $msg_obj = new AliOderMessageModel();
     foreach ($arrlist as &$listval) {
         /* ---- 计算某个分类下已经读取的数量 <订单留言>  ---- */
         $replyed_num_order = $msg_obj->culculateNumberOrder(" and fieldId={$listval['id']} and hasread=1");
         $listval['replyed_order'] = $replyed_num_order;
         /* ---- 计算某个分类下未读的数量  <订单留言>---- */
         $noreply_num_order = $msg_obj->culculateNumberOrder(" and fieldId={$listval['id']} and hasread=0");
         $listval['noreply_order'] = $noreply_num_order;
         /* ---- 计算某个分类下已读的数量 <站内信>  ---- */
         $replyed_num_site = $msg_obj->culculateNumberSite(" and fieldId={$listval['id']} and hasread=1");
         $listval['replyed_site'] = $replyed_num_site;
         /* ---- 计算某个分类下未读的数量  <站内信>---- */
         $noreply_num_site = $msg_obj->culculateNumberSite(" and fieldId={$listval['id']} and hasread=0");
         $listval['noreply_site'] = $noreply_num_site;
     }
     $this->smarty->assign('sec_menue', 2);
     $this->smarty->assign('toplevel', 1);
     $this->smarty->assign('categorylist', $arrlist);
     $this->smarty->assign('toptitle', 'message类别列表-速卖通');
     $this->smarty->display('msgcategorylistAli.htm');
 }
Ejemplo n.º 2
0
 public function view_aliShipingTemplate()
 {
     $lp_obj = new LocalPowerModel();
     $powerlist = $lp_obj->getAliPowerlist($_SESSION['userId']);
     $accountlist = $lp_obj->getAccountListByCatList($powerlist[field]);
     $accountlist[] = -1;
     $condition_sql = implode("' , '", $accountlist);
     $condition = " and account in ('{$condition_sql}')";
     $shipTplMod_obj = new AliShipTemplateModel();
     $tplList = $shipTplMod_obj->getAllTemplateInfoList($condition);
     $aliaccount_obj = new AliAccountModel();
     foreach ($tplList as &$tval) {
         $tval['accountname'] = $aliaccount_obj->accountId2Name($tval['account']);
     }
     $this->smarty->assign('tpllist', $tplList);
     $this->smarty->assign('addurl', 'index.php?mod=messageTemplate&act=aliAddNewShipTemplate');
     $this->smarty->assign('toplevel', 2);
     $this->smarty->assign('sec_menue', 4);
     $this->smarty->assign('toptitle', 'message模板列表');
     $this->smarty->assign('third_menue', 1);
     $this->smarty->display('alishiptpl.htm');
 }
Ejemplo n.º 3
0
 public function view_getAliOrderList_site()
 {
     $keywords = isset($_GET['keywords']) ? trim($_GET['keywords']) : '';
     //关键字
     $keywords = mysql_real_escape_string($keywords);
     $account = isset($_GET['account']) ? intval($_GET['account']) : '';
     //销售账号
     $status = isset($_GET['status']) ? $_GET['status'] : FALSE;
     //回复状态
     $category = isset($_GET['catid']) ? intval($_GET['catid']) : FALSE;
     //分类
     $senderId = isset($_GET['senderid']) ? trim($_GET['senderid']) : FALSE;
     //发送人id
     $orderId = isset($_GET['orderid']) ? trim($_GET['orderid']) : FALSE;
     //订单号
     $prodname = isset($_GET['prodname']) ? trim($_GET['prodname']) : FALSE;
     //差评名称
     $cat_obj = new messagecategoryModel();
     /*----- 获得用户所属文件夹 -----*/
     $Lp_obj = new LocalPowerModel();
     $fieldid = $Lp_obj->getAliPowerlist($_SESSION['userId']);
     //获得当前用户所属的id
     $fieldid = isset($fieldid['field']) ? $fieldid['field'] : array(-1);
     $category = in_array($category, $fieldid) ? $category : -1;
     /*----- 获得用户所属文件夹 -----*/
     if (!empty($fieldid)) {
         $powerlist = $cat_obj->getFieldInfoByIds($fieldid, ' order by category_name');
     } else {
         $powerlist = array();
     }
     $wheresql = '';
     if (!empty($keywords)) {
         //是否指定keywords
         $wheresql .= " and senderid='{$keywords}' ";
     }
     if ($status !== FALSE) {
         //指定状态
         switch ($status) {
             case 1:
                 //回复完成
                 $wheresql .= " and status in (2,3)";
                 break;
             case 2:
                 //未回复
                 $wheresql .= " and status=0 ";
                 break;
             case 3:
                 //回复中
                 $wheresql .= " and status=1 ";
                 break;
             case 4:
                 //回复失败
                 $wheresql .= " and status=4 ";
                 break;
             default:
                 $wheresql .= "";
                 break;
         }
     }
     if ($category !== false) {
         if ($category == -1) {
             $class_sql = implode(', ', $fieldid);
             $wheresql .= " and fieldId in ({$class_sql})";
         } else {
             $wheresql .= " and  ={$category}";
         }
     } else {
         $class_sql = implode(', ', $fieldid);
         $wheresql .= " and fieldId in ({$class_sql}) ";
     }
     $pagesize = 100;
     $msg_obj = new messageModel();
     $mount = $msg_obj->getCountNumberByConditions_aliOrder($wheresql);
     $page_obj = new Page($mount, $pagesize);
     $usercache = new UserCacheModel();
     $msglist = $msg_obj->getMessageListByConditions_aliorder($wheresql . ' order by createtimestr ' . $page_obj->limit);
     $aliAcc_ojb = new AliAccountModel();
     /* --- 格式化数据 ---*/
     foreach ($msglist as &$msgitem) {
         $catinfo = $cat_obj->getCategoryInfoById($msgitem['fieldId']);
         $msgitem['classname'] = $catinfo['category_name'];
         $userinfo = empty($msgitem['replyuser_id']) ? array('userName' => '') : $usercache->getUserInfoBySysId($msgitem['replyuser_id'], 0);
         $msgitem['username'] = $userinfo['userName'];
         $msgitem['retime'] = $msgitem['replytime'] ? date("Y-m-d \n H:i:s", $msgitem['replytime']) : '';
         $msgitem['accname'] = $aliAcc_ojb->accountId2Name();
     }
     if ($mount > $pagesize) {
         //分页
         $pagestr = $page_obj->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $page_obj->fpage(array(0, 2, 3));
     }
     //         print_r($msglist);exit;
     /*----- 获得分类文件夹列表 -----*/
     $categorylist = $cat_obj->getAllCategoryInfoList(' and is_delete=0', 2);
     //         print_r($categorylist);
     $this->smarty->assign('catlist', $categorylist);
     /*----- 获得分类列表 -----*/
     $this->smarty->assign('third_menue', 1);
     $this->smarty->assign('powerlist', $powerlist);
     $this->smarty->assign('from', $from);
     $this->smarty->assign('sec_menue', 4);
     $this->smarty->assign('toplevel', 0);
     $this->smarty->assign('keywords', $keywords);
     $this->smarty->assign('category', $category);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign('msglist', $msglist);
     $this->smarty->assign('categorylist', $arrlist);
     $this->smarty->assign('toptitle', 'message列表');
     $this->smarty->display('msglistaliorder.htm');
 }