本文整理汇总了PHP中DBQuery::loadArrayList方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::loadArrayList方法的具体用法?PHP DBQuery::loadArrayList怎么用?PHP DBQuery::loadArrayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBQuery
的用法示例。
在下文中一共展示了DBQuery::loadArrayList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$sql = $q->prepare();
$q->clear();
$company_name = db_loadResult($sql);
if (!$dept_id && $company_name === null) {
$AppUI->setMsg('badCompany', UI_MSG_ERROR);
$AppUI->redirect();
}
// collect all the departments in the company
$depts = array(0 => '');
if ($company_id) {
$q = new DBQuery();
$q->addTable('departments', 'dep');
$q->addQuery('dept_id, dept_name, dept_parent');
$q->addWhere('dep.dept_company = ' . $company_id);
$q->addWhere('dep.dept_id != ' . $dept_id);
$depts = $q->loadArrayList();
$depts['0'] = array(0, '- ' . $AppUI->_('Select Unit') . ' -', -1);
}
// collect all the users for the department owner list
$q = new DBQuery();
$q->addTable('users', 'u');
$q->addTable('contacts', 'con');
$q->addQuery('user_id');
$q->addQuery('CONCAT_WS(", ",contact_last_name, contact_first_name)');
$q->addOrder('contact_first_name');
$q->addWhere('u.user_contact = con.contact_id');
$q->addOrder('contact_last_name, contact_first_name');
$owners = arrayMerge(array('0' => ''), $q->loadHashList());
// setup the title block
$ttl = $company_id > 0 ? "Edit Department" : "Add Department";
$titleBlock = new CTitleBlock($ttl, 'users.gif', $m, "{$m}.{$a}");
示例2: getMemberIds
/**
* This function return an array of project member's id
* @return array List of users' id who are working in this project
*/
function getMemberIds()
{
if ($this->project_id > 0) {
$q = new DBQuery();
$q->addTable('project_contacts');
$q->addQuery('contact_id');
$q->addWhere('project_id = ' . $this->project_id);
return $q->loadArrayList();
}
return array();
}