From d3d48529b6e0549d746e5d643617ce087026d0ec Mon Sep 17 00:00:00 2001 From: lin fan Date: Thu, 21 Nov 2024 17:00:15 +0800 Subject: [PATCH] 1 --- api/controllers/wxapp/licheb/Score.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/controllers/wxapp/licheb/Score.php b/api/controllers/wxapp/licheb/Score.php index 4c0ce33a..8c374249 100644 --- a/api/controllers/wxapp/licheb/Score.php +++ b/api/controllers/wxapp/licheb/Score.php @@ -228,6 +228,7 @@ class Score extends Wxapp $bizs = (new Biz_model())->select(['province_id' => $province_id, 'status' => 1]); $biz_id_arr = implode(',', array_unique(array_column($bizs, 'id'))); !$biz_id_arr && $biz_id_arr = 0; + $biz_count = count($bizs); $names = [ '拓客能力', '跟进能力', '邀约能力', '成交能力', '交付能力']; $series_value = []; @@ -246,7 +247,7 @@ class Score extends Wxapp $where['biz_id'] = $this->biz_id; $value = $this->customers_model->count($where); $series_value[] = $value ? $value : 1; - $max_total[] = $max ? $max : 10 ; + $max_total[] = $max ? $max/$biz_count*5 : 10 ; //跟进能力 $where_max = $where = [ @@ -258,7 +259,7 @@ class Score extends Wxapp $where['biz_id'] = $this->biz_id; $value = $this->customers_model->count($where); $series_value[] = $value ? $value : 1; - $max_total[] = $max ? $max : 10 ; + $max_total[] = $max ? $max/$biz_count*5 : 10 ; //邀约能力 $where_max = $where = [ @@ -271,7 +272,7 @@ class Score extends Wxapp $where['biz_id'] = $this->biz_id; $value = $this->customers_model->count($where); $series_value[] = $value ? $value : 1; - $max_total[] = $max ? $max : 10 ; + $max_total[] = $max ? $max/$biz_count*5 : 10 ; //成交能力 $where_max = $where = [ @@ -284,7 +285,7 @@ class Score extends Wxapp $where["biz_id"] = $this->biz_id; $value = $this->orders_model->count($where); $series_value[] = $value ? $value : 1; - $max_total[] = $max ? $max : 10 ; + $max_total[] = $max ? $max/$biz_count*5 : 10 ; //交付能力 $where_max = $where = [ @@ -297,7 +298,7 @@ class Score extends Wxapp $where["biz_id"] = $this->biz_id; $value = $this->orders_model->count($where); $series_value[] = $value ? $value : 1; - $max_total[] = $max ? $max : 10 ; + $max_total[] = $max ? $max/$biz_count*5 : 10 ; foreach ($names as $key => $value) { $indicator[] = array('name' => $value, 'max' => $max_total[$key]);