function groupbuy() { /* 店铺信息 */ $id = empty($_GET['id']) ? 0 : intval($_GET['id']); if (!$id) { $this->show_warning('Hacking Attempt'); return; } $this->set_store($id); $store = $this->get_store_data(); $this->assign('store', $store); /* 搜索团购 */ empty($_GET['state']) && ($_GET['state'] = 'on'); $conditions = '1=1'; if ($_GET['state'] == 'on') { $conditions .= ' AND gb.state =' . GROUP_ON . ' AND gb.end_time>' . gmtime(); $search_name = array(array('text' => Lang::get('group_on')), array('text' => Lang::get('all_groupbuy'), 'url' => url('app=store&act=groupbuy&state=all&id=' . $id))); } else { if ($_GET['state'] == 'all') { $conditions .= ' AND gb.state ' . db_create_in(array(GROUP_ON, GROUP_END, GROUP_FINISHED)); $search_name = array(array('text' => Lang::get('all_groupbuy')), array('text' => Lang::get('group_on'), 'url' => url('app=store&act=groupbuy&state=on&id=' . $id))); } } $page = $this->_get_page(16); $groupbuy_mod =& m('groupbuy'); $groupbuy_list = $groupbuy_mod->find(array('fields' => 'goods.default_image, gb.group_name, gb.group_id, gb.spec_price, gb.end_time, gb.state', 'join' => 'belong_goods', 'conditions' => $conditions . ' AND gb.store_id=' . $id, 'order' => 'group_id DESC', 'limit' => $page['limit'], 'count' => true)); $page['item_count'] = $groupbuy_mod->getCount(); $this->_format_page($page); $this->assign('page_info', $page); if (empty($groupbuy_list)) { $groupbuy_list = array(); } foreach ($groupbuy_list as $key => $_g) { empty($groupbuy_list[$key]['default_image']) && ($groupbuy_list[$key]['default_image'] = Conf::get('default_goods_image')); $tmp = current(unserialize($_g['spec_price'])); $groupbuy_list[$key]['price'] = $tmp['price']; if ($_g['end_time'] < gmtime()) { $groupbuy_list[$key]['group_state'] = group_state($_g['state']); } else { $groupbuy_list[$key]['lefttime'] = lefttime($_g['end_time']); } } /* 当前位置 */ $this->_curlocal(LANG::get('all_stores'), 'index.php?app=search&act=store', $store['store_name'], 'index.php?app=store&id=' . $store['store_id'], LANG::get('groupbuy_list')); $this->assign('groupbuy_list', $groupbuy_list); $this->assign('search_name', $search_name); $this->_config_seo('title', $search_name[0]['text'] . ' - ' . $store['store_name']); $this->display('store.groupbuy.html'); }
<ul class="menu"> <li class="active"><a><span class="nowbutr"><?php echo $g_langpackage->g_find_group; ?> </a></li> </ul> </div> <?php foreach ($search as $rs) { ?> <div class="group_box" onmouseover="this.className = 'group_box_active';" onmouseout="this.className='group_box';"> <div class="group_box_content"> <div class="group_control"> <?php echo group_state($rs['group_id'], $rs['group_join_type'], $user_creat_group, $user_join_group, $rs['group_req_id']); ?> <a href='modules.php?app=group_space&group_id=<?php echo $rs["group_id"]; ?> &user_id=<?php echo $url_uid; ?> '><?php echo $g_langpackage->g_en_space; ?> </a> </div> <div class="group_photo"><a href='modules.php?app=group_space&group_id=<?php echo $rs["group_id"]; ?>