其他页面显示购买记录的函数

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家



  1. function get_bought_notes()
  2. {

  3. $sql = 'SELECT u.user_name, og.goods_number,og.goods_id,og.goods_name,oi.shipping_name ,oi.invoice_no, oi.add_time, IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .
  4. 'FROM ' . $ecs->table('order_info') . ' AS oi LEFT JOIN ' . $ecs->table('users') . ' AS u ON oi.user_id = u.user_id, ' . $ecs->table('order_goods') . ' AS og ' .
  5. 'WHERE oi.order_id = og.order_id AND ' . time() . ' - oi.add_time < 2592000ORDER BY oi.add_time DESC LIMIT 5';
  6. $bought_notes = $db->getAll($sql);
  7. foreach($bought_notes as $idx=>$value)
  8. {
  9. $goods_id = $value['goods_id'];
  10. $bought_notes[$idx]['goods_thumb'] = $db->getOne("select goods_thumb from ".$ecs->table('goods')." where goods_id='$goods_id'");
  11. }
  12. return $bought_notes;
  13. }
复制代码

  1. <!--{foreach from=$bought_notes item=bought}-->
  2. <div class="leftdown_one">
  3. <div class="one_pic"><a href="goods.php?id={$bought.goods_id}">
  4. <img src="{$bought.goods_thumb}" width="49" height="49" /></a></div>
  5. <ul class="leftdown_words">
  6. <li><span style="color:#b3ce00">{$bought.user_name}</span>拍下了:</li>
  7. <li style="color:#e70000">{$bought.goods_name}</li>
  8. <li>{$bought.shipping_name}:{$bought.invoice_no}</li>
  9. </ul>
  10. </div>
  11. <!--{/foreach}-->
复制代码
模板页的显示需要自己调样式我只是给一个例子。

回答:
这个很有引导购买的作用

不错www.phpiii.com

调用过来 首页还是无法显示 不知道是什么问题啊

很不错的说

面包屑一样,也算SEO的一种