/** * 获取联系人的信息 * * @access public * @param int $userId * @return array */ public function getContactProfile($userId) { $userProfile = $this->userModel->get($userId); $userTagList = $this->userModel->getUserTagList($userId); foreach ($userTagList as &$value) { $value = '<span>#' . $value['tagName'] . '</span>'; } $acctionList = $this->userModel->getAcctionList($userId); foreach ($acctionList as &$acctionIndex) { $acctionIndex = '<a href="">' . $acctionIndex . '</a>'; } return array('id' => $userId, 'username' => $userProfile[0]['nickname'], 'phoneNum' => $userProfile[0]['phone_num'], 'userProfile' => $userProfile[0]['userProfile'], 'tagList' => implode(' ', $userTagList), 'acctionList' => implode(',', $acctionList)); }
private function getUserProjectId($userId) { $this->userModel = F::load_model('user', array()); $allUserTag = $this->userModel->getUserTagList($userId); $retuanData = array(); foreach ($allUserTag as $value) { if ($value['type'] == 2) { $retuanData[] = $value['tagId']; } } unset($allUserTag); return $retuanData; }
/** * 获取创建事件统计信息 * * @return array */ public function event() { $statisticsResult = F::db()->fetch_all('select count(id) as num, create_user_id as userId from event where status = 1 and type != 1 group by create_user_id '); foreach ($statisticsResult as &$value) { #删除脚本倒入数据 if ($value['userId'] == 1) { $value['num'] = $value['num'] - 5260 > 0 ? $value['num'] - 5260 : $value['num']; } $userInfo = $this->userModel->get($value['userId']); $value['userInfo'] = $userInfo; $projectInfo = $this->userModel->getUserTagList($value['userId']); $value['projectInfo'] = array(); foreach ($projectInfo as $projectInfoIndex) { if ($projectInfoIndex['type'] == 2 || $projectInfoIndex['type'] == 3) { $value['projectInfo'][] = array('tagId' => $projectInfoIndex['tagId'], 'name' => $projectInfoIndex['tagName']); } } unset($projectInfo); $value['weekNum'] = $this->getEventNumByWeek($value['userId']); $value['createContentNumByWeek'] = $this->getCreateContentNumByWeek($value['userId']); $value['createGroupNumByWeek'] = $this->getCreateGroupByWeek($value['userId']); } return $this->multi_array_sort($statisticsResult, 'weekNum', SORT_DESC); }