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


PHP global_common::getTableSuffixByAlphabet方法代碼示例

本文整理匯總了PHP中global_common::getTableSuffixByAlphabet方法的典型用法代碼示例。如果您正苦於以下問題:PHP global_common::getTableSuffixByAlphabet方法的具體用法?PHP global_common::getTableSuffixByAlphabet怎麽用?PHP global_common::getTableSuffixByAlphabet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在global_common的用法示例。


在下文中一共展示了global_common::getTableSuffixByAlphabet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getUserDetailByMultiTable

 /**
  * lấy thông tin detail của một vài c_user,c_user_detail
  *
  * @param string $userList danh sách các id c_user
  * @param object $objConnection connect to db
  * @param string $selectField các cột sẽ lấy dữ liệu về
  * @return array thông tin các user
  * GiaTran
  */
 private function getUserDetailByMultiTable($userList, $objConnection, $selectField = '*')
 {
     // build group table - optimize select query
     $userList = global_common::splitString($userList);
     //print_r($userList);
     $arrDocInTable = array();
     foreach ($userList as $key) {
         $suffix = global_common::getTableSuffixByAlphabet($key);
         $arrDocInTable[$suffix] .= '\'' . $key . '\',';
     }
     foreach ($arrDocInTable as $iDoc) {
         $key = global_common::getTableSuffixByAlphabet(substr($iDoc, 1, 2));
         $arrDocInTable[$key] = global_common::cutLast($iDoc, 1);
         $tbName = global_common::builtTableName(Model_User::TBL_SL_USER, $key);
         $selectField = '*';
         $strSQL .= "(" . global_common::prepareQuery(global_common::SQL_SELECT_BY_CONDITION1, array($selectField, $tbName, '`UserID` IN (' . $arrDocInTable[$key] . ')')) . ') UNION ALL ';
     }
     if ($strSQL != '') {
         $strSQL = substr($strSQL, 0, strlen($strSQL) - strlen(' UNION ALL '));
     }
     if ($selectField == '') {
         $strSQL = '(select * from (' . $strSQL . ') as tbl_user)';
     } else {
         $strSQL = '(select ' . $selectField . ' from (' . $strSQL . ') as tbl_user)';
     }
     //echo $strSQL;
     return $objConnection->selectCommand($strSQL);
 }
開發者ID:vietlethanh,項目名稱:KooKooBackEnd,代碼行數:37,代碼來源:global_common.php


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