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

修改巡检时间戳

@@ -156,6 +156,21 @@ class CommonController extends RestBaseController @@ -156,6 +156,21 @@ class CommonController extends RestBaseController
156 return $res; 156 return $res;
157 } 157 }
158 158
  159 + //根据乙方企业id获取项目所关联的培训相关信息
  160 + public function getTrainByCompanyBId($b_company_id,$page){
  161 + $limit = config('site.limit');
  162 + $res = Db::name('project')
  163 + ->alias('p')
  164 + ->join('train t','p.id = t.project_id')
  165 + ->where(['p.b_cid'=>$b_company_id,'t.status'=>2])
  166 + ->field('t.id,p.id project_id,p.name project_name,t.train_time')
  167 + ->order('t.id desc')
  168 + ->page($page,$limit)
  169 + ->select()
  170 + ->toArray();
  171 + return $res;
  172 + }
  173 +
159 //获取企业相关信息 174 //获取企业相关信息
160 public function getCompany($where,$field){ 175 public function getCompany($where,$field){
161 $res = Db::name('company') 176 $res = Db::name('company')
@@ -225,8 +240,7 @@ class CommonController extends RestBaseController @@ -225,8 +240,7 @@ class CommonController extends RestBaseController
225 $party = 1; 240 $party = 1;
226 } 241 }
227 //获取今天的巡检信息(共同合作完成) 242 //获取今天的巡检信息(共同合作完成)
228 - $time = date('Y-m-d',time());  
229 - $where = ['project_id'=>$result['id'],'create_time'=>$time,'party'=>$party]; 243 + $where = ['project_id'=>$result['id'],'party'=>$party];
230 $field = 'status,point_id'; 244 $field = 'status,point_id';
231 $todayIns = $this->getTodayIns($where,$field); 245 $todayIns = $this->getTodayIns($where,$field);
232 $is_finish = 0; 246 $is_finish = 0;
@@ -252,6 +266,7 @@ class CommonController extends RestBaseController @@ -252,6 +266,7 @@ class CommonController extends RestBaseController
252 public function getTodayIns($where,$field){ 266 public function getTodayIns($where,$field){
253 $res = Db::name('inspect') 267 $res = Db::name('inspect')
254 ->where($where) 268 ->where($where)
  269 + ->whereTime('create_time','today')
255 ->field($field) 270 ->field($field)
256 ->select() 271 ->select()
257 ->toArray(); 272 ->toArray();
@@ -57,7 +57,9 @@ class InformationController extends RestBaseController @@ -57,7 +57,9 @@ class InformationController extends RestBaseController
57 }else if($type == 2){ 57 }else if($type == 2){
58 //维修改造 58 //维修改造
59 }else{ 59 }else{
60 - //培新演习 60 + //培训演习
  61 + $b_company_id = $common->getCompany(['pid'=>$user['company_id']],'id');
  62 + $res['data'] = $common->getTrainByCompanyBId($b_company_id['id'],$page);
61 } 63 }
62 //查找乙方项目组下的乙方员工 64 //查找乙方项目组下的乙方员工
63 foreach($res['data'] as &$value){ 65 foreach($res['data'] as &$value){