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