From d34afc14c7f69a22cca1773d95b87d2a51f69cd3 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Sat, 21 Aug 2021 09:41:58 +0800 Subject: [PATCH] edit-api-liche-static --- api/controllers/wxapp/liche/Statistics.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/api/controllers/wxapp/liche/Statistics.php b/api/controllers/wxapp/liche/Statistics.php index 3b338e8c..6c4b9ed6 100644 --- a/api/controllers/wxapp/liche/Statistics.php +++ b/api/controllers/wxapp/liche/Statistics.php @@ -40,32 +40,30 @@ class Statistics extends Wxapp{ //根据车型获取统计 protected function get_car(){ - $this->load->model('auto/auto_series_model'); + $this->load->model('auto/auto_brand_model'); $uid = $this->session['uid']; $page = $this->input_param('page'); $size = $this->input_param('size'); !$page && $page = 1; !$size && $size = 20; - $t1 = 'lc_auto_series'; - $t2 = 'lc_auto_brand'; - $fileds = "$t1.id,$t1.name,$t2.name as brand_name"; + $fileds = "id,name"; $where = []; - $count = $this->auto_series_model->select_brand($where,'',$page,$size,$fileds,1); - $rows = $this->auto_series_model->select_brand($where,'',$page,$size,$fileds); + $count = $this->auto_brand_model->count($where); + $rows = $this->auto_brand_model->select($where,'',$page,$size,$fileds); $list = []; if($rows){ foreach($rows as $key => $val){ - $enroll = $this->clues_model->count(['app_id'=>$this->app_id,'recommend_id'=>$uid,'s_id'=>$val['id']]); + $enroll = $this->clues_model->count(['app_id'=>$this->app_id,'recommend_id'=>$uid,'brand_id'=>$val['id']]); $where = [ 'lc_receiver_clues.recommend_id' => $uid, - 'lc_receiver_clues.s_id' => $val['id'], + 'lc_receiver_clues.brand_id' => $val['id'], 'lc_receiver_orders.status' => 6 ]; $done = $this->clues_model->count_order($where); $commision = 0; $list[] = [ - 'title' => $val['brand_name'].$val['name'], + 'title' => $val['name'], 'enroll' => $enroll, 'done' => $done, 'commision' => number_format($done*500,2)