作者 王智

baoxiu22

@@ -82,15 +82,24 @@ class Dashboard extends Backend @@ -82,15 +82,24 @@ class Dashboard extends Backend
82 $data[$k]['id'] = $v['id']; 82 $data[$k]['id'] = $v['id'];
83 $data[$k]['zhandian_name'] = $v['zhandian']; 83 $data[$k]['zhandian_name'] = $v['zhandian'];
84 $BaoXiuZhandian = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->select(); 84 $BaoXiuZhandian = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->select();
  85 + $BaoxiuWancheng = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->where('type', 2)->select();
  86 + $BaoxiuWeiWancheng = Db::name('baoxiudan')->where('zhandian_id', $v['id'])->where($map)->where('type', 1)->select();
  87 + $Round = round(count($BaoxiuWancheng) / count($BaoxiuArr) * 100, 2);
  88 + $WRound = round(count($BaoxiuWeiWancheng) / count($BaoxiuArr) * 100, 2);
85 if (empty($BaoXiuZhandian)) { 89 if (empty($BaoXiuZhandian)) {
86 $data[$k]['baoxiu_num'] = 0; 90 $data[$k]['baoxiu_num'] = 0;
87 $data[$k]['BaoXiuStr'] = ''; 91 $data[$k]['BaoXiuStr'] = '';
  92 + $data[$k]['Round'] = '无记录';
  93 + $data[$k]['WRound'] = '无记录';
  94 +
88 } else { 95 } else {
89 $data[$k]['baoxiu_num'] = count($BaoXiuZhandian); 96 $data[$k]['baoxiu_num'] = count($BaoXiuZhandian);
90 foreach ($BaoXiuZhandian as $k1 => $v1) { 97 foreach ($BaoXiuZhandian as $k1 => $v1) {
91 $StrArr[$k1] = $v1['colum']; 98 $StrArr[$k1] = $v1['colum'];
92 } 99 }
93 $data[$k]['BaoXiuStr'] = implode($StrArr, ','); 100 $data[$k]['BaoXiuStr'] = implode($StrArr, ',');
  101 + $data[$k]['Round'] = $Round;
  102 + $data[$k]['WRound'] = $WRound;
94 } 103 }
95 } 104 }
96 $this->view->assign("row", $data); 105 $this->view->assign("row", $data);
@@ -289,19 +289,24 @@ @@ -289,19 +289,24 @@
289 <span class="label label-success">{:__('Real time')}</span> 289 <span class="label label-success">{:__('Real time')}</span>
290 <h5 id="H5Name" onmouseover="func()" onmouseout="func1()"> 290 <h5 id="H5Name" onmouseover="func()" onmouseout="func1()">
291 {$vo.zhandian_name}</h5> 291 {$vo.zhandian_name}</h5>
292 -  
293 - <div class="panel-content">  
294 - <h1>{$vo.baoxiu_num}</h1>  
295 - <!--<div class="stat-percent font-bold text-gray"><i class="fa fa-commenting"></i>-->  
296 - <!--1234-->  
297 - <!--</div>-->  
298 - <!--<small>{:__('Category count tips')}</small>-->  
299 - <br>  
300 - </div>  
301 - <h4>故障设备名称:</h4>  
302 - <h5>{$vo.BaoXiuStr}</h5>  
303 </div> 292 </div>
  293 + <div class="panel-content">
  294 + <h1>{$vo.baoxiu_num}</h1>
  295 + <!--<div class="stat-percent font-bold text-gray"><i class="fa fa-commenting"></i>-->
  296 + <!--1234-->
  297 + <!--</div>-->
  298 + <!--<small>{:__('Category count tips')}</small>-->
  299 + <br>
304 </div> 300 </div>
  301 + <h4>故障设备名称:</h4>
  302 + <h5>{$vo.BaoXiuStr}</h5>
  303 +
  304 + <h4>报修完成率:</h4>
  305 + <h5>{$vo.Round}</h5>
  306 + <h4>报修未完成率:</h4>
  307 + <h5>{$vo.WRound}</h5>
  308 +
  309 + </div>
305 </div> 310 </div>
306 </div> 311 </div>
307 {/foreach} 312 {/foreach}