ectouch 商城价格

2025-05-18 02:19:08
推荐回答(2个)
回答1:

您好,感谢您使用ectouch。
针对您这个问题,ectouch官方给出如下解答:
ECTouch商品详情页显示销量为0,一般原因可能是订单没有全部完成,也就是订单需要用户收货确认,才能算一笔销量。
如果这点满足,且还是没有出来,则就是代码的问题了。

找到文件 mobile/include/apps/default/common/function.php 搜索函数 get_goods_count
主要代码如下:
/**
* 获取商品销量总数
*
* @access public
* @param integer $goods_id
* @return integer
*/
function get_goods_count($goods_id)
{
/* 统计时间段 */
$period = C('top10_time');
$ext = '';
if ($period == 1) {// 一年
$ext = "AND o.add_time >'" . local_strtotime('-1 years') . "'";
} elseif ($period == 2) {// 半年
$ext = "AND o.add_time > '" . local_strtotime('-6 months') . "'";
} elseif ($period == 3) {// 三个月
$ext = " AND o.add_time > '" . local_strtotime('-3 months') . "'";
} elseif ($period == 4) {// 一个月
$ext = " AND o . add_time > '" . local_strtotime(' - 1 months') . "'";
}
/* 查询该商品销量 */
$sql = 'SELECT IFNULL(SUM(g.goods_number), 0) as count ' .
'FROM '. M()->pre .'order_info AS o, '. M()->pre .'order_goods AS g ' .
"WHERE o . order_id = g . order_id " .
" AND o . order_status " . db_create_in(array(OS_CONFIRMED, OS_SPLITED)) .
" AND o . shipping_status " . db_create_in(array(SS_SHIPPED, SS_RECEIVED)) .
" AND o . pay_status " . db_create_in(array(PS_PAYED, PS_PAYING)) .
" AND g . goods_id = '$goods_id'";
$result = M()->getRow($sql);
return $result['count'];
}

然后就可以在商品详情页,调用这个方法。
例如:mobile/include/apps/default/controller/GoodsController.class.php
$this->assign('sales_count', model('GoodsBase')->get_sales_count($this->goods_id));

希望对您有所帮助,您也可以前往ectouch官方或模板堂查看对应的教程。

回答2:

这个是源码演示吧,后台没改价格