/** * MD and PV * Returns an associative array of rating_codes from the rating table * Usage: ApproveArtifactForm */ public function GetRatingCodes() { $select = $this->user->select() ->from('rating', 'rating_code') ->setIntegrityCheck(false); $rowset = $this->user->fetchAll($select)->toArray(); return $rowset; }
public function actionPsdLink() { $this->_modelLyPsdLink = $this->_getGlobalData('Model_LyPsdLink', 'object'); $gameTypes = $this->_modelLyPsdLink->getMyGame(); $this->_loadCore('Help_SqlSearch'); $helpSqlSearch = new Help_SqlSearch(); $helpSqlSearch->set_tableName($this->_modelLyPsdLink->tName()); $_GET['game_type_id'] = intval($_GET['game_type_id']); if ($_GET['game_type_id']) { $helpSqlSearch->set_conditions("game_type_id={$_GET['game_type_id']}"); } else { $InData = array_keys($gameTypes); $InData = implode(',', $InData); $helpSqlSearch->set_conditions("game_type_id in ({$InData})"); } $StartTime = strtotime($_GET['start_time']); if ($StartTime) { $helpSqlSearch->set_conditions("edit_time>={$StartTime}"); } $EndTime = strtotime($_GET['end_time']); if ($EndTime) { $helpSqlSearch->set_conditions("edit_time<={$EndTime}"); } $helpSqlSearch->set_orderBy('Id desc'); $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE); $sql = $helpSqlSearch->createSql(); $dataList = $this->_modelLyPsdLink->select($sql); foreach ($dataList as &$sub) { $sub['game_type'] = $gameTypes[$sub['game_type_id']]; $sub['edit'] = Tools::url(CONTROL, 'PsdLinkOpt', array('zp' => 'LianYun', 'Id' => $sub['Id'], 'doaction' => 'edit')); $sub['del'] = Tools::url(CONTROL, 'PsdLinkOpt', array('zp' => 'LianYun', 'Id' => $sub['Id'], 'doaction' => 'del')); } $conditions = $helpSqlSearch->get_conditions(); $this->_loadCore('Help_Page'); //载入分页工具 $helpPage = new Help_Page(array('total' => $this->_modelLyPsdLink->findCount($conditions), 'perpage' => PAGE_SIZE)); $this->_view->assign('pageBox', $helpPage->show()); $this->_view->assign('dataList', $dataList); $gameTypes[0] = Tools::getLang('ALL', 'Common'); $this->_view->assign('gameTypes', $gameTypes); $this->_view->assign('selected', $_GET); $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }
private function _spActivityIndex() { #------初始化------# $this->_createServerList(); $serverList = $this->_getGlobalData('gameser_list'); $this->_modelFrgSpecialActivity = $this->_getGlobalData('Model_HaiDaoSpecialActivity', 'object'); $this->_loadCore('Help_SqlSearch'); $this->_loadCore('Help_Page'); #------初始化------# $helpSqlSearch = new Help_SqlSearch(); $helpSqlSearch->set_tableName($this->_modelFrgSpecialActivity->tName()); $_REQUEST['operator_id'] = intval($_REQUEST['operator_id']); if ($_REQUEST['operator_id']) { $helpSqlSearch->set_conditions("operator_id={$_REQUEST['operator_id']}"); $this->_view->assign('selectedOperatorId', $_REQUEST['operator_id']); } if ($_REQUEST['title']) { $helpSqlSearch->set_conditions("(Title like '%{$_REQUEST['title']}%' )"); $this->_view->assign('selectedTitle', $_REQUEST['title']); } if ($_REQUEST['is_group']) { // $helpSqlSearch->set_groupBy('Title,IdentifierValue,StartTime,EndTime'); $helpSqlSearch->set_groupBy('Title,IdentifierValue'); $helpSqlSearch->set_field('count(*) as server_num,Id,operator_id,server_id,special_activity_id,Identifier,IdentifierValue,Img,IsOpen,Title,Content,AwardDesc,StartTime,EndTime,CheckType,AwardIds,Awards,GetCond,Status,MsgTitle,MsgContent,MsgContent,IsShow'); $this->_view->assign('selectedGroupBy', true); } $open = array('0' => Tools::getLang('CLOSE', 'Common'), '1' => Tools::getLang('OPEN', 'Common')); $show = array('0' => Tools::getLang('NOT_DISPLAY', 'Common'), '1' => Tools::getLang('DISPLAY', 'Common')); $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE); $helpSqlSearch->set_orderBy('server_id'); $conditions = $helpSqlSearch->get_conditions(); $sql = $helpSqlSearch->createSql(); $dataList = $this->_modelFrgSpecialActivity->select($sql); if ($dataList) { foreach ($dataList as $key => &$val) { $val['URL_edit'] = Tools::url(CONTROL, ACTION, array('zp' => self::PACKAGE, 'doaction' => 'edit', 'title' => $val['Title'], 'IdentifierValue' => $val['IdentifierValue'], 'StartTime' => $val['StartTime'], 'EndTime' => $val['EndTime'], 'operator_id' => $_REQUEST['operator_id'], 'server_id' => $val['server_id'], 'special_activity_id' => $val['special_activity_id'])); } } $serverListFullName = Model::getTtwoArrConvertOneArr($serverList, 'Id', 'full_name'); $this->_view->assign('serverListFullName', $serverListFullName); if ($_REQUEST['is_group']) { $FiledGroupBy = $helpSqlSearch->getFiledGroupBy(); $count = $this->_modelFrgSpecialActivity->countGroupBy($conditions, $FiledGroupBy); } else { $count = $this->_modelFrgSpecialActivity->findCount($conditions); } $helpPage = new Help_Page(array('total' => $count, 'perpage' => PAGE_SIZE)); $this->_view->assign('pageBox', $helpPage->show()); $this->_view->assign('tplServerSelect', 'Notice/MultiServerSelect.html'); $this->_view->assign('dataList', $dataList); $this->_view->assign('is_open', $open); $this->_view->assign('is_show', $show); $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }
/** * 获取带where_in条件的数据,并分组 * @param array $cwhere * @param array $where_in */ public function get_group_where_in($cwhere = NULL, $where_in = NULL, $group = NULL) { $this->db->select($this->cols, $this->colsFormat); $this->db->from($this->table); foreach ($this->join as $ajoin) { $this->db->join($ajoin['table'], $ajoin['where'], $ajoin['type']); } if ($cwhere) { $this->db->where($cwhere); } if ($where_in) { $this->db->where_in($where_in['column'], $where_in['$arr']); } $this->initialize(); $this->db->group_by($group); $this->clear(); return $this->db->get(); }
/** * Method to getSelect query * @param unknown_type $query */ protected function getSelectQuery(&$query) { $query->select("payment.extension_id,payment.name,payment.type,payment.folder,payment.element,payment.params,payment.enabled,payment.ordering")->from("#__extensions as payment"); }
/** * Method to getSelect query * @param unknown_type $query */ protected function getSelectQuery(&$query) { $query->select("app.extension_id,app.name,app.type,app.folder,app.element,app.params,app.enabled,app.ordering, app.manifest_cache")->from("#__extensions as app"); }
/** * Add the specified page to the specified tree * Remember to also call StructuredData::addWatch if you call this function * * @param unknown_type $dbw * @param unknown_type $treeId * @param unknown_type $title * @param unknown_type $revid * @param unknown_type $talkRevid * @param unknown_type $dataVersion * @param unknown_type $uid * @param unknown_type $flags * @return unknown */ public static function addPage($dbw, &$user, $treeId, $title, $revid, $talkRevid, $dataVersion = 0, $uid = '', $flags = 0) { $result = true; // should this be the primary person? // TODO get rid of this test - the primary person can be set when the user opens the tree for the first time if ($title->getNamespace() == NS_PERSON) { $res = $dbw->select('familytree_page', 'fp_title', array('fp_tree_id' => $treeId, 'fp_namespace' => NS_PERSON), 'FamilyTreeUtil::addPage', array('LIMIT' => 1)); if ($res === false || !$dbw->numRows($res)) { // make this person the primary page if it's the first person $dbw->update('familytree', array('ft_primary_namespace' => $title->getNamespace(), 'ft_primary_title' => $title->getDBkey()), array('ft_tree_id' => $treeId)); FamilyTreeUtil::deleteFamilyTreesCache($user->getName()); $errno = $dbw->lastErrno(); if ($errno > 0) { $result = false; } } $dbw->freeResult($res); } // insert familytree_page $record = array('fp_tree_id' => $treeId, 'fp_user_id' => $user->getID(), 'fp_namespace' => $title->getNamespace(), 'fp_title' => $title->getDBkey(), 'fp_oldid' => $revid, 'fp_latest' => $revid, 'fp_talk_oldid' => $talkRevid, 'fp_talk_latest' => $talkRevid, 'fp_data_version' => $dataVersion, 'fp_uid' => $uid, 'fp_flags' => $flags); $dbw->insert('familytree_page', $record, 'FamilyTreeUtil::addPage', array('ignore')); $errno = $dbw->lastErrno(); if ($errno != 0 && $errno != 1062) { // 1062 = duplicate key $result = false; } return $result; }
/** * Method to getSelect query * @param unknown_type $query */ protected function getSelectQuery(&$query) { $query->select("shipping.extension_id,shipping.name,shipping.type,shipping.folder,shipping.element,shipping.params,shipping.enabled,shipping.ordering")->from("#__extensions as shipping"); }
/** * Method to getSelect query * @param unknown_type $query */ protected function getSelectQuery(&$query) { $query->select("report.extension_id,report.name,report.type,report.folder,report.element,report.params,report.enabled,report.ordering")->from("#__extensions as report"); }