作者 jinglong
1 个管道 的构建 通过 耗费 1 秒

增加年检检测详情的项目标题字段

... ... @@ -431,6 +431,15 @@ class CommonController extends RestBaseController
return $res;
}
//根据检测id获取检测项目名称
public function getTestTitle($test_id){
$res = Db::name('test')
->where('id',$test_id)
->field('id,title')
->find();
return $res;
}
//获取日检巡检列表
public function getInsList($project_id){
$identity = $this->user['identity'];
... ...
... ... @@ -242,7 +242,7 @@ class YearsController extends RestBaseController
* @return spot_name:检测点名称
* @return test_id:检测id
* @return status:检测点状态(0:正常,1:故障,2:未检测)
* @return title:项目标题
* @return title:检测项目标题
* @return images:检测点图片@
* @images image_url:图片路径 file_time:图片时间
*/
... ... @@ -264,10 +264,13 @@ class YearsController extends RestBaseController
$res['images'] = [];
//查询检测时间
$common = new CommonController();
//查询检测名称
$title = $common->getTestTitle($res['test_id']);
$res['title'] = $title['title'];
//根据检测时间查看是否检测巡检点
$years = $common->getYearsList($id,'status,images');
//查询项目名称
if($years){
$res['status'] = $years['status'];
$res['images'] = $common->absolutionUrl($years['images']);
... ...