...
|
...
|
@@ -74,21 +74,29 @@ class AdminTestController extends AdminBaseController |
|
|
->alias('s')
|
|
|
->join('years y','s.id = y.spot_id','LEFT')
|
|
|
->where(['s.test_id'=>$id])
|
|
|
->field('s.id,y.uid,s.spot_name,y.create_time,y.images')
|
|
|
->field('s.id,y.uid,s.spot_name,y.create_time,y.images,y.status')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
$inspect_a = new AdminInspectAController();
|
|
|
foreach($spot as &$value){
|
|
|
$test_user = $this->getUserBid($value['uid']);
|
|
|
$value['create_time'] = !empty($value['create_time'])&&isset($value['create_time'])?date('Y-m-d',$value['create_time']):'';
|
|
|
$value['create_time'] = !empty($value['create_time'])?date('Y-m-d',$value['create_time']):'';
|
|
|
$value['test_user'] = !empty($test_user)?$test_user['user_login']:'';
|
|
|
$value['status'] = isset($value['status'])?$value['status']:2;
|
|
|
$value['images'] = $inspect_a->absolutionUrl($value['images']);
|
|
|
}
|
|
|
$res['spot'] = $spot;
|
|
|
$res['status'] = $this->getStatus();
|
|
|
$this->assign('post',$res);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
//年检点状态
|
|
|
public function getStatus(){
|
|
|
$res = ['正常','故障','未检查'];
|
|
|
return $res;
|
|
|
}
|
|
|
|
|
|
//获取用户名
|
|
|
public function getUserBid($uid){
|
|
|
$res = Db::name('user')
|
...
|
...
|
|