Beispiel #1
0
 public function aGetRoleList($iStart, $iLength, $flag = null)
 {
     $option = new Ko_Tool_SQL();
     $option->oOffset($iStart)->oLimit($iLength)->oCalcFoundRows(true);
     $option->oOrderBy('ctime desc');
     if (is_int($flag)) {
         $option->oWhere('flag = ?', $flag);
     }
     $aData = $this->aGetList($option);
     $aResult['total'] = $option->iGetFoundRows();
     $aResult['list'] = $aData;
     return $aResult;
 }
Beispiel #2
0
 /**
  * 用户查看会话消息列表详情,根据消息线id查询
  *
  * @return array
  */
 public function aGetMessageListWithTotal($iUid, $iThread, &$iTotal, $iStart, $iNum, $bAutoRead = true)
 {
     if (isset($this->_aConf['userthread'])) {
         $userthreadDao = $this->_aConf['userthread'] . 'Dao';
         $info = $this->{$userthreadDao}->aGet(array('uid' => $iUid, 'mid' => $iThread));
         if (empty($info)) {
             return array();
         }
         if ($bAutoRead && $info['unread']) {
             $this->{$userthreadDao}->iUpdate(array('uid' => $iUid, 'mid' => $iThread), array('unread' => 0));
         }
     }
     $oOption = new Ko_Tool_SQL();
     if (isset($this->_aConf['userthread'])) {
         $oOption->oWhere('ctime >= ?', $info['jointime']);
     }
     $oOption->oOrderBy('mid desc')->oOffset($iStart)->oLimit($iNum)->oCalcFoundRows(true);
     $aRet = $this->_aGetMessageList($iUid, $iThread, $oOption);
     $iTotal = $oOption->iGetFoundRows();
     return $aRet;
 }
Beispiel #3
0
 private function _aGetAll_Exkey($aExkeyConf, $vHintId)
 {
     $exkeyDao = $aExkeyConf['dao'] . 'Dao';
     $oOption = new Ko_Tool_SQL();
     $oOption->oOrderBy($aExkeyConf['order']);
     if (!empty($aExkeyConf['option'])) {
         call_user_func_array(array($oOption, 'oAnd'), $aExkeyConf['option']);
     }
     if (strlen($this->{$exkeyDao}->sGetSplitField())) {
         return $this->{$exkeyDao}->aGetList($vHintId, $oOption);
     }
     return $this->{$exkeyDao}->aGetList($oOption);
 }
Beispiel #4
0
 /**
  * 查询关注用户 B 的用户列表
  *
  * @return array
  */
 public function aGetFollowedListWithTotal($iUidb, $iStart, $iNum, &$iTotal)
 {
     $oOption = new Ko_Tool_SQL();
     $oOption->oOrderBy('sort desc')->oOffset($iStart)->oLimit($iNum)->oCalcFoundRows(true);
     $info = $this->_aGetFollowedList($iUidb, $oOption);
     $iTotal = $oOption->iGetFoundRows();
     return $info;
 }
Beispiel #5
0
 /**
  * 同步监控代码到当前所有服务器列表
  */
 public function vSyncAllIp()
 {
     $ipApi = $this->_aConf['ipApi'];
     $option = new Ko_Tool_SQL();
     $iplist = $this->{$ipApi}->aGetList($option->oOrderBy('ip'));
     foreach ($iplist as $ipinfo) {
         $ip = long2ip($ipinfo['ip']);
         $this->vSyncOneIp($ip);
     }
 }
Beispiel #6
0
 /**
  * 用户查看会话消息列表详情,根据最小id查询
  *
  * @return array
  */
 public function aGetMessageListByMinmid($iUid, $iThread, $iMinmid, $iNum)
 {
     if (isset($this->_aConf['userthread'])) {
         $userthreadDao = $this->_aConf['userthread'] . 'Dao';
         $info = $this->{$userthreadDao}->aGet(array('uid' => $iUid, 'mid' => $iThread));
         if (empty($info)) {
             return array();
         }
         if ($info['unread']) {
             $this->{$userthreadDao}->iUpdate(array('uid' => $iUid, 'mid' => $iThread), array('unread' => 0));
         }
     }
     $oOption = new Ko_Tool_SQL();
     if (isset($this->_aConf['userthread'])) {
         $oOption->oWhere('ctime >= ?', $info['jointime']);
     }
     $listDao = $this->_aConf['list'] . 'Dao';
     $minfo = $this->{$listDao}->aGet(array('threadmid' => $iThread, 'mid' => $iMinmid));
     if (empty($minfo)) {
         $oOption->oAnd('mid > ?', $iMinmid);
     } else {
         $oOption->oAnd('ctime > ?', $minfo['ctime']);
     }
     $oOption->oOrderBy('ctime desc')->oLimit($iNum);
     return $this->_aGetMessageList($iUid, $iThread, $oOption);
 }