function chathistory()
 {
     $page_num = 10;
     V('db/mongo');
     $db = mongoApi::getInstance('db/mongo_service');
     $clientid = $this->_get('clientid', '');
     $serverid = $this->_get('serverid', '');
     $page = $this->_getid('p', 1);
     if (!empty($clientid) && !empty($serverid)) {
         $ret = $db->table('chats')->find(array("clientid" => $clientid, "serverid" => $serverid), array(), $page_num);
         if (!empty($ret) || count($ret) > 0) {
             $tmp_ret = $ret['contents'];
             $allchats = array();
             foreach ($tmp_ret as $key => $value) {
                 $allchats[$value['time']] = $value;
             }
             krsort($allchats, SORT_NUMERIC);
             $chats = array_slice($allchats, ($page - 1) * $page_num, $page_num);
             $sortedchats = array();
             foreach ($chats as $key => $value) {
                 $sortedchats[$value['time']] = $value;
             }
             ksort($sortedchats, SORT_NUMERIC);
             $this->assign(array("chats" => $sortedchats, "total" => count($ret['contents']), "page" => $page, "pageshow" => $page_num, "servername" => $ret['servername'], "clientname" => $ret['clientname']));
             $this->display();
         } else {
             echo '无聊天记录';
         }
     } else {
         echo 'null';
     }
 }
 function logdetail()
 {
     $id = $this->_get('id');
     if (!$id) {
         $this->returnJson = true;
         showError('参数丢失');
     }
     V('db/mongo');
     $db = mongoApi::getInstance();
     $data = $db->table('steadminLog')->where(array('_id' => $db->getId($id)))->find();
     if ($data) {
         unset($data['_id']);
         $data['infotime'] = outTime($data['infotime']);
     }
     $this->assign(array('rs' => $data));
     $this->display();
 }
 function __construct()
 {
     parent::__construct();
     $this->config = C('app/index_' . $this->city_id);
     $this->cate = $this->config['cate'];
     $this->device = $this->config['device'];
     $this->template = $this->config['template'];
     $this->moduletips = $this->config['moduletips'];
     $this->module = $this->config['module'];
     $imagescale = array(2 => 1.42, 3 => 1.77, 4 => 1.94);
     //$this->assign(array('imagescale' => $imagescale));
     $this->service = F('steward/service_city_' . $this->city_id);
     if (!$this->service) {
         $this->service = M('ste_service')->field('`sid`,`stitle`')->where(array('city_id' => $this->city_id))->findAll(false);
     }
     $this->cateList = $this->goodsCateCache($this->city_id);
     V('db/mongo');
     $this->mongo = mongoApi::getInstance();
 }