public function index()
 {
     /*$ZhixiaCityTwoList=M('common_district')->where(array('level'=>2,'upid in (1,2,9,22)'))->select();
       foreach($ZhixiaCityTwoList as $k=>$v){
           $CIDList[]=$v['id'];
       }
       $CityThreeList=M('common_district')->where(array('level'=>3,'upid not in ('.implode(',',$CIDList).')'))->select();
       set_time_limit(0);
       foreach($CityThreeList as $k=>$v){
           //$name=str_replace(array('区','县'),'',$v['name']);
           $name=$v['name'];
           $KeyInfo=M('common_district')->where(array('`id` = '.$v['upid'].''))->find();
           $keyname=str_replace(array('区','县','省','市'),'',$KeyInfo['name']);
           $Url='http://localhost/'.U('Mongo/Index/Index').'&name='.urlencode($name).'&keyname='.urlencode($keyname);
           //echo file_get_contents($Url,);die;
           //header('Location:'.$Url);die;
           if(function_exists('file_get_contents')){
               $content=file_get_contents($Url);
           }else if(function_exists('curl_init')){
               $ch = curl_init();
               $timeout = 5;
               curl_setopt($ch, CURLOPT_URL, $Url);
               curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
               curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
               $content=curl_exec($ch);
               curl_close($ch);
           }else{
               $this->get_admin_msg($_SERVER['HTTP_REFERER'],"请开启CURL模块或者file_get_contents函数");
           }
           //echo $content;die;
       }die;*/
     $categories_tree = $this->get_categories_tree();
     $this->assign('categories', $categories_tree);
     // 分类树
     $navigator_list = $this->get_navigator($ctype, $catlist);
     $this->assign('navigator_list', $navigator_list);
     $category_list = $this->cat_list(0, 0, true, 2, false);
     $this->assign('category_list', $category_list);
     $promotion_info = get_promotion_info();
     $this->assign('promotion_info', $promotion_info);
     $this->assign('shop_notice', C('shop_notice'));
     $new_articles = index_get_new_articles();
     $this->assign('new_articles', $new_articles);
     // 最新文章
     $brand_list = get_brands();
     $this->assign('brand_list', $brand_list);
     $this->display();
 }
Example #2
0
 $smarty->assign('top_goods', get_top10());
 // 销售排行
 $smarty->assign('best_goods', get_recommend_goods('best'));
 // 推荐商品
 $smarty->assign('new_goods', get_recommend_goods('new'));
 // 最新商品
 $smarty->assign('hot_goods', get_recommend_goods('hot'));
 // 热点文章
 $smarty->assign('promotion_goods', get_promote_goods());
 // 特价商品
 $smarty->assign('brand_list', get_brands());
 $smarty->assign('promotion_info', get_promotion_info());
 // 增加一个动态显示所有促销信息的标签栏
 $smarty->assign('invoice_list', index_get_invoice_query());
 // 发货查询
 $smarty->assign('new_articles', index_get_new_articles());
 // 最新文章
 $smarty->assign('group_buy_goods', index_get_group_buy());
 // 团购商品
 $smarty->assign('auction_list', index_get_auction());
 // 拍卖活动
 $smarty->assign('shop_notice', $_CFG['shop_notice']);
 // 商店公告
 /* 首页主广告设置 */
 $smarty->assign('index_ad', $_CFG['index_ad']);
 if ($_CFG['index_ad'] == 'cus') {
     $sql = 'SELECT ad_type, content, url FROM ' . $ecs->table("ad_custom") . ' WHERE ad_status = 1';
     $ad = $db->getRow($sql, true);
     $smarty->assign('ad', $ad);
 }
 /* links */
Example #3
0
	jsonExit($article_list);

}else if($act == 'info')//文章信息
{
	$article_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
	$article = array();
	if($article_id > 0)
	{
		$article = get_article_info($article_id);
	}
	jsonExit($article);
}
else if ($act == 'ShopAnnouncement')//只查询cat_id=13(店铺公告)作为精品推荐
{
	$cat_id = 13;
	$related_articles = index_get_new_articles($cat_id);
	//var_dump($related_articles);exit;
	jsonExit($related_articles);
}
//精品推荐
else if ($act = 'recommendGoods') {
	$article_id = isset($_GET['id']) ? intval($_GET['id']) : 14;
	$article = array();
	if($article_id > 0)
	{
		//文章详细信息
		$article = get_article_info($article_id);
		//文章关联产品
		$article_related_goods = article_related_goods($article_id);		
		$articleArr = array('article'=>$article,'article_related_goods'=>$article_related_goods);
	}
Example #4
0
	public function ShopAnnouncement () {
		$cat_id = 13;
		$related_articles = index_get_new_articles($cat_id);
		//var_dump($related_articles);exit;
		jsonExit($related_articles);
	}