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

修改用户昵称

... ... @@ -463,13 +463,32 @@ class Attestation extends Api
->where($where)
->select();
if(empty($data)){
$this->error('暂无机构');
}
foreach ($data as $v){
$res['id'] = $v['id'];
$res['institution'] = $v['address'];
$city = Db::name('government')
->where($where['province'])
->where($where['city'])
->select();
if(empty($city)){
$city = Db::name('government')
->where($where['province'])
->select();
if(empty($city)){
$this->success('暂无机构');
}
}else{
foreach ($city as $v){
$res['id'] = $v['id'];
$res['institution'] = $v['address'];
}
$this->success('success',$res);
}
}else{
foreach ($data as $v){
$res['id'] = $v['id'];
$res['institution'] = $v['address'];
}
$this->success('success',$res);
}
$this->success('success',$res);
}
/**
... ...
... ... @@ -246,25 +246,7 @@ class User extends Api
$data['token'] = $user_token['token'];
$this->success('SUCCESS',$data);
}
/**
* @ApiTitle (用户信息)
* @ApiSummary (用户信息)
* @ApiMethod (POST)
* @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未入驻)
},
})
*/
public function member(){
$this->success('SUCCESS',$this->user);
}
... ... @@ -283,6 +265,8 @@ class User extends Api
"id": "id",//用户id
"score": //用户积分
"identity": //身份
* "nickname"://昵称
* "avatar":头像
},
})
*/
... ... @@ -291,7 +275,7 @@ class User extends Api
$user_id = $this->getUserId();
$data = Db::name('user')
->where('id',$user_id)
->field('id,score,identity,nickname,avatar')
->field('id,score,identity,nickname,avatar,mobile')
->find();
$farm = Db::name('farm')
... ...
... ... @@ -72,6 +72,7 @@ class Userinfo extends Api
public function updnickname()
{
$user_id = $this->getUserId();
// print_r($user_id);die;
$nickname = $this->request->param('nickname');
if(empty($nickname)){
$this->error('缺少必要参数');
... ...
... ... @@ -229,7 +229,7 @@
<a href="javascript:;" data-id="55" class="list-group-item"></a>
<a href="javascript:;" data-id="56" class="list-group-item">小程序登录注册</a>
<a href="javascript:;" data-id="57" class="list-group-item">通过code获取token</a>
<a href="javascript:;" data-id="58" class="list-group-item">用户信息</a>
<a href="javascript:;" data-id="58" class="list-group-item"></a>
<a href="javascript:;" data-id="59" class="list-group-item">个人中心</a>
<a href="javascript:;" data-id="60" class="list-group-item">邻居家的余粮</a>
</div>
... ... @@ -2404,8 +2404,7 @@
"address":"address",//详细地址
"project_num"://创建项目
"createtime"://入驻时间
}
}</pre>
"is_ti"://是否已经提交(1提交过2没有提交过</pre>
</div>
</div>
</div><!-- #sample -->
... ... @@ -4443,24 +4442,7 @@
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -4497,17 +4479,6 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/farm/other" method="POST" name="form27" id="form27">
... ... @@ -6968,24 +6939,7 @@
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -7034,17 +6988,6 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/project/get_all" method="POST" name="form36" id="form36">
... ... @@ -8976,8 +8919,8 @@
<div class="panel panel-default">
<div class="panel-heading" id="heading-58">
<h4 class="panel-title">
<span class="label label-primary">POST</span>
<a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> 用户信息 <span class="text-muted">/api/user/member</span></a>
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> <span class="text-muted">/api/user/member</span></a>
</h4>
</div>
<div id="collapseOne58" class="panel-collapse collapse">
... ... @@ -8995,28 +8938,11 @@
<div class="tab-pane active" id="info58">
<div class="well">
用户信息 </div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -9036,20 +8962,9 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/member" method="POST" name="form58" id="form58">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/member" method="get" name="form58" id="form58">
<div class="form-group">
</div>
... ... @@ -9084,15 +8999,7 @@
<div class="tab-pane" id="sample58">
<div class="row">
<div class="col-md-12">
<pre id="sample_response58">{
"code": 1,
"msg": "SUCCESS",
"time": "1553839125",
"data": {
"id": "id",//用户id
"nickname": "nickname",//用户昵称
"avatar": "avatar",//头像
"is_ren"://是否认证过(1认证过2没有认证过</pre>
<pre id="sample_response58"></pre>
</div>
</div>
</div><!-- #sample -->
... ... @@ -11268,7 +11175,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-12-28 16:37:51 </div>
Generated on 2019-12-30 16:21:32 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...