作者 王智

baoxiu22

... ... @@ -82,15 +82,24 @@ class Dashboard extends Backend
$data[$k]['id'] = $v['id'];
$data[$k]['zhandian_name'] = $v['zhandian'];
$BaoXiuZhandian = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->select();
$BaoxiuWancheng = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->where('type', 2)->select();
$BaoxiuWeiWancheng = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->where('type', 1)->select();
$Round = round(count($BaoxiuWancheng) / count($BaoxiuArr) * 100, 2);
$WRound = round(count($BaoxiuWeiWancheng) / count($BaoxiuArr) * 100, 2);
if (empty($BaoXiuZhandian)) {
$data[$k]['baoxiu_num'] = 0;
$data[$k]['BaoXiuStr'] = '';
$data[$k]['Round'] = '无记录';
$data[$k]['WRound'] = '无记录';
} else {
$data[$k]['baoxiu_num'] = count($BaoXiuZhandian);
foreach ($BaoXiuZhandian as $k1 => $v1) {
$StrArr[$k1] = $v1['colum'];
}
$data[$k]['BaoXiuStr'] = implode($StrArr, ',');
$data[$k]['Round'] = $Round;
$data[$k]['WRound'] = $WRound;
}
}
$this->view->assign("row", $data);
... ...
... ... @@ -289,19 +289,24 @@
<span class="label label-success">{:__('Real time')}</span>
<h5 id="H5Name" onmouseover="func()" onmouseout="func1()">
{$vo.zhandian_name}</h5>
<div class="panel-content">
<h1>{$vo.baoxiu_num}</h1>
<!--<div class="stat-percent font-bold text-gray"><i class="fa fa-commenting"></i>-->
<!--1234-->
<!--</div>-->
<!--<small>{:__('Category count tips')}</small>-->
<br>
</div>
<h4>故障设备名称:</h4>
<h5>{$vo.BaoXiuStr}</h5>
</div>
<div class="panel-content">
<h1>{$vo.baoxiu_num}</h1>
<!--<div class="stat-percent font-bold text-gray"><i class="fa fa-commenting"></i>-->
<!--1234-->
<!--</div>-->
<!--<small>{:__('Category count tips')}</small>-->
<br>
</div>
<h4>故障设备名称:</h4>
<h5>{$vo.BaoXiuStr}</h5>
<h4>报修完成率:</h4>
<h5>{$vo.Round}</h5>
<h4>报修未完成率:</h4>
<h5>{$vo.WRound}</h5>
</div>
</div>
</div>
{/foreach}
... ...