站酷模板网,专注dedecms模板分享.包括织梦企业网站模板,织梦商业模板,织梦免费模板,织梦整站模板带数据下载等
用户名:
密码:
注册

织梦源码,织梦整站

VIP

CMS教程

站长学院

ecshop获取最新购买代码函数

www.adminbuy.cn / 2015-08-15
function index_get_recent_buy_query() 
  
    $sql="select og.goods_id,og.goods_name,sum(og.goods_number) as buy_count from (select order_id,add_time from ".$GLOBALS['ecs']->table('order_info')." order by add_time desc limit 10) as o,".$GLOBALS['ecs']->table('order_goods')." as og where o.order_id=og.order_id group by og.goods_id"; 
    $all = $GLOBALS['db']->getAll($sql); 
    $arr = array(); 
    foreach ($all AS $idx =>$row) 
    { 
  
        $arr[$idx]['goodName']  = $row['goods_name']; 
        $arr[$idx]['goodID']    = $row['goods_id']; 
        $arr[$idx]['add_time']  = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']); 
        $arr[$idx]['buy_count']=$row['buy_count']; 
    } 
    return $arr; 
收缩