...
|
...
|
@@ -370,6 +370,7 @@ class Attestation extends Api |
|
|
"project_num"://创建项目
|
|
|
"createtime"://入驻时间
|
|
|
"is_ti"://是否已经提交(1提交过2没有提交过)
|
|
|
"institution"://认证机构
|
|
|
}
|
|
|
})
|
|
|
*/
|
...
|
...
|
@@ -381,9 +382,32 @@ class Attestation extends Api |
|
|
->find();
|
|
|
if($data['identity'] == 2){
|
|
|
|
|
|
$info = Db::name('attestation')->where('user_id',$user_id)->find();
|
|
|
$info = Db::name('attestation')
|
|
|
->alias('a')
|
|
|
->join('user b','a.user_id = b.id')
|
|
|
->join('farm c','a.farm_id = c.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,c.id as farm_id,c.address,c.project_num,c.name as farm_name,c.identity,c.lng,c.lat')
|
|
|
->find();
|
|
|
if(!empty($info)){
|
|
|
$list['is_ti'] = 1;
|
|
|
$fa['is_ti'] = 1;
|
|
|
//查询入驻消息 拿出 申请人名字
|
|
|
$res = Db::name('personage')
|
|
|
->where('user_id',$user_id)
|
|
|
->find();
|
|
|
$fa['name'] = $res['name'];
|
|
|
$fa['institution'] = $info['institution'];
|
|
|
$fa['id'] = $info['farm_id'];
|
|
|
$fa['identity'] = $info['identity'];
|
|
|
$fa['farm_name'] = $info['farm_name'];
|
|
|
$fa['project_num'] = $info['project_num'];
|
|
|
$fa['address'] = $info['address'];
|
|
|
$fa['lng'] = $info['lng'];
|
|
|
$fa['lat'] = $info['lat'];
|
|
|
|
|
|
$fa['createtime'] = date('Y-m-d H:i:s',$info['createtime']);
|
|
|
$this->success('success',$fa);
|
|
|
|
|
|
}else{
|
|
|
$list['is_ti'] = 2;
|
|
|
}
|
...
|
...
|
@@ -392,7 +416,6 @@ class Attestation extends Api |
|
|
$res = Db::name('personage')
|
|
|
->where('user_id',$user_id)
|
|
|
->find();
|
|
|
|
|
|
//查询农场表 拿出 农场信息
|
|
|
$farm = Db::name('farm')
|
|
|
->where('user_id',$user_id)
|
...
|
...
|
@@ -412,9 +435,31 @@ class Attestation extends Api |
|
|
$this->success('success',$list);
|
|
|
}elseif ($data['identity'] == 3){
|
|
|
//查询是否已经提交认证信息
|
|
|
$info = Db::name('attestation')->where('user_id',$user_id)->find();
|
|
|
$info = Db::name('attestation')
|
|
|
->alias('a')
|
|
|
->join('user b','a.user_id = b.id')
|
|
|
->join('farm c','a.farm_id = c.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->field('a.*,c.id as farm_id,c.address,c.project_num,c.name as farm_name,c.identity,c.lng,c.lat')
|
|
|
->find();
|
|
|
if(!empty($info)){
|
|
|
$list['is_ti'] = 1;
|
|
|
//查询入驻消息 拿出 申请人名字
|
|
|
$res = Db::name('company')
|
|
|
->where('user_id',$user_id)
|
|
|
->find();
|
|
|
$fa['name'] = $res['name'];
|
|
|
$fa['address'] = $info['address'];
|
|
|
$fa['id'] = $info['farm_id'];
|
|
|
$fa['institution'] = $info['institution'];
|
|
|
$fa['identity'] = $info['identity'];
|
|
|
$fa['farm_name'] = $info['farm_name'];
|
|
|
$fa['project_num'] = $info['project_num'];
|
|
|
$fa['lng'] = $info['lng'];
|
|
|
$fa['lat'] = $info['lat'];
|
|
|
|
|
|
$fa['createtime'] = date('Y-m-d H:i:s',$info['createtime']);
|
|
|
$this->success('success',$fa);
|
|
|
}else{
|
|
|
$list['is_ti'] = 2;
|
|
|
}
|
...
|
...
|
@@ -510,6 +555,41 @@ class Attestation extends Api |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (查询更多认证机构信息)
|
|
|
* @ApiSummary (查询更多认证机构信息)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/attestation/more)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="province", type="string", required=true, description="省份信息")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "SUCCESS",
|
|
|
"time": "1553839125",
|
|
|
"data": {
|
|
|
id://机构id
|
|
|
institution://机构
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function more()
|
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$param = $this->request->param();
|
|
|
if(!empty($param['province'])){
|
|
|
$where['province'] = ['Like',"$param[province]%"];
|
|
|
}
|
|
|
$where['status'] = ['eq',1];
|
|
|
$data = Db::name('government')
|
|
|
->field('id,company_name')
|
|
|
->where($where)
|
|
|
->select();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (提交认证信息)
|
|
|
* @ApiSummary (提交认证信息)
|
|
|
* @ApiMethod (POST)
|
...
|
...
|
|