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

修改用户入驻完加积分

... ... @@ -100,8 +100,8 @@ class Attestation extends Api
$res['createtime'] = time();
Db::name('farm')->insertGetId($res);
//修改用户表中用户的身份
Db::name('user')->where('id',$user_id)->update(['identity'=>2]);
//修改用户表中用户的身份 并且 将用户积分加4
Db::name('user')->where('id',$user_id)->update(['identity'=>2,'score'=>4]);
if($data){
$this->success('入驻成功');
... ... @@ -193,7 +193,7 @@ class Attestation extends Api
Db::name('farm')->insertGetId($res);
//修改用户表中用户的身份
Db::name('user')->where('id',$user_id)->update(['identity'=>3]);
Db::name('user')->where('id',$user_id)->update(['identity'=>3,'score'=>4]);
if($data){
$this->success('入驻成功');
... ... @@ -461,12 +461,14 @@ class Attestation extends Api
$where['status'] = ['eq',1];
$data = Db::name('government')
->where($where)
->find();
->select();
if(empty($data)){
$this->error('暂无机构');
}
$res['id'] = $data['id'];
$res['institution'] = $data['address'];
foreach ($data as $v){
$res['id'] = $v['id'];
$res['institution'] = $v['address'];
}
$this->success('success',$res);
}
... ...
... ... @@ -253,17 +253,17 @@ class User extends Api
* @ApiRoute (/api/user/member)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn({
"code": 1,
"msg": "SUCCESS",
"time": "1553839125",
"data": {
"id": "id",//用户id
"nickname": "nickname",//用户昵称
"avatar": "avatar",//头像
"is_ren"://是否认证过(1认证过2没有认证过)
"is_have"://是否有农场(1入驻过2未入驻)
},
})
"code": 1,
"msg": "SUCCESS",
"time": "1553839125",
"data": {
"id": "id",//用户id
"nickname": "nickname",//用户昵称
"avatar": "avatar",//头像
"is_ren"://是否认证过(1认证过2没有认证过)
"is_have"://是否有农场(1入驻过2未入驻)
},
})
*/
public function member(){
$this->success('SUCCESS',$this->user);
... ...