ectouch 分页如何get 参数
2016-09-20
展开全部
前台显示的销量是在goods.dwt模板文件中,对应的字段是{$sales_count}
后台往前台的赋值程序是在GoodsController.class.php中的public function index()方法,
解决办法:
注释掉本行$this->assign('sales_count', model('GoodsBase')->get_sales_count($this->goods_id));
改成如下的三行代码:
/* 销量 start*/
$sql = "select sum(goods_number) as sales_count from".$this->model->pre."order_goods as g left join ".$this->model->pre."order_info as o on o.order_id=g.order_id where g.goods_id =".$this->goods_id;
$sales_count = M()->getOne($sql);
$this->assign('sales_count', $sales_count);
/* 销量 end*/
后台往前台的赋值程序是在GoodsController.class.php中的public function index()方法,
解决办法:
注释掉本行$this->assign('sales_count', model('GoodsBase')->get_sales_count($this->goods_id));
改成如下的三行代码:
/* 销量 start*/
$sql = "select sum(goods_number) as sales_count from".$this->model->pre."order_goods as g left join ".$this->model->pre."order_info as o on o.order_id=g.order_id where g.goods_id =".$this->goods_id;
$sales_count = M()->getOne($sql);
$this->assign('sales_count', $sales_count);
/* 销量 end*/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询