|
@@ -100,8 +100,8 @@ class Attestation extends Api |
|
@@ -100,8 +100,8 @@ class Attestation extends Api |
100
|
$res['createtime'] = time();
|
100
|
$res['createtime'] = time();
|
101
|
Db::name('farm')->insertGetId($res);
|
101
|
Db::name('farm')->insertGetId($res);
|
102
|
|
102
|
|
103
|
- //修改用户表中用户的身份
|
|
|
104
|
- Db::name('user')->where('id',$user_id)->update(['identity'=>2]);
|
103
|
+ //修改用户表中用户的身份 并且 将用户积分加4
|
|
|
104
|
+ Db::name('user')->where('id',$user_id)->update(['identity'=>2,'score'=>4]);
|
105
|
|
105
|
|
106
|
if($data){
|
106
|
if($data){
|
107
|
$this->success('入驻成功');
|
107
|
$this->success('入驻成功');
|
|
@@ -193,7 +193,7 @@ class Attestation extends Api |
|
@@ -193,7 +193,7 @@ class Attestation extends Api |
193
|
Db::name('farm')->insertGetId($res);
|
193
|
Db::name('farm')->insertGetId($res);
|
194
|
|
194
|
|
195
|
//修改用户表中用户的身份
|
195
|
//修改用户表中用户的身份
|
196
|
- Db::name('user')->where('id',$user_id)->update(['identity'=>3]);
|
196
|
+ Db::name('user')->where('id',$user_id)->update(['identity'=>3,'score'=>4]);
|
197
|
|
197
|
|
198
|
if($data){
|
198
|
if($data){
|
199
|
$this->success('入驻成功');
|
199
|
$this->success('入驻成功');
|
|
@@ -461,12 +461,14 @@ class Attestation extends Api |
|
@@ -461,12 +461,14 @@ class Attestation extends Api |
461
|
$where['status'] = ['eq',1];
|
461
|
$where['status'] = ['eq',1];
|
462
|
$data = Db::name('government')
|
462
|
$data = Db::name('government')
|
463
|
->where($where)
|
463
|
->where($where)
|
464
|
- ->find();
|
464
|
+ ->select();
|
465
|
if(empty($data)){
|
465
|
if(empty($data)){
|
466
|
$this->error('暂无机构');
|
466
|
$this->error('暂无机构');
|
467
|
}
|
467
|
}
|
468
|
- $res['id'] = $data['id'];
|
|
|
469
|
- $res['institution'] = $data['address'];
|
468
|
+ foreach ($data as $v){
|
|
|
469
|
+ $res['id'] = $v['id'];
|
|
|
470
|
+ $res['institution'] = $v['address'];
|
|
|
471
|
+ }
|
470
|
$this->success('success',$res);
|
472
|
$this->success('success',$res);
|
471
|
}
|
473
|
}
|
472
|
|
474
|
|