作者 郭盛
1 个管道 的构建 通过 耗费 3 秒

修改认证机构

@@ -370,6 +370,7 @@ class Attestation extends Api @@ -370,6 +370,7 @@ class Attestation extends Api
370 "project_num"://创建项目 370 "project_num"://创建项目
371 "createtime"://入驻时间 371 "createtime"://入驻时间
372 "is_ti"://是否已经提交(1提交过2没有提交过) 372 "is_ti"://是否已经提交(1提交过2没有提交过)
  373 + "institution"://认证机构
373 } 374 }
374 }) 375 })
375 */ 376 */
@@ -381,9 +382,32 @@ class Attestation extends Api @@ -381,9 +382,32 @@ class Attestation extends Api
381 ->find(); 382 ->find();
382 if($data['identity'] == 2){ 383 if($data['identity'] == 2){
383 384
384 - $info = Db::name('attestation')->where('user_id',$user_id)->find(); 385 + $info = Db::name('attestation')
  386 + ->alias('a')
  387 + ->join('user b','a.user_id = b.id')
  388 + ->join('farm c','a.farm_id = c.id')
  389 + ->where('a.user_id',$user_id)
  390 + ->field('a.*,c.id as farm_id,c.address,c.project_num,c.name as farm_name,c.identity,c.lng,c.lat')
  391 + ->find();
385 if(!empty($info)){ 392 if(!empty($info)){
386 - $list['is_ti'] = 1; 393 + $fa['is_ti'] = 1;
  394 + //查询入驻消息 拿出 申请人名字
  395 + $res = Db::name('personage')
  396 + ->where('user_id',$user_id)
  397 + ->find();
  398 + $fa['name'] = $res['name'];
  399 + $fa['institution'] = $info['institution'];
  400 + $fa['id'] = $info['farm_id'];
  401 + $fa['identity'] = $info['identity'];
  402 + $fa['farm_name'] = $info['farm_name'];
  403 + $fa['project_num'] = $info['project_num'];
  404 + $fa['address'] = $info['address'];
  405 + $fa['lng'] = $info['lng'];
  406 + $fa['lat'] = $info['lat'];
  407 +
  408 + $fa['createtime'] = date('Y-m-d H:i:s',$info['createtime']);
  409 + $this->success('success',$fa);
  410 +
387 }else{ 411 }else{
388 $list['is_ti'] = 2; 412 $list['is_ti'] = 2;
389 } 413 }
@@ -392,7 +416,6 @@ class Attestation extends Api @@ -392,7 +416,6 @@ class Attestation extends Api
392 $res = Db::name('personage') 416 $res = Db::name('personage')
393 ->where('user_id',$user_id) 417 ->where('user_id',$user_id)
394 ->find(); 418 ->find();
395 -  
396 //查询农场表 拿出 农场信息 419 //查询农场表 拿出 农场信息
397 $farm = Db::name('farm') 420 $farm = Db::name('farm')
398 ->where('user_id',$user_id) 421 ->where('user_id',$user_id)
@@ -412,9 +435,31 @@ class Attestation extends Api @@ -412,9 +435,31 @@ class Attestation extends Api
412 $this->success('success',$list); 435 $this->success('success',$list);
413 }elseif ($data['identity'] == 3){ 436 }elseif ($data['identity'] == 3){
414 //查询是否已经提交认证信息 437 //查询是否已经提交认证信息
415 - $info = Db::name('attestation')->where('user_id',$user_id)->find(); 438 + $info = Db::name('attestation')
  439 + ->alias('a')
  440 + ->join('user b','a.user_id = b.id')
  441 + ->join('farm c','a.farm_id = c.id')
  442 + ->where('a.user_id',$user_id)
  443 + ->field('a.*,c.id as farm_id,c.address,c.project_num,c.name as farm_name,c.identity,c.lng,c.lat')
  444 + ->find();
416 if(!empty($info)){ 445 if(!empty($info)){
417 $list['is_ti'] = 1; 446 $list['is_ti'] = 1;
  447 + //查询入驻消息 拿出 申请人名字
  448 + $res = Db::name('company')
  449 + ->where('user_id',$user_id)
  450 + ->find();
  451 + $fa['name'] = $res['name'];
  452 + $fa['address'] = $info['address'];
  453 + $fa['id'] = $info['farm_id'];
  454 + $fa['institution'] = $info['institution'];
  455 + $fa['identity'] = $info['identity'];
  456 + $fa['farm_name'] = $info['farm_name'];
  457 + $fa['project_num'] = $info['project_num'];
  458 + $fa['lng'] = $info['lng'];
  459 + $fa['lat'] = $info['lat'];
  460 +
  461 + $fa['createtime'] = date('Y-m-d H:i:s',$info['createtime']);
  462 + $this->success('success',$fa);
418 }else{ 463 }else{
419 $list['is_ti'] = 2; 464 $list['is_ti'] = 2;
420 } 465 }
@@ -510,6 +555,41 @@ class Attestation extends Api @@ -510,6 +555,41 @@ class Attestation extends Api
510 } 555 }
511 556
512 /** 557 /**
  558 + * @ApiTitle (查询更多认证机构信息)
  559 + * @ApiSummary (查询更多认证机构信息)
  560 + * @ApiMethod (POST)
  561 + * @ApiRoute (/api/attestation/more)
  562 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  563 + *
  564 + * @ApiParams (name="province", type="string", required=true, description="省份信息")
  565 + *
  566 + * @ApiReturn({
  567 + "code": 1,
  568 + "msg": "SUCCESS",
  569 + "time": "1553839125",
  570 + "data": {
  571 + id://机构id
  572 + institution://机构
  573 + }
  574 + })
  575 + */
  576 + public function more()
  577 + {
  578 + $user_id = $this->getUserId();
  579 + $param = $this->request->param();
  580 + if(!empty($param['province'])){
  581 + $where['province'] = ['Like',"$param[province]%"];
  582 + }
  583 + $where['status'] = ['eq',1];
  584 + $data = Db::name('government')
  585 + ->field('id,company_name')
  586 + ->where($where)
  587 + ->select();
  588 + $this->success('success',$data);
  589 + }
  590 +
  591 +
  592 + /**
513 * @ApiTitle (提交认证信息) 593 * @ApiTitle (提交认证信息)
514 * @ApiSummary (提交认证信息) 594 * @ApiSummary (提交认证信息)
515 * @ApiMethod (POST) 595 * @ApiMethod (POST)
@@ -121,4 +121,6 @@ class Government extends Api @@ -121,4 +121,6 @@ class Government extends Api
121 $this->success('success',$data); 121 $this->success('success',$data);
122 } 122 }
123 } 123 }
  124 +
  125 +
124 } 126 }
此 diff 太大无法显示。