Example #1
0
	public function indexOp(){
	    //查询会员及其附属信息
	    parent::pointshopMInfo();
	    
	    //开启代金券功能后查询推荐的热门代金券列表
	    if (C('voucher_allow') == 1){
	        $recommend_voucher = Model('voucher')->getRecommendTemplate(6);
	        Tpl::output('recommend_voucher',$recommend_voucher);
	    }
	    //开启积分兑换功能后查询推荐的热门兑换商品列表
	    if (C('pointprod_isuse') == 1){
	        //热门积分兑换商品
	        $recommend_pointsprod = Model('pointprod')->getRecommendPointProd(10);
	        Tpl::output('recommend_pointsprod',$recommend_pointsprod);
	    }
	    
	    //SEO
	    Model('seo')->type('point')->show();
	    //分类导航
	    $nav_link = array(
	            0=>array('title'=>L('homepage'),'link'=>SHOP_SITE_URL),
	            1=>array('title'=>L('nc_pointprod'))
	    );
	    Tpl::output('nav_link_list', $nav_link);
	    Tpl::showpage('pointprod');
	}
Example #2
0
	public function __construct() {
		parent::__construct();
		//读取语言包
		Language::read('home_pointcart');

		//判断系统是否开启积分和积分兑换功能
		if (C('pointprod_isuse') != 1){
			showDialog(L('pointcart_unavailable'),'index.php','error');
		}
		//验证是否登录
		if ($_SESSION['is_login'] != '1'){
			showDialog(L('pointcart_unlogin_error'),'index.php?act=login','error');
		}
	}
