本文整理匯總了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();
}