コード例 #1
0
ファイル: eventModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     $id = intval($_REQUEST['act']);
     require_once APP_ROOT_PATH . "system/model/event.php";
     $event = get_event($id);
     if ($event) {
         set_view_history("event", $event['id']);
         $history_ids = get_view_history("event");
         //浏览历史
         if ($history_ids) {
             $ids_conditioin = " e.id in (" . implode(",", $history_ids) . ") ";
             $history_deal_list = get_event_list(app_conf("SIDE_DEAL_COUNT"), array(EVENT_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
             //重新组装排序
             $history_list = array();
             foreach ($history_ids as $k => $v) {
                 foreach ($history_deal_list['list'] as $history_item) {
                     if ($history_item['id'] == $v) {
                         $history_list[] = $history_item;
                     }
                 }
             }
             $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
         }
         $event['content'] = format_html_content_image($event['content'], 720);
         $event['submitted_data'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event_submit where event_id = " . $event['id'] . " and user_id = '" . $GLOBALS['user_info']['id'] . "'");
         $GLOBALS['tmpl']->assign("event", $event);
         $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
         //输出右侧的其他优惠券
         $side_event_list = get_event_list(app_conf("SIDE_DEAL_COUNT"), array(EVENT_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", "", " e.submit_count desc ");
         $GLOBALS['tmpl']->assign("side_event_list", $side_event_list['list']);
         //关于分类信息与seo
         $page_title = "";
         $page_keyword = "";
         $page_description = "";
         if ($event['supplier_info']['name']) {
             $page_title .= "[" . $event['supplier_info']['name'] . "]";
             $page_keyword .= $event['supplier_info']['name'] . ",";
             $page_description .= $event['supplier_info']['name'] . ",";
         }
         $page_title .= $event['name'];
         $page_keyword .= $event['name'] . ",";
         $page_description .= $event['name'] . ",";
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
         if ($event['cate_id']) {
             $event['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "event_cate where id = " . $event['cate_id']);
             $event['cate_url'] = url("index", "events", array("cid" => $event['cate_id']));
         }
         if ($event['cate_name']) {
             $page_title .= " - " . $event['cate_name'];
             $page_keyword .= $event['cate_name'] . ",";
             $page_description .= $event['cate_name'] . ",";
             $site_nav[] = array('name' => $event['cate_name'], 'url' => $event['cate_url']);
         }
         $site_nav[] = array('name' => $event['name'], 'url' => $event['url']);
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $GLOBALS['tmpl']->assign("page_title", $page_title);
         $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
         $GLOBALS['tmpl']->assign("page_description", $page_description);
         $GLOBALS['tmpl']->display("event.html");
     } else {
         app_redirect_preview();
     }
 }
コード例 #2
0
ファイル: youhuiModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     if (trim($_REQUEST['act']) == "print") {
         $this->doprint();
         exit;
     }
     global_run();
     init_app_page();
     $id = intval($_REQUEST['act']);
     require_once APP_ROOT_PATH . "system/model/youhui.php";
     $youhui = get_youhui($id);
     if ($youhui) {
         set_view_history("youhui", $youhui['id']);
         $history_ids = get_view_history("youhui");
         //浏览历史
         if ($history_ids) {
             $ids_conditioin = " y.id in (" . implode(",", $history_ids) . ") ";
             $history_deal_list = get_youhui_list(app_conf("SIDE_DEAL_COUNT"), array(YOUHUI_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
             //重新组装排序
             $history_list = array();
             foreach ($history_ids as $k => $v) {
                 foreach ($history_deal_list['list'] as $history_item) {
                     if ($history_item['id'] == $v) {
                         $history_list[] = $history_item;
                     }
                 }
             }
             $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
         }
         $youhui['description'] = format_html_content_image($youhui['description'], 720);
         $youhui['use_notice'] = format_html_content_image($youhui['use_notice'], 720);
         $GLOBALS['tmpl']->assign("youhui", $youhui);
         $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
         //输出右侧的其他优惠券
         $side_youhui_list = get_youhui_list(app_conf("SIDE_DEAL_COUNT"), array(YOUHUI_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", "", " y.user_count desc ");
         $GLOBALS['tmpl']->assign("side_youhui_list", $side_youhui_list['list']);
         //关于分类信息与seo
         $page_title = "";
         $page_keyword = "";
         $page_description = "";
         if ($youhui['supplier_info']['name']) {
             $page_title .= "[" . $youhui['supplier_info']['name'] . "]";
             $page_keyword .= $youhui['supplier_info']['name'] . ",";
             $page_description .= $youhui['supplier_info']['name'] . ",";
         }
         $page_title .= $youhui['name'];
         $page_keyword .= $youhui['name'] . ",";
         $page_description .= $youhui['name'] . ",";
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
         if ($youhui['deal_cate_id']) {
             $youhui['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id = " . $youhui['deal_cate_id']);
             $youhui['cate_url'] = url("index", "youhuis", array("cid" => $youhui['deal_cate_id']));
         }
         if ($youhui['cate_name']) {
             $page_title .= " - " . $youhui['cate_name'];
             $page_keyword .= $youhui['cate_name'] . ",";
             $page_description .= $youhui['cate_name'] . ",";
             $site_nav[] = array('name' => $youhui['cate_name'], 'url' => $youhui['cate_url']);
         }
         $site_nav[] = array('name' => $youhui['name'], 'url' => $youhui['url']);
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $GLOBALS['tmpl']->assign("page_title", $page_title);
         $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
         $GLOBALS['tmpl']->assign("page_description", $page_description);
         $GLOBALS['tmpl']->display("youhui.html");
     } else {
         app_redirect_preview();
     }
 }
コード例 #3
0
ファイル: dealModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $deal_key = strim($_REQUEST['act']);
     require_once APP_ROOT_PATH . "system/model/deal.php";
     $deal = get_deal($deal_key);
     if ($deal) {
         if ($deal['is_shop'] == 1) {
             if ($deal['buy_type'] == 1) {
                 $GLOBALS['tmpl']->assign("cate_tree_type", 2);
             } else {
                 set_view_history("shop", $deal['id']);
                 $history_ids = get_view_history("shop");
                 $GLOBALS['tmpl']->assign("cate_tree_type", 1);
             }
             $GLOBALS['tmpl']->assign("search_type", 5);
         } else {
             set_view_history("deal", $deal['id']);
             $history_ids = get_view_history("deal");
         }
         //浏览历史
         if ($history_ids) {
             $ids_conditioin = " d.id in (" . implode(",", $history_ids) . ") ";
             if ($deal['is_shop'] == 0) {
                 $history_deal_list = get_deal_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
             } elseif ($deal['is_shop'] == 1) {
                 if ($deal['buy_type'] == 0) {
                     $history_deal_list = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
                 }
             }
             //重新组装排序
             $history_list = array();
             foreach ($history_ids as $k => $v) {
                 foreach ($history_deal_list['list'] as $history_item) {
                     if ($history_item['id'] == $v) {
                         $history_list[] = $history_item;
                     }
                 }
             }
             $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
         }
         //$GLOBALS['tmpl']->assign("drop_nav","no_drop"); //首页下拉菜单不输出
         //$GLOBALS['tmpl']->assign("wrap_type","1"); //首页宽屏展示
         $deal['description'] = format_html_content_image($deal['description'], 720);
         $deal['notes'] = format_html_content_image($deal['notes'], 720);
         $GLOBALS['tmpl']->assign("deal", $deal);
         $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
         //输出右侧的其他团购
         if ($deal['is_shop'] == 0) {
             $side_deal_list = get_deal_list(5, array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal['cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type <> 1 and d.is_shop = 0 and d.id<>" . $deal['id']);
         } elseif ($deal['is_shop'] == 1) {
             if ($deal['buy_type'] == 1) {
                 $side_deal_list = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal['shop_cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type = 1 and d.is_shop = 1 and d.id<>" . $deal['id']);
             } else {
                 $side_deal_list = get_goods_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $deal['shop_cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type <> 1 and d.is_shop = 1 and d.id<>" . $deal['id']);
             }
         }
         //$side_deal_list = get_deal_list(4,array(DEAL_ONLINE));
         $GLOBALS['tmpl']->assign("side_deal_list", $side_deal_list['list']);
         //关于分类信息与seo
         $page_title = "";
         $page_keyword = "";
         $page_description = "";
         if ($deal['supplier_info']['name']) {
             $page_title .= "[" . $deal['supplier_info']['name'] . "]";
             $page_keyword .= $deal['supplier_info']['name'] . ",";
             $page_description .= $deal['supplier_info']['name'] . ",";
         }
         $page_title .= $deal['sub_name'];
         $page_keyword .= $deal['sub_name'] . ",";
         $page_description .= $deal['sub_name'] . ",";
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
         if ($deal['cate_id']) {
             $deal['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id = " . $deal['cate_id']);
             $deal['cate_url'] = url("index", "tuan", array("cid" => $deal['cate_id']));
         } elseif ($deal['shop_cate_id']) {
             $deal['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "shop_cate where id = " . $deal['shop_cate_id']);
             if ($deal['buy_type'] == 1) {
                 $deal['cate_url'] = url("index", "scores", array("cid" => $deal['shop_cate_id']));
             } else {
                 $deal['cate_url'] = url("index", "cate", array("cid" => $deal['shop_cate_id']));
             }
         }
         if ($deal['cate_name']) {
             $page_title .= " - " . $deal['cate_name'];
             $page_keyword .= $deal['cate_name'] . ",";
             $page_description .= $deal['cate_name'] . ",";
             $site_nav[] = array('name' => $deal['cate_name'], 'url' => $deal['cate_url']);
         }
         $site_nav[] = array('name' => $deal['sub_name'], 'url' => $deal['url']);
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出促销
         if ($deal['allow_promote'] == 1) {
             $promote = load_auto_cache("cache_promote");
             $GLOBALS['tmpl']->assign("promote", $promote);
         }
         if ($deal['seo_title']) {
             $page_title = $deal['seo_title'];
         }
         if ($deal['seo_keyword']) {
             $page_keyword = $deal['seo_keyword'];
         }
         if ($deal['seo_description']) {
             $page_description = $deal['seo_description'];
         }
         $GLOBALS['tmpl']->assign("page_title", $page_title);
         $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
         $GLOBALS['tmpl']->assign("page_description", $page_description);
         $GLOBALS['tmpl']->display("deal.html");
     } else {
         app_redirect_preview();
     }
 }
コード例 #4
0
ファイル: storeModule.class.php プロジェクト: macall/jsd
 public function index()
 {
     global_run();
     init_app_page();
     $store_id = intval($_REQUEST['act']);
     require_once APP_ROOT_PATH . "system/model/supplier.php";
     $store_info = get_location($store_id);
     if ($store_info) {
         set_view_history("store", $store_info['id']);
         $history_ids = get_view_history("store");
         //浏览历史
         if ($history_ids) {
             $ids_conditioin = " sl.id in (" . implode(",", $history_ids) . ") ";
             $history_deal_list = get_location_list(app_conf("SIDE_DEAL_COUNT"), array("city_id" => $GLOBALS['city']['id']), "", $ids_conditioin);
             //重新组装排序
             $history_list = array();
             foreach ($history_ids as $k => $v) {
                 foreach ($history_deal_list['list'] as $history_item) {
                     if ($history_item['id'] == $v) {
                         $history_list[] = $history_item;
                     }
                 }
             }
             $GLOBALS['tmpl']->assign("history_deal_list", $history_list);
         }
         $store_info['good_rate_precent'] = round($store_info['good_rate'] * 100, 1);
         $store_info['ref_avg_price'] = round($store_info['ref_avg_price'], 2);
         $store_info['brief'] = format_html_content_image($store_info['brief'], 720);
         $GLOBALS['tmpl']->assign("store_info", $store_info);
         //开始输出商户图库数据json
         $store_images = $GLOBALS['db']->getAll("select brief,image from " . DB_PREFIX . "supplier_location_images where supplier_location_id = " . $store_info['id'] . " and status = 1 order by sort limit " . MAX_SP_IMAGE);
         foreach ($store_images as $k => $v) {
             $store_images[$k]['image'] = format_image_path(get_spec_image($v['image'], 600, 450, 1));
         }
         $GLOBALS['tmpl']->assign("store_images_json", json_encode($store_images));
         $GLOBALS['tmpl']->assign("store_images_count", count($store_images));
         //关于分类信息与seo
         $page_title = "";
         $page_keyword = "";
         $page_description = "";
         $page_title .= $store_info['name'];
         $page_keyword .= $store_info['name'] . ",";
         $page_description .= $store_info['name'] . ",";
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index"));
         if ($store_info['deal_cate_id']) {
             $store_info['cate_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id = " . $store_info['deal_cate_id']);
             $store_info['cate_url'] = url("index", "stores", array("cid" => $store_info['deal_cate_id']));
         }
         if ($store_info['cate_name']) {
             $page_title .= " - " . $store_info['cate_name'];
             $page_keyword .= $store_info['cate_name'] . ",";
             $page_description .= $store_info['cate_name'] . ",";
             $site_nav[] = array('name' => $store_info['cate_name'], 'url' => $store_info['cate_url']);
         }
         $site_nav[] = array('name' => $store_info['name'], 'url' => $store_info['url']);
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         if ($store_info['seo_title']) {
             $page_title = $store_info['seo_title'];
         }
         if ($store_info['seo_keyword']) {
             $page_keyword = $store_info['seo_keyword'];
         }
         if ($store_info['seo_description']) {
             $page_description = $store_info['seo_description'];
         }
         $GLOBALS['tmpl']->assign("page_title", $page_title);
         $GLOBALS['tmpl']->assign("page_keyword", $page_keyword);
         $GLOBALS['tmpl']->assign("page_description", $page_description);
         //输出右侧的其他团购
         require_once APP_ROOT_PATH . "system/model/deal.php";
         $side_deal_list = get_deal_list(app_conf("SIDE_DEAL_COUNT"), array(DEAL_ONLINE, DEAL_NOTICE), array("cid" => $store_info['deal_cate_id'], "city_id" => $GLOBALS['city']['id']), "", "  d.buy_type <> 1 and d.is_shop = 0 ");
         //$side_deal_list = get_deal_list(4,array(DEAL_ONLINE));
         $GLOBALS['tmpl']->assign("side_deal_list", $side_deal_list['list']);
     } else {
         app_redirect_preview();
     }
     $GLOBALS['tmpl']->display("store.html");
 }