Example #3
0
 /**
  * 经验明细列表
  */
 public function exppointlogOp()
 {
     //查询会员及其附属信息
     $result = parent::pointshopMInfo();
     //查询积分日志列表
     $model_exppoints = Model('exppoints');
     $where = array();
     $where['exp_memberid'] = $_SESSION['member_id'];
     $list_log = $model_exppoints->getExppointsLogList($where, '*', 20, 0, 'exp_id desc');
     //信息输出
     Tpl::output('stage_arr', $model_exppoints->getStage());
     Tpl::output('show_page', $model_exppoints->showpage(5));
     Tpl::output('list_log', $list_log);
     //分类导航
     $nav_link = array(0 => array('title' => L('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => L('nc_pointprod'), 'link' => urlShop('pointshop', 'index')), 2 => array('title' => '经验值明细'));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::showpage('point_exppointslog');
 }
Example #4
0
 /**
  * 积分商品列表
  */
 public function plistOp()
 {
     //查询会员及其附属信息
     $result = parent::pointshopMInfo(true);
     $member_info = $result['member_info'];
     unset($result);
     $model_pointprod = Model('pointprod');
     //展示状态
     $pgoodsshowstate_arr = $model_pointprod->getPgoodsShowState();
     //开启状态
     $pgoodsopenstate_arr = $model_pointprod->getPgoodsOpenState();
     $model_member = Model('member');
     //查询会员等级
     $membergrade_arr = $model_member->getMemberGradeArr();
     Tpl::output('membergrade_arr', $membergrade_arr);
     //查询兑换商品列表
     $where = array();
     $where['pgoods_show'] = $pgoodsshowstate_arr['show'][0];
     $where['pgoods_state'] = $pgoodsopenstate_arr['open'][0];
     //会员级别
     $level_filter = array();
     if (isset($_GET['level'])) {
         $level_filter['search'] = intval($_GET['level']);
     }
     if (intval($_GET['isable']) == 1) {
         $level_filter['isable'] = intval($member_info['level']);
     }
     if (count($level_filter) > 0) {
         if (isset($level_filter['search']) && isset($level_filter['isable'])) {
             $where['pgoods_limitmgrade'] = array(array('eq', $level_filter['search']), array('elt', $level_filter['isable']), 'and');
         } elseif (isset($level_filter['search'])) {
             $where['pgoods_limitmgrade'] = $level_filter['search'];
         } elseif (isset($level_filter['isable'])) {
             $where['pgoods_limitmgrade'] = array('elt', $level_filter['isable']);
         }
     }
     //查询仅我能兑换和所需积分
     $points_filter = array();
     if (intval($_GET['isable']) == 1) {
         $points_filter['isable'] = $member_info['member_points'];
     }
     if (intval($_GET['points_min']) > 0) {
         $points_filter['min'] = intval($_GET['points_min']);
     }
     if (intval($_GET['points_max']) > 0) {
         $points_filter['max'] = intval($_GET['points_max']);
     }
     if (count($points_filter) > 0) {
         asort($points_filter);
         if (count($points_filter) > 1) {
             $points_filter = array_values($points_filter);
             $where['pgoods_points'] = array('between', array($points_filter[0], $points_filter[1]));
         } else {
             if ($points_filter['min']) {
                 $where['pgoods_points'] = array('egt', $points_filter['min']);
             } elseif ($points_filter['max']) {
                 $where['pgoods_points'] = array('elt', $points_filter['max']);
             } elseif ($points_filter['isable']) {
                 $where['pgoods_points'] = array('elt', $points_filter['isable']);
             }
         }
     }
     //排序
     switch ($_GET['orderby']) {
         case 'stimedesc':
             $orderby = 'pgoods_starttime desc,';
             break;
         case 'stimeasc':
             $orderby = 'pgoods_starttime asc,';
             break;
         case 'pointsdesc':
             $orderby = 'pgoods_points desc,';
             break;
         case 'pointsasc':
             $orderby = 'pgoods_points asc,';
             break;
     }
     $orderby .= 'pgoods_sort asc,pgoods_id desc';
     $pointprod_list = $model_pointprod->getPointProdList($where, '*', $orderby, '', 20);
     Tpl::output('pointprod_list', $pointprod_list);
     Tpl::output('show_page', $model_pointprod->showpage(2));
     //分类导航
     $nav_link = array(0 => array('title' => L('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => '积分中心', 'link' => urlShop('pointshop', 'index')), 2 => array('title' => '兑换礼品列表'));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::showpage('pointprod_list');
 }
Example #5
0
 /**
  * 代金券列表
  */
 public function pointvoucherOp()
 {
     //查询会员及其附属信息
     parent::pointshopMInfo();
     $model_voucher = Model('voucher');
     //代金券模板状态
     $templatestate_arr = $model_voucher->getTemplateState();
     //查询会员信息
     $member_info = Model('member')->getMemberInfoByID($_SESSION['member_id']);
     //查询代金券列表
     $where = array();
     $where['voucher_t_state'] = $templatestate_arr['usable'][0];
     $where['voucher_t_end_date'] = array('gt', time());
     if (intval($_GET['sc_id']) > 0) {
         $where['voucher_t_sc_id'] = intval($_GET['sc_id']);
     }
     if (intval($_GET['price']) > 0) {
         $where['voucher_t_price'] = intval($_GET['price']);
     }
     //查询仅我能兑换和所需积分
     $points_filter = array();
     if (intval($_GET['isable']) == 1) {
         $points_filter['isable'] = $member_info['member_points'];
     }
     if (intval($_GET['points_min']) > 0) {
         $points_filter['min'] = intval($_GET['points_min']);
     }
     if (intval($_GET['points_max']) > 0) {
         $points_filter['max'] = intval($_GET['points_max']);
     }
     if (count($points_filter) > 0) {
         asort($points_filter);
         if (count($points_filter) > 1) {
             $points_filter = array_values($points_filter);
             $where['voucher_t_points'] = array('between', array($points_filter[0], $points_filter[1]));
         } else {
             if ($points_filter['min']) {
                 $where['voucher_t_points'] = array('egt', $points_filter['min']);
             } elseif ($points_filter['max']) {
                 $where['voucher_t_points'] = array('elt', $points_filter['max']);
             } elseif ($points_filter['isable']) {
                 $where['voucher_t_points'] = array('elt', $points_filter['isable']);
             }
         }
     }
     //排序
     switch ($_GET['orderby']) {
         case 'exchangenumdesc':
             $orderby = 'voucher_t_giveout desc,';
             break;
         case 'exchangenumasc':
             $orderby = 'voucher_t_giveout asc,';
             break;
         case 'pointsdesc':
             $orderby = 'voucher_t_points desc,';
             break;
         case 'pointsasc':
             $orderby = 'voucher_t_points asc,';
             break;
     }
     $orderby .= 'voucher_t_id desc';
     $voucherlist = $model_voucher->getVoucherTemplateList($where, '*', 0, 18, $orderby);
     Tpl::output('voucherlist', $voucherlist);
     Tpl::output('show_page', $model_voucher->showpage(2));
     //查询代金券面额
     $pricelist = $model_voucher->getVoucherPriceList();
     Tpl::output('pricelist', $pricelist);
     //查询店铺分类
     $store_class = rkcache('store_class', true);
     Tpl::output('store_class', $store_class);
     //分类导航
     $nav_link = array(0 => array('title' => Language::get('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => '积分中心', 'link' => urlShop('pointshop', 'index')), 2 => array('title' => '代金券列表'));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::showpage('pointvoucher');
 }