sth
This commit is contained in:
parent
0d4378a1a7
commit
a07984a09a
|
|
@ -263,7 +263,7 @@ class Kpidispatcher extends Backend
|
|||
}else{
|
||||
$datum->admin_user = '系统';
|
||||
}
|
||||
$datum->avg_time_diff = $this->_calc($datum->avg_time_diff,3600,2);
|
||||
$datum->avg_time_diff = $this->_calc($datum->avg_time_diff,3600,4);
|
||||
|
||||
$datum->id = $datum->dispatch_admin_id;
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ class Kpidispatcher extends Backend
|
|||
$datum->pdsx_score = 0;
|
||||
$datum->pdsx_target_value = $kpiItem[KpiItem::ATTR_PDSX]['target_value']??0; //秒
|
||||
if (!empty($kpiItem[KpiItem::ATTR_PDSX])) {
|
||||
$datum->pdsx_score = $this->_kpi_score($datum->avg_time_diff, $kpiItem[KpiItem::ATTR_PDSX]);
|
||||
$datum->pdsx_score = $this->_kpi_score($datum->avg_time_diff, $kpiItem[KpiItem::ATTR_PDSX],$fande=true);
|
||||
$kpi_total += $datum->pdsx_score;
|
||||
//$datum->pdsx_unit = $kpiItem[KpiItem::ATTR_PDSX]['unit'];
|
||||
}
|
||||
|
|
@ -365,14 +365,22 @@ class Kpidispatcher extends Backend
|
|||
}
|
||||
|
||||
|
||||
private function _kpi_score($num,$item)
|
||||
private function _kpi_score($num,$item,$fande=false)
|
||||
{
|
||||
//完成值/目标值*单个指标分*权重
|
||||
|
||||
if($item['target_value'] == 0){
|
||||
$item['target_value'] = 1;
|
||||
}
|
||||
$rate = bcdiv($num,$item['target_value'],4);
|
||||
if($fande){
|
||||
if($num == 0){
|
||||
$num = $item['target_value'];
|
||||
}
|
||||
$rate = bcdiv($item['target_value'],$num,4);
|
||||
}else{
|
||||
$rate = bcdiv($num,$item['target_value'],4);
|
||||
}
|
||||
|
||||
$score = bcmul($item['score'],$rate,4);
|
||||
$score = bcmul($score,$item['pivot']['rate']/100,2);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user