/* 判断价格区间是否被选中 */ if (isset($_REQUEST['price_min']) && $price_grade[$temp_key]['start'] == $price_min && $price_grade[$temp_key]['end'] == $price_max) { $price_grade[$temp_key]['selected'] = 1; } else { $price_grade[$temp_key]['selected'] = 0; } } $price_grade[0]['start'] = 0; $price_grade[0]['end'] = 0; $price_grade[0]['price_range'] = $_LANG['all_attribute']; $price_grade[0]['url'] = build_uri('supplier', array('go' => 'category', 'suppid' => $_GET['suppId'], 'cid' => $cat_id, 'bid' => $brand, 'price_min' => 0, 'price_max' => 0, 'filter_attr' => $filter_attr_str), $cat['cat_name']); $price_grade[0]['selected'] = empty($price_max) ? 1 : 0; $smarty->assign('price_grade', $price_grade); } /* 品牌筛选 */ $sql = "SELECT b.brand_id, b.brand_name, COUNT(*) AS goods_num " . "FROM " . $GLOBALS['ecs']->table('brand') . "AS b, " . $GLOBALS['ecs']->table('goods') . " AS sgc LEFT JOIN " . $GLOBALS['ecs']->table('goods_cat') . " AS gc ON sgc.goods_id = gc.goods_id " . "WHERE sgc.brand_id = b.brand_id AND ({$children} OR " . 'gc.cat_id ' . db_create_in(array_unique(array_merge(array($cat_id), array_keys(cat_list_supplier($cat_id, 0, false))))) . ") AND b.is_show = 1 " . " AND sgc.is_on_sale = 1 AND sgc.is_alone_sale = 1 AND sgc.is_delete = 0 " . "GROUP BY b.brand_id HAVING goods_num > 0 ORDER BY b.sort_order, b.brand_id ASC"; $brands = $GLOBALS['db']->getAll($sql); foreach ($brands as $key => $val) { $temp_key = $key + 1; $brands[$temp_key]['brand_name'] = $val['brand_name']; $brands[$temp_key]['url'] = build_uri('supplier', array('go' => 'category', 'suppid' => $_GET['suppId'], 'cid' => $cat_id, 'bid' => $val['brand_id'], 'price_min' => $price_min, 'price_max' => $price_max, 'filter_attr' => $filter_attr_str), $cat['cat_name']); /* 判断品牌是否被选中 */ if ($brand == $brands[$key]['brand_id']) { $brands[$temp_key]['selected'] = 1; } else { $brands[$temp_key]['selected'] = 0; } } $brands[0]['brand_name'] = $_LANG['all_attribute']; $brands[0]['url'] = build_uri('supplier', array('go' => 'category', 'suppid' => $_GET['suppId'], 'cid' => $cat_id, 'bid' => 0, 'price_min' => $price_min, 'price_max' => $price_max, 'filter_attr' => $filter_attr_str), $cat['cat_name']); $brands[0]['selected'] = empty($brand) ? 1 : 0;
$smarty->assign('action_link', array('href' => 'bonus.php?act=list', 'text' => $_LANG['04_bonustype_list'])); if ($_REQUEST['send_by'] == SEND_BY_USER) { $smarty->assign('id', $id); $smarty->assign('ranklist', get_rank_list()); $smarty->display('bonus_by_user.htm'); } elseif ($_REQUEST['send_by'] == SEND_BY_GOODS) { /* 查询此红包类型信息 */ $bonus_type = $db->GetRow("SELECT type_id, type_name FROM " . $ecs->table('bonus_type') . " WHERE type_id='{$_REQUEST['id']}'"); /* 查询红包类型的商品列表 */ $goods_list = get_bonus_goods($_REQUEST['id']); /* 查询其他红包类型的商品 */ $sql = "SELECT goods_id FROM " . $ecs->table('goods') . " WHERE bonus_type_id > 0 AND bonus_type_id <> '{$_REQUEST['id']}'"; $other_goods_list = $db->getCol($sql); $smarty->assign('other_goods', join(',', $other_goods_list)); /* 模板赋值 */ $smarty->assign('cat_list', cat_list_supplier()); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('bonus_type', $bonus_type); $smarty->assign('goods_list', $goods_list); $smarty->display('bonus_by_goods.htm'); } elseif ($_REQUEST['send_by'] == SEND_BY_PRINT) { $smarty->assign('type_list', get_bonus_type()); $smarty->display('bonus_by_print.htm'); } } /*------------------------------------------------------ */ //-- 处理红包的发送页面 /*------------------------------------------------------ */ if ($_REQUEST['act'] == 'send_by_user') { $user_list = array(); $start = empty($_REQUEST['start']) ? 0 : intval($_REQUEST['start']);
/** * 获得指定分类下所有底层分类的ID * * @access public * @param integer $cat 指定的分类ID * @param string $attr 用来标记sql语句中表简省的前缀 * @return string */ function get_children_supplier($cat = 0, $attr = 'sgc') { return $attr . '.cat_id ' . db_create_in(array_unique(array_merge(array($cat), array_keys(cat_list_supplier($cat, 0, false))))); }
$ur_here = $_LANG['01_goods_list_pass2']; } elseif ($_REQUEST['act'] == 'list' && $_REQUEST['supplier_status'] == '-1') { $ur_here = $_LANG['01_goods_list_pass3']; } elseif ($_REQUEST['act'] == 'list' && $_REQUEST['supplier_status'] == '') { $ur_here = $_LANG['01_goods_list']; } else { $ur_here = $_LANG['11_goods_trash']; } $smarty->assign('ur_here', $ur_here); $smarty->assign('supplier_status', $_REQUEST['supplier_status']); $action_link = $_REQUEST['act'] == 'list' ? add_link($code) : array('href' => 'goods.php?act=list', 'text' => $_LANG['01_goods_list']); $smarty->assign('action_link', $action_link); $smarty->assign('code', $code); // $smarty->assign('cat_list', cat_list(0, $cat_id)); //$smarty->assign('cat_list', cat_list_2(0, $cat_id)); $smarty->assign('cat_list', cat_list_supplier(0, $cat_id)); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('intro_list', get_intro_list()); $smarty->assign('lang', $_LANG); $smarty->assign('list_type', $_REQUEST['act'] == 'list' ? 'goods' : 'trash'); $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1); $suppliers_list = suppliers_list_info(' is_check = 1 '); $suppliers_list_count = count($suppliers_list); $smarty->assign('suppliers_list', $suppliers_list_count == 0 ? 0 : $suppliers_list); // 取供货商列表 $goods_list = goods_list($_REQUEST['act'] == 'list' ? 0 : 1, $_REQUEST['act'] == 'list' ? $code == '' ? 1 : 0 : -1); $smarty->assign('goods_list', $goods_list['goods']); $smarty->assign('filter', $goods_list['filter']); $smarty->assign('record_count', $goods_list['record_count']); $smarty->assign('page_count', $goods_list['page_count']); $smarty->assign('full_page', 1);