...
|
...
|
@@ -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();
|
...
|
...
|
|