您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop获取很新购买代码函数

宛儿2023-12-21 21:35:11ecshop商城教程已有人查阅

导读ecshop获取很新购买代码函数function index_get_recent_buy_query() { $sql="select og

ecshop获取很新购买代码函数
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;
}

本文标签:

很赞哦! ()

相关文章

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签