本文整理汇总了PHP中global_common::cutString2方法的典型用法代码示例。如果您正苦于以下问题:PHP global_common::cutString2方法的具体用法?PHP global_common::cutString2怎么用?PHP global_common::cutString2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类global_common
的用法示例。
在下文中一共展示了global_common::cutString2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStoreByIDs
public function getStoreByIDs($arrIDs)
{
$arrIDs = global_common::splitString($arrIDs);
$strQueryIN = global_common::convertToQueryIN($arrIDs);
if ($strQueryIN) {
$strQueryIN = global_mapping::StoreID . ' IN (' . $strQueryIN . ')';
} else {
$strQueryIN = '1=1';
}
$whereClause = 'WHERE ' . $strQueryIN;
$strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_STORE, $whereClause . ' ' . ' limit 0,' . self::NUM_PER_PAGE));
//echo $strSQL;
$arrResult = $this->_objConnection->selectCommand($strSQL);
if (!$arrResult) {
global_common::writeLog('get getProductByIDs:' . $strSQL, 1, $_mainFrame->pPage);
return null;
}
$objCity = new Model_City($this->_objConnection);
$objDistrict = new Model_District($this->_objConnection);
$tempVarCities = $objCity->getAllCity();
$allCities = null;
foreach ($tempVarCities as $key => $info) {
$allCities[$info[global_mapping::CityID]] = $info;
unset($tempVarCities[$key]);
}
$tempDistricts = $objDistrict->getAllDistrict();
$allDistricts = null;
foreach ($tempDistricts as $key => $info) {
$allDistricts[$info[global_mapping::DistrictID]] = $info;
unset($tempDistricts[$key]);
}
// print_r($allDistricts);
// return;
$count = count($arrResult);
$objArticle = new Model_Article($this->_objConnection);
for ($i = 0; $i < $count; $i++) {
//echo $arrResult;
//print_r( $allCities);
//$arrResult[$i][global_mapping::CityID] = $allCities[$arrResult[$i][global_mapping::CityID]];
$arrResult[$i][global_mapping::CityName] = $allCities[$arrResult[$i][global_mapping::CityID]][global_mapping::CityName];
// print_r($arrResult[$i]);
//return;
// print_r($allCities[$arrResult[$i][global_mapping::CityID]]);
//break;
$arrResult[$i][global_mapping::DistrictName] = $allDistricts[$arrResult[$i][global_mapping::DistrictID]][global_mapping::DistrictName];
$arrResult[$i][global_mapping::Latitude] = global_common::convertToDecimal($arrResult[$i][global_mapping::Latitude]);
$arrResult[$i][global_mapping::Longitude] = global_common::convertToDecimal($arrResult[$i][global_mapping::Longitude]);
$arrArticle = $objArticle->getArticleByStoreID($arrResult[$i][global_mapping::StoreID]);
$shortDescription = global_common::formatPlanText($arrArticle[0][global_mapping::Content]);
$arrResult[$i][global_mapping::Content] = global_common::cutString2($shortDescription, 0, 16);
// print_r($arrResult[$i]);
//echo $arrResult[$i][global_mapping::DistrictID];
//echo $allDistricts[$arrResult[$i][global_mapping::DistrictID]][global_mapping::DistrictName];
//print_r($allDistricts);
//return ;
}
//print_r($stores);
return $arrResult;
}