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