diff --git a/api/controllers/wxapp/licheb/Score.php b/api/controllers/wxapp/licheb/Score.php index 9f3fe90e..9b44bad3 100644 --- a/api/controllers/wxapp/licheb/Score.php +++ b/api/controllers/wxapp/licheb/Score.php @@ -235,7 +235,8 @@ class Score extends Wxapp $where_max["biz_id in ($biz_id_arr)"] = null; $max = $this->customers_model->count($where_max); $where['biz_id'] = $this->biz_id; - $series_value[] = $this->customers_model->count($where); + $value = $this->customers_model->count($where); + $series_value[] = $value > $max / 10 ? round($value / $max, 1) : 0.1; $max_total = $max_total + $max; //跟进能力 @@ -246,7 +247,8 @@ class Score extends Wxapp $where_max["biz_id in ($biz_id_arr)"] = null; $max = $this->customers_model->count($where_max); $where['biz_id'] = $this->biz_id; - $series_value[] = $this->customers_model->count($where); + $value = $this->customers_model->count($where); + $series_value[] = $value > $max / 10 ? round($value / $max, 1) : 0.1; $max_total = $max_total + $max; //邀约能力 @@ -258,7 +260,8 @@ class Score extends Wxapp $where_max["biz_id in ($biz_id_arr)"] = null; $max = $this->customers_model->count($where_max); $where['biz_id'] = $this->biz_id; - $series_value[] = $this->customers_model->count($where); + $value = $this->customers_model->count($where); + $series_value[] = $value > $max / 10 ? round($value / $max, 1) : 0.1; $max_total = $max_total + $max; //成交能力 @@ -270,7 +273,8 @@ class Score extends Wxapp $where_max["biz_id in ($biz_id_arr)"] = null; $max = $this->orders_model->count($where_max); $where["biz_id"] = $this->biz_id; - $series_value[] = $this->orders_model->count($where); + $value = $this->orders_model->count($where); + $series_value[] = $value > $max / 10 ? round($value / $max, 1) : 0.1; $max_total = $max_total + $max; //交付能力 @@ -282,11 +286,13 @@ class Score extends Wxapp $where_max["biz_id in ($biz_id_arr)"] = null; $max = $this->orders_model->count($where_max); $where["biz_id"] = $this->biz_id; - $series_value[] = $this->orders_model->count($where); + $value = $this->orders_model->count($where); + $series_value[] = $value > $max / 10 ? round($value / $max, 1) : 0.1; $max_total = $max_total + $max; - foreach ($names as $value) { + foreach ($names as $key => $value) { $indicator[] = array('name' => $value, 'max' => $max_total/5); + $series_value[$key] = ($max_total/5) * $series_value[$key]; } $data = [