當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBQuery::loadArrayList方法代碼示例

本文整理匯總了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}");
開發者ID:juliogallardo1326,項目名稱:proc,代碼行數:31,代碼來源:addedit.php

示例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();
 }
開發者ID:n2i,項目名稱:xvnkb,代碼行數:15,代碼來源:projects.class.php


注:本文中的DBQuery::loadArrayList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。