.dwt页面怎么读取里面的信息
2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家
/** * 获得指定的品牌下的商品 * * @accesspublic * @paraminteger$brand_id 品牌的ID * @paraminteger$num数量 * @paraminteger$cat_id分类编号 * @paramstring$order_rule指定商品排序规则 * @returnvoid */ function assign_brand_goods($brand_id, $num = 0, $cat_id = 0,$order_rule = '') { $sql ='SELECT g.goods_id, g.goods_name, g.market_price, g.shop_price AS org_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". 'g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img ' . 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ". "WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND g.brand_id = '$brand_id'"; if ($cat_id > 0) { $sql .= get_children($cat_id); } $order_rule = empty($order_rule) ? ' ORDER BY g.sort_order, g.goods_id DESC' : $order_rule; $sql .= $order_rule; if ($num > 0) { $res = $GLOBALS['db']->selectLimit($sql, $num); } else { $res = $GLOBALS['db']->query($sql); } $idx = 0; $goods = array(); while ($row = $GLOBALS['db']->fetchRow($res)) { if ($row['promote_price'] > 0) { $promote_price = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']); } else { $promote_price = 0; } $goods[$idx]['id']= $row['goods_id']; $goods[$idx]['name'] = $row['goods_name']; $goods[$idx]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $goods[$idx]['market_price']= price_format($row['market_price']); $goods[$idx]['shop_price'] = price_format($row['shop_price']); $goods[$idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : ''; $goods[$idx]['brief']= $row['goods_brief']; $goods[$idx]['thumb']= get_image_path($row['goods_id'], $row['goods_thumb'], true); $goods[$idx]['goods_img']= get_image_path($row['goods_id'], $row['goods_img']); $goods[$idx]['url']= build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); $idx++; } /* 分类信息 */ $sql = 'SELECT brand_name FROM ' . $GLOBALS['ecs']->table('brand') . " WHERE brand_id = '$brand_id'"; $brand['id']= $brand_id; $brand['name'] = $GLOBALS['db']->getOne($sql); $brand['url']= build_uri('brand', array('bid' => $brand_id), $brand['name']); $brand_goods = array('brand' => $brand, 'goods' => $goods); return $brand_goods; } 返回的好像是二维数组 不知该怎么读 |
回答:
这个很简单啊。你可以用foreach去处理 |
楼上正解。 |
<!--{foreachfrom=$shop_list item=shop name=num}--> <a><!--{$shop.0.name}--></a> 这样才能获得天堂的值 <a><!--{$shop.name}--></a> 这种形式获不到 <!--{/foreach}--> 该怎么循环了 |
最近更新
常用插件
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
ecshop热门问答
ecshop热门资料
ecshop左上角
mysql支持
ecshop多用戶商城
ecshop飞信短信
ecshop环球宝贝商城
ecshop免费域名
ecshop支付宝登录
ecshop死链
ecshop百度搜索
ecshopMALLCOOL
ecshop服务费
ecshop传送
ecshop发信
ecshop汇总
ecshoptitle
ecshop使用指导
ecshop业绩
ecshop多数量
ecshopecs
ecshop200
ecshopMan
ecshop破格
ecshop合理
ecshopASP
ecshop商品属性分类
ecshop散光
ecshophelphelphelp
ecshop中文
ecshop产品页
邮件密码