diff --git a/admin/controllers/items/Cost.php b/admin/controllers/items/Cost.php
index 0ac777f8..7fa6942a 100644
--- a/admin/controllers/items/Cost.php
+++ b/admin/controllers/items/Cost.php
@@ -156,7 +156,9 @@ class Cost extends HD_Controller{
$autoList[3] = $this->auto_attr_model->select(array('status > -1' => null, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
- $count = $this->items_cost_model->count($where);
+ #$count = $this->items_cost_model->count($where);var_dump($count);
+ $aggs = $this->items_cost_model->get($where, 'count(*) as doc_count, sum(srv_price) as srv_price_sum, sum(car_price) as car_price_sum');
+ $count = $aggs['doc_count'];
$lists = [];
if($count){
$rows = $this->items_cost_model->select($where,'id desc',$page,$size);
@@ -232,6 +234,7 @@ class Cost extends HD_Controller{
#$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
$this->data['lists'] = $lists;
+ $this->data['aggs'] = $aggs;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['autoList'] = $autoList;
$this->data['params'] = $params;
diff --git a/admin/views/items/cost/lists.php b/admin/views/items/cost/lists.php
index 0d819ba5..aa985628 100644
--- a/admin/views/items/cost/lists.php
+++ b/admin/views/items/cost/lists.php
@@ -129,7 +129,18 @@
+
+
+
+