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