五边形评分

This commit is contained in:
lcc
2024-11-02 17:50:44 +08:00
parent 5785dd2ab1
commit 5daeda5bb9
2 changed files with 160 additions and 35 deletions
+101 -5
View File
@@ -13,6 +13,8 @@ class Score extends Wxapp
$this->load->model('receiver/receiver_score_month_model');
$this->load->model('receiver/receiver_score_log_model');
$this->load->model('app/licheb/app_licheb_users_model');
$this->load->model('receiver/receiver_customers_model', 'customers_model');
$this->load->model('receiver/order/receiver_orders_model', 'orders_model');
$this->biz_id = $this->get_biz_id();
$this->group_id = $this->session['group_id'];
}
@@ -97,12 +99,12 @@ class Score extends Wxapp
'u_time_text' => "*更新于" . $up_time,
'score_trend' => $score_trend, //控制样式:1 上升 、2 下降
'desc' => '<p><b>如何提升运营分?</b></p>
<p>运营分是根据个人在理车宝的基础分、线索分、订单分等方面综合计算得出的分值,运营分按天每日更新,可通过以下方式提升运营分:</p>
<p>基础分:每日初始基本分为50分,当日登录理车宝进行信息查询、线索跟进等操作即视为开工,可再得10分</p>
<p>线索分:录入线索并且按要求完善信息,无论是平台分配还是自录线索都按时跟进回访并做好小记,尽可能添加客户微信并上传截图,使用系统提供的虚拟电话联系客户留存回访录音以便复盘。
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;运营分是根据个人在理车宝的基础分、线索分、订单分等方面综合计算得出的分值,运营分按天每日更新,可通过以下方式提升运营分:</p>
<p><b>基础分:</b>每日初始基本分为50分,当日登录理车宝进行信息查询、线索跟进等操作即视为开工,可再得10分</p>
<p><b>线索分:</b>录入线索并且按要求完善信息,无论是平台分配还是自录线索都按时跟进回访并做好小记,尽可能添加客户微信并上传截图,使用系统提供的虚拟电话联系客户留存回访录音以便复盘。
单条线索不因重复动作而多次加分,分值次日更新,每日新增/跟进的线索越多,线索分越多。</p>
<p>订单分:新增订单并且按要求完善信息,上传相关资料。产生订单时应及时录入系统,否则会因订单时间逻辑不符而导致扣分。分值次日更新,新增订单越多,相关资料上传越完善,订单分越多。</p>
<p>扣分:理车宝使用过程,未按规范要求操作,将会导致运营分被扣。</p><p><b>具体如下:</b></p>
<p><b>订单分:</b>新增订单并且按要求完善信息,上传相关资料。产生订单时应及时录入系统,否则会因订单时间逻辑不符而导致扣分。分值次日更新,新增订单越多,相关资料上传越完善,订单分越多。</p>
<p><b>扣分:</b>理车宝使用过程,未按规范要求操作,将会导致运营分被扣。</p><p><b>具体如下:</b></p>
<p>* 线索逾期未跟进;</p>
<p>* 店长分配线索后未及时跟进,时间超过15分钟;</p>
<p>* 线索未提前录入,与下单时间间隔少于T+1;</p>
@@ -183,4 +185,98 @@ class Score extends Wxapp
}
return ['data' => $data, 'score' => $user_score, 'up_data_score' => $up_data_score, 'change_text' => $change_text, 'score_trend' => $score_trend];
}
public function get_radar()
{
$biz = (new Biz_model())->get(['id' => $this->biz_id]);
$province_id = $biz['province_id'];
$s_time = date('Y-m-d 00:00:00');
$e_time = date('Y-m-d 23:59:59');
$s_stime = strtotime($s_time);
$s_etime = strtotime($e_time);
$indicator = [
['name' => '拓客能力', 'max' => 0],
['name' => '跟进能力', 'max' => 0],
['name' => '邀约能力', 'max' => 0],
['name' => '成交能力', 'max' => 0],
['name' => '交付能力', 'max' => 0]
];
$series_value = [];
foreach ($indicator as $key => $value) {
switch ($key) {
case 0:
$where = [
'status>=' => 0,
'province_id' => $province_id,
'c_time >=' => $s_stime,
'c_time <=' => $s_etime,
];
$indicator[$key]['max'] = $this->customers_model->count($where);
$where['biz_id'] = $this->biz_id;
$value = $this->customers_model->count($where);
break;
case 1:
$sub_sql = "select DISTINCT customer_id from lc_receiver_customer_oplogs where c_time>={$s_stime} and c_time>={$s_etime}";
$where = [
'status>=' => 0,
'province_id' => $province_id,
'c_time >=' => strtotime($s_time),
'c_time <=' => strtotime($e_time),
"id in ($sub_sql)" => null
];
$indicator[$key]['max'] = $this->customers_model->count($where);
$where['biz_id'] = $this->biz_id;
$value = $this->customers_model->count($where);
break;
case 2:
$where = [
'status>=' => 0,
'province_id' => $province_id,
'dt_time >=' => $s_time,
'dt_time <=' => $e_time,
];
$indicator[$key]['max'] = $this->customers_model->count($where);
$where['biz_id'] = $this->biz_id;
$value = $this->customers_model->count($where);
break;
case 3:
$where = [
'status>=' => 0,
'province_id' => $province_id,
'c_time >=' => $s_stime,
'c_time <=' => $s_etime,
];
$indicator[$key]['max'] = $this->customers_model->count($where);
$sub_sql = "select id from lc_receiver_customers where province_id={$province_id} and biz_id={$this->biz_id} and c_time>={$s_stime} and c_time>={$s_etime}";
$where = [
'status>=' => 0,
'biz_id' => $this->biz_id,
'c_time >=' => strtotime($s_time),
'c_time <=' => strtotime($e_time),
"customer_id in ($sub_sql)" => null
];
$value = $this->orders_model->count($where);
break;
case 4:
$sub_sql = "select id from lc_receiver_customers where province_id={$province_id} and c_time>={$s_stime} and c_time>={$s_etime}";
$where = [
'status>=' => 0,
'c_time >=' => strtotime($s_time),
'c_time <=' => strtotime($e_time),
"customer_id in ($sub_sql)" => null
];
$indicator[$key]['max'] = $this->orders_model->count($where);
$where['status'] = 3;
$where['biz_id'] = $this->biz_id;
$value = $this->orders_model->count($where);
default:
}
$series_value[] = $value;
}
$data = [
'indicator' => $indicator,
'series_value' => $series_value
];
return $data;
}
}
+59 -30
View File
@@ -670,13 +670,20 @@ class Statistics extends Wxapp{
$customers = $this->customers_model->count($c_where);
//进店
// $s_where = [
// "c_time>=" => $c_time['s_time'],
// "c_time<=" => $c_time['e_time'],
// "status" => 1,
// "biz_id in ({$biz_id_arr})" => null,
// ];
// $sign = $this->customer_sign_model->count($s_where);
$s_where = [
"c_time>=" => $c_time['s_time'],
"c_time<=" => $c_time['e_time'],
"status" => 1,
'status>=' => 0,
'dt_time>=' => $o_time['s_time'],
'dt_time<=' => $o_time['e_time'],
"biz_id in ({$biz_id_arr})" => null,
];
$sign = $this->customer_sign_model->count($s_where);
$sign = $this->customers_model->count($s_where);
//个微
$g_where = [
@@ -824,18 +831,25 @@ class Statistics extends Wxapp{
foreach ($sdata_level as $v) {
if($type == 1){
$title = '到店客户';
// $where = [
// "a.c_time>=" => $c_time['s_time'],
// "a.c_time<=" => $c_time['e_time'],
// "a.status" => 1,
// "b.level" => $v,
// "b.biz_id in ({$biz_id_arr})" => null,
// ];
// $value = $this->customer_sign_model->db->select('a.id')
// ->from('lc_receiver_customer_sign as a')
// ->join('lc_receiver_customers as b', "a.customer_id=b.id", 'left')
// ->where($where)
// ->count_all_results();
$where = [
"a.c_time>=" => $c_time['s_time'],
"a.c_time<=" => $c_time['e_time'],
"a.status" => 1,
"b.level" => $v,
"b.biz_id in ({$biz_id_arr})" => null,
'status>=' => 0,
'dt_time>=' => $o_time['s_time'],
'dt_time<=' => $o_time['e_time'],
"biz_id in ({$biz_id_arr})" => null
];
$value = $this->customer_sign_model->db->select('a.id')
->from('lc_receiver_customer_sign as a')
->join('lc_receiver_customers as b', "a.customer_id=b.id", 'left')
->where($where)
->count_all_results();
$value = $this->customers_model->count($where);
}elseif($type == 2){
$title = '添加微信';
$c_where = [
@@ -884,18 +898,26 @@ class Statistics extends Wxapp{
if($type == 1){
//到店
// $where = [
// "a.c_time>=" => $c_time['s_time'],
// "a.c_time<=" => $c_time['e_time'],
// "a.status" => 1,
// "b.of_id" => $k,
// "b.biz_id in ({$biz_id_arr})" => null,
// ];
// $value = $this->customer_sign_model->db->select('a.id')
// ->from('lc_receiver_customer_sign as a')
// ->join('lc_receiver_customers as b', "a.customer_id=b.id", 'left')
// ->where($where)
// ->count_all_results();
$where = [
"a.c_time>=" => $c_time['s_time'],
"a.c_time<=" => $c_time['e_time'],
"a.status" => 1,
"b.of_id" => $k,
"b.biz_id in ({$biz_id_arr})" => null,
'status>=' => 0,
'of_id' => $k,
'dt_time>=' => $o_time['s_time'],
'dt_time<=' => $o_time['e_time'],
"biz_id in ({$biz_id_arr})" => null
];
$value = $this->customer_sign_model->db->select('a.id')
->from('lc_receiver_customer_sign as a')
->join('lc_receiver_customers as b', "a.customer_id=b.id", 'left')
->where($where)
->count_all_results();
$value = $this->customers_model->count($where);
}elseif($type == 2){
//个微
$c_where = [
@@ -941,13 +963,20 @@ class Statistics extends Wxapp{
$biz_arr[] = str_replace('车卖场', '', $v['biz_name']);
if($type == 1){
//进店
$s_where = [
"c_time>=" => $c_time['s_time'],
"c_time<=" => $c_time['e_time'],
"status" => 1,
"biz_id" => $v['id'],
// $s_where = [
// "c_time>=" => $c_time['s_time'],
// "c_time<=" => $c_time['e_time'],
// "status" => 1,
// "biz_id" => $v['id'],
// ];
// $value = $this->customer_sign_model->count($s_where);
$where = [
'status>=' => 0,
'biz_id' => $v['id'],
'dt_time>=' => $o_time['s_time'],
'dt_time<=' => $o_time['e_time'],
];
$value = $this->customer_sign_model->count($s_where);
$value = $this->customers_model->count($where);
}elseif($type == 2){
$where = [
'status>=' => 0,