作者 景龙
1 个管道 的构建 失败 耗费 0 秒

修改巡检时间戳

... ... @@ -156,6 +156,21 @@ class CommonController extends RestBaseController
return $res;
}
//根据乙方企业id获取项目所关联的培训相关信息
public function getTrainByCompanyBId($b_company_id,$page){
$limit = config('site.limit');
$res = Db::name('project')
->alias('p')
->join('train t','p.id = t.project_id')
->where(['p.b_cid'=>$b_company_id,'t.status'=>2])
->field('t.id,p.id project_id,p.name project_name,t.train_time')
->order('t.id desc')
->page($page,$limit)
->select()
->toArray();
return $res;
}
//获取企业相关信息
public function getCompany($where,$field){
$res = Db::name('company')
... ... @@ -225,8 +240,7 @@ class CommonController extends RestBaseController
$party = 1;
}
//获取今天的巡检信息(共同合作完成)
$time = date('Y-m-d',time());
$where = ['project_id'=>$result['id'],'create_time'=>$time,'party'=>$party];
$where = ['project_id'=>$result['id'],'party'=>$party];
$field = 'status,point_id';
$todayIns = $this->getTodayIns($where,$field);
$is_finish = 0;
... ... @@ -252,6 +266,7 @@ class CommonController extends RestBaseController
public function getTodayIns($where,$field){
$res = Db::name('inspect')
->where($where)
->whereTime('create_time','today')
->field($field)
->select()
->toArray();
... ...
... ... @@ -57,7 +57,9 @@ class InformationController extends RestBaseController
}else if($type == 2){
//维修改造
}else{
//培新演习
//培训演习
$b_company_id = $common->getCompany(['pid'=>$user['company_id']],'id');
$res['data'] = $common->getTrainByCompanyBId($b_company_id['id'],$page);
}
//查找乙方项目组下的乙方员工
foreach($res['data'] as &$value){
... ...