/** * 列表页 前置 */ public function _before_index() { //获取商品类型存在规格的类型 $specifications = get_goods_type_specifications(); $this->assign('specifications', $specifications); //商品分类 $model = M('Product_category'); $data['status'] = 1; //$data['_string'] = "find_in_set('商城',channel)"; $category = $model->where($data)->select(); $tree = new \My\Tree($category); $category = $tree->get_tree('0'); $this->assign('category', $category); //品牌 $model = M('Brand'); $b_data['status'] = 1; $brands = $model->where($b_data)->select(); $this->assign('brands', $brands); }
$smarty->assign('add_handler', $handler_list[$code]); } $action_list = if_agency() ? 'all' : ''; $smarty->assign('all', $action_list); $smarty->assign('code', $code); $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('list_type', $is_delete ? 'trash' : 'goods'); $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1); /* 排序标记 */ $sort_flag = sort_flag($goods_list['filter']); $smarty->assign($sort_flag['tag'], $sort_flag['img']); /* 获取商品类型存在规格的类型 */ $specifications = get_goods_type_specifications(); $smarty->assign('specifications', $specifications); make_json_result($smarty->fetch($tpl), '', array('filter' => $goods_list['filter'], 'page_count' => $goods_list['page_count'])); } elseif ($_REQUEST['act'] == 'remove') { $goods_id = intval($_REQUEST['id']); /*add by hg for date 2014-03-26 判断代理商是否非法操作商品*/ static_goods($_REQUEST['goods_id']); /*end*/ /* 检查权限 */ check_authz_json('remove_back'); if ($exc->edit("is_delete = 1", $goods_id)) { clear_cache_files(); $goods_name = $exc->get_name($goods_id); admin_log(addslashes($goods_name), 'trash', 'goods'); // 记录日志 $url = 'goods.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
public function _before_edit() { //获取商品类型存在规格的类型 $specifications = get_goods_type_specifications(); $this->assign('specifications', $specifications); }