Example #1
0
 public function indexOp()
 {
     Language::read('home_index_index');
     /**	Tpl::output('index_sign','index');*/
     //团购专区
     Language::read('member_groupbuy');
     $model_groupbuy = Model('groupbuy');
     $group_list = $model_groupbuy->getGroupbuyCommendedList(array(), null, '', '*', 4);
     Tpl::output('group_list', $group_list);
     //限时折扣
     $model_xianshi_goods = Model('p_xianshi_goods');
     $xianshi_item = $model_xianshi_goods->getXianshiGoodsCommendList(4);
     Tpl::output('xianshi_item', $xianshi_item);
     //板块信息
     $model_web_config = Model('web_config');
     $web_html = $model_web_config->getWebHtml('index');
     Tpl::output('web_html', $web_html);
     Model('seo')->type('index')->show();
     //新品汇
     $news = model()->table('goods,store')->join('left')->on('goods.store_id=store.store_id')->where(array('grade_id' => '3'))->order('goods.goods_id desc')->limit('6')->select();
     /**获取品牌国籍*/
     foreach ($news as $key => $value) {
         $news[$key]['goods_count'] = Model('count')->getCount($value['goods_count']);
         $news[$key]['brand_name'] = Model('brand')->getOneBrand_name($value['brand_id']);
     }
     $news_first = array_shift($news);
     //欧洲潮流
     $chaoliu = model()->table('goods,store')->join('left')->on('goods.store_id=store.store_id')->where(array('grade_id' => '3'))->order('goods.goods_id desc')->limit('6')->select();
     /**获取品牌国籍*/
     foreach ($chaoliu as $key => $value) {
         $chaoliu[$key]['brand_name'] = Model('brand')->getOneBrand_name($value['brand_id']);
         $chaoliu[$key]['goods_count'] = Model('count')->getCount($value['goods_count']);
     }
     TpL::output('news_first', $news_first);
     TpL::output('news', $news);
     TpL::output('chaoliu', $chaoliu);
     //欧洲潮 搜索商店
     $shangdian = model()->table('store')->order('store_id desc')->limit('6');
     $model = Model();
     //安心农场
     //设计师作品
     $sheji_pl = Model()->table('goods_sheji')->order('sheji_order desc')->select();
     //判断设计师是否有作品
     $sheji = $model->table('goods_sheji,goods')->join('left')->on('goods_sheji.sheji_id = goods.goods_sheji')->where('goods.goods_state=1')->order('goods_sheji.sheji_order desc')->limit(6)->select();
     //品牌
     foreach ($sheji as $key => $value) {
         $sheji[$key]['goods_count'] = Model('count')->getCount($value['goods_count']);
         $sheji[$key]['brand_name'] = Model('brand')->getOneBrand_name($value['brand_id']);
     }
     TpL::output('sheji', $sheji);
     //个人代购
     //$daigou=$model->table('goods,store')->join('left')->on('goods.store_id=store.store_id')->where(array('grade_id'=>'2'))->limit('6')->select();
     $daigou = $model->table('store')->where(array('grade_id' => '2', 'store_state' => '1'))->order('store_id desc')->limit('6')->select();
     TpL::output('daigou', $daigou);
     //SELECT * FROM `shopnc_goods` as g LEFT JOIN `shopnc_store` as u on g.store_id=u.store_id where u.grade_id=2;
     /*	$tagmember_list = $model->table('sns_mtagmember,member')
     									->field('sns_mtagmember.*,member.member_avatar,member.member_name')
     									->join('left')->on('sns_mtagmember.member_id=member.member_id')
     									->where($where)
     									->order('sns_mtagmember.recommend desc, sns_mtagmember.member_id asc')
     									->limit(count($mtagid_array)*20)->select();
     */
     //$orderprod_list = $model->table('points_ordergoods,points_order')->join('left')->on('points_ordergoods.point_orderid = points_order.point_orderid')->where(array('point_orderstate'=>array('gt',10)))->order('points_ordergoods.point_recid desc')->limit(5)->select();
     //品牌
     $sband = Model('band');
     $brand = $sband->table('brand')->where(array('brand_apply' => '1', 'class_id' => '959'))->limit(12)->order('brand_recommend desc,brand_sort asc')->select();
     TpL::output('brand', $brand);
     $svbrand = $sband->table('brand')->where(array('brand_apply' => '1', 'class_id' => '959'))->limit(6)->order('brand_id desc,brand_recommend desc,brand_sort asc')->select();
     /**获取品牌国籍*/
     foreach ($svbrand as $key => $value) {
         $svbrand[$key]['goods_count'] = Model('count')->getCount($value['brand_count']);
     }
     //首页广告图
     $adv = $model->table('adv')->where(array('ap_id' => '376'))->select();
     TpL::output('adv', $adv);
     TpL::output('svbrand', $svbrand);
     TpL::output('index', 'index');
     Tpl::showpage('index');
 }
Example #2
0
 public function typeOp()
 {
     $this->_model_search = Model('search');
     //优先从全文索引库里查找
     list($indexer_ids, $indexer_count) = $this->_indexer_search();
     $data_attr = $this->_get_attr_list();
     //处理排序
     $order = 'goods_id desc';
     if (in_array($_GET['key'], array('1', '2', '3'))) {
         $sequence = $_GET['order'] == '1' ? 'asc' : 'desc';
         $order = str_replace(array('1', '2', '3'), array('goods_salenum', 'goods_click', 'goods_price'), $_GET['key']);
         $order .= ' ' . $sequence;
     }
     $model_goods = Model('goods');
     if (!isset($data_attr['sign']) || $data_attr['sign'] === true) {
         // 字段
         $fields = "goods_id,goods_commonid,goods_name,goods_jingle,gc_id,store_id,store_name,goods_price,goods_marketprice,goods_storage,goods_image,goods_freight,goods_salenum,color_id,evaluation_good_star,evaluation_count,goods_count,goods_collect";
         $condition = array();
         if (is_array($indexer_ids)) {
             //商品主键搜索
             $condition['goods_id'] = array('in', $indexer_ids);
             $goods_list = $model_goods->getGoodsOnlineList($condition, $fields, 0, $order, self::PAGESIZE, null, false);
             pagecmd('setEachNum', self::PAGESIZE);
             pagecmd('setTotalNum', $indexer_count);
         } else {
             //执行正常搜索
             if (isset($data_attr['gcid_array'])) {
                 $condition['gc_id'] = array('in', $data_attr['gcid_array']);
             }
             if (intval($_GET['count']) > 0) {
                 $condition['goods_count'] = intval($_GET['count']);
             }
             if (intval($_GET['b_id']) > 0) {
                 $condition['brand_id'] = intval($_GET['b_id']);
             }
             if ($_GET['keyword'] != '') {
                 $condition['goods_name|goods_jingle'] = array('like', '%' . $_GET['keyword'] . '%');
             }
             if (intval($_GET['area_id']) > 0) {
                 $condition['areaid_1'] = intval($_GET['area_id']);
             }
             if (in_array($_GET['type'], array(1, 2))) {
                 if ($_GET['type'] == 1) {
                     $condition['store_id'] = DEFAULT_PLATFORM_STORE_ID;
                 } else {
                     if ($_GET['type'] == 2) {
                         $condition['store_id'] = array('neq', DEFAULT_PLATFORM_STORE_ID);
                     }
                 }
             }
             if (isset($data_attr['goodsid_array'])) {
                 $condition['goods_id'] = array('in', $data_attr['goodsid_array']);
             }
             $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fields, $order, 42);
         }
         // 商品多图
         if (!empty($goods_list)) {
             $goodsid_array = array();
             // 商品id数组
             $commonid_array = array();
             // 商品公共id数组
             $storeid_array = array();
             // 店铺id数组
             foreach ($goods_list as $value) {
                 $goodsid_array[] = $value['goods_id'];
                 $commonid_array[] = $value['goods_commonid'];
                 $storeid_array[] = $value['store_id'];
             }
             $goodsid_array = array_unique($goodsid_array);
             $commonid_array = array_unique($commonid_array);
             $storeid_array = array_unique($storeid_array);
             // 商品多图
             $goodsimage_more = Model('goods')->getGoodsImageList(array('goods_commonid' => array('in', $commonid_array)));
             if (C('promotion_allow')) {
                 // 限时折扣
                 $xianshi_list = Model('p_xianshi_goods')->getXianshiGoodsListByGoodsString(implode(',', $goodsid_array));
             }
             foreach ($goods_list as $key => $value) {
                 // 商品多图
                 foreach ($goodsimage_more as $v) {
                     if ($value['goods_commonid'] == $v['goods_commonid'] && $value['store_id'] == $v['store_id'] && $value['color_id'] == $v['color_id']) {
                         $goods_list[$key]['image'][] = $v;
                     }
                 }
                 //国家
                 $goods_list[$key]['goods_count'] = Model('count')->getCount($value['goods_count']);
                 // 店铺的开店会员编号
                 $store_id = $value['store_id'];
                 $goods_list[$key]['member_id'] = $store_list[$store_id]['member_id'];
                 $goods_list[$key]['store_domain'] = $store_list[$store_id]['store_domain'];
                 if (isset($xianshi_list[$value['goods_id']]) && !$goods_list[$key]['group_flag']) {
                     $goods_list[$key]['goods_price'] = $xianshi_list[$value['goods_id']]['xianshi_price'];
                     $goods_list[$key]['xianshi_flag'] = true;
                 }
             }
         }
         Tpl::output('goods_list', $goods_list);
     }
     Tpl::output('class_name', @$data_attr['gc_name']);
     if ($_GET['keyword'] == '') {
         //不显示无商品的搜索项
         if (C('fullindexer.open')) {
             $data_attr['brand_array'] = $this->_model_search->delInvalidBrand($data_attr['brand_array']);
             $data_attr['attr_array'] = $this->_model_search->delInvalidAttr($data_attr['attr_array']);
         }
     }
     if (intval($_GET['count']) > 0) {
         //获取国家值
         $dbs = Model('count')->getCountInfo(array('count_id' => $_GET['count']), 'count_name');
         $count_name = $dbs['count_name'];
     } else {
         $count_name = '国家';
     }
     Tpl::output('count_name', $count_name);
     //获取国家
     $count = Model()->table('count')->where()->order('count_id asc')->select();
     Tpl::output('count', $count);
     //抛出搜索属性
     Tpl::output('brand_array', $data_attr['brand_array']);
     Tpl::output('attr_array', $data_attr['attr_array']);
     //         Tpl::output('cate_array',$data_attr['cate_array']);
     Tpl::output('checked_brand', $data_attr['checked_brand']);
     Tpl::output('checked_attr', $data_attr['checked_attr']);
     $model_goods_class = Model('goods_class');
     loadfunc('search');
     //商品类型
     $goods_class = Model('goods_class');
     $goods_type = $model_goods_class->table('goods_class')->where(array('gc_parent_id' => '959'))->order('gc_sort asc')->select();
     Tpl::output('goods_type', $goods_type);
     //当前商品类型
     $cate_id = $_GET['cate_id'];
     if ($cate_id !== '0') {
         $scate_id = $model_goods_class->where(array('gc_id' => $cate_id))->find();
         $scate_data = $scate_id['gc_name'];
     } else {
         $scate_data = '产品';
     }
     Tpl::output('scate_data', $scate_data);
     //品牌
     $sband = Model('band');
     $brand = $sband->table('brand')->where(array('brand_apply' => '1', 'class_id' => '959'))->limit(12)->order('brand_sort asc')->select();
     TpL::output('brand', $brand);
     Tpl::output('index_sign', 'index');
     Tpl::showpage('category_type');
 }
Example #3
0
 /**
  *主页
  */
 public function homeOp()
 {
     TpL::showpage('home');
 }
Example #4
0
 /**
  * 发送站内信页面
  *
  * @param 
  * @return 
  */
 public function sendmsgOp()
 {
     Language::read('member_home_message');
     $referer_url = getReferer();
     //查询会员是否允许发送站内信
     $isallowsend = $this->allowSendMessage($_SESSION['member_id']);
     if (!$isallowsend) {
         showMessage(Language::get('home_message_noallowsend'), $referer_url, 'html', 'error');
     }
     $model_member = Model('member');
     $member_name_string = '';
     $member_id = intval($_GET['member_id']);
     if ($member_id > 0) {
         //连接发放站内信页面
         $member_info = $model_member->infoMember(array('member_id' => $member_id));
         if (empty($member_info)) {
             showMessage(Language::get('wrong_argument'), $referer_url, 'html', 'error');
         }
         $member_name_string = $member_info['member_name'];
         Tpl::output('member_name', $member_name_string);
     } else {
         //批量给好友发放站内信页面
         $friend_model = Model('sns_friend');
         $friend_list = $friend_model->listFriend(array('friend_frommid' => "{$_SESSION['member_id']}"));
         Tpl::output('friend_list', $friend_list);
     }
     //查询新接收到普通的消息
     $newcommon = $this->receivedCommonNewNum();
     Tpl::output('newcommon', $newcommon);
     //查询新接收到系统的消息
     $newsystem = $this->receivedSystemNewNum();
     Tpl::output('newsystem', $newsystem);
     //查询新接收到卖家的消息
     $newpersonal = $this->receivedPersonalNewNum();
     Tpl::output('newpersonal', $newpersonal);
     self::profile_menu('message', 'sendmsg');
     Tpl::output('menu_sign', 'message');
     Tpl::output('menu_sign_url', 'index.php?act=home&op=message');
     Tpl::output('menu_sign1', 'sendmsg');
     //查询会员信息
     $this->get_member_info();
     TpL::output('index', 'message');
     Tpl::output('header_menu_sign', 'message');
     //默认选中顶部“站内信”菜单
     Tpl::showpage('message_send');
 }
Example #5
0
 public function liulanOp()
 {
     $model_goods = Model('goods');
     $viewed_goods = $model_goods->getViewedGoodsList();
     Tpl::output('viewed_goods', $viewed_goods);
     TpL::showpage('memeber_liulan');
 }