Exemplo n.º 1
0
require 'config/globalconfig.php';
include_once 'class/model_articletype.php';
include_once 'class/model_product.php';
include_once 'class/model_user.php';
include_once 'class/model_article.php';
include_once 'class/model_manufactory.php';
include_once 'class/model_property.php';
include_once 'class/model_productproperty.php';
include_once 'class/model_propertygroup.php';
include_once 'class/model_datatype.php';
include_once 'class/model_adtype.php';
include_once 'class/model_city.php';
//get catId from _article.inc
//$catID = $_pgR['cid'];
$objCity = new Model_City($objConnection);
$allCities = $objCity->getAllCity();
$page = $_pgR["p"] ? $_pgR["p"] : 1;
if (!$_pgR["cid"]) {
    global_common::redirectByScript("index.php");
}
$keyword = $_pgR['kw'];
$objArticleType = new model_ArticleType($objConnection);
$objProduct = new Model_Product($objConnection);
$objProductProperty = new Model_ProductProperty($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
$catID = $_pgR['cid'];
//Just get from "article_list.php"
//$district = $_pgR['ds'];
$keyword = $_pgR['kw'];
$manu = $_pgR['manu'];
$properties = $_pgR['property'];
Exemplo n.º 2
0
 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;
 }