edit-api-liche-static

This commit is contained in:
lccsw
2021-08-21 09:41:58 +08:00
parent 90109969d9
commit 0778142916
+7 -9
View File
@@ -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)