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

修改用户昵称

@@ -463,13 +463,32 @@ class Attestation extends Api @@ -463,13 +463,32 @@ class Attestation extends Api
463 ->where($where) 463 ->where($where)
464 ->select(); 464 ->select();
465 if(empty($data)){ 465 if(empty($data)){
466 - $this->error('暂无机构');  
467 - }  
468 - foreach ($data as $v){  
469 - $res['id'] = $v['id'];  
470 - $res['institution'] = $v['address']; 466 + $city = Db::name('government')
  467 + ->where($where['province'])
  468 + ->where($where['city'])
  469 + ->select();
  470 + if(empty($city)){
  471 + $city = Db::name('government')
  472 + ->where($where['province'])
  473 + ->select();
  474 + if(empty($city)){
  475 + $this->success('暂无机构');
  476 + }
  477 + }else{
  478 + foreach ($city as $v){
  479 + $res['id'] = $v['id'];
  480 + $res['institution'] = $v['address'];
  481 + }
  482 + $this->success('success',$res);
  483 + }
  484 + }else{
  485 + foreach ($data as $v){
  486 + $res['id'] = $v['id'];
  487 + $res['institution'] = $v['address'];
  488 + }
  489 + $this->success('success',$res);
471 } 490 }
472 - $this->success('success',$res); 491 +
473 } 492 }
474 493
475 /** 494 /**
@@ -246,25 +246,7 @@ class User extends Api @@ -246,25 +246,7 @@ class User extends Api
246 $data['token'] = $user_token['token']; 246 $data['token'] = $user_token['token'];
247 $this->success('SUCCESS',$data); 247 $this->success('SUCCESS',$data);
248 } 248 }
249 - /**  
250 - * @ApiTitle (用户信息)  
251 - * @ApiSummary (用户信息)  
252 - * @ApiMethod (POST)  
253 - * @ApiRoute (/api/user/member)  
254 - * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")  
255 - * @ApiReturn({  
256 - "code": 1,  
257 - "msg": "SUCCESS",  
258 - "time": "1553839125",  
259 - "data": {  
260 - "id": "id",//用户id  
261 - "nickname": "nickname",//用户昵称  
262 - "avatar": "avatar",//头像  
263 - "is_ren"://是否认证过(1认证过2没有认证过)  
264 - "is_have"://是否有农场(1入驻过2未入驻)  
265 - },  
266 - })  
267 - */ 249 +
268 public function member(){ 250 public function member(){
269 $this->success('SUCCESS',$this->user); 251 $this->success('SUCCESS',$this->user);
270 } 252 }
@@ -283,6 +265,8 @@ class User extends Api @@ -283,6 +265,8 @@ class User extends Api
283 "id": "id",//用户id 265 "id": "id",//用户id
284 "score": //用户积分 266 "score": //用户积分
285 "identity": //身份 267 "identity": //身份
  268 + * "nickname"://昵称
  269 + * "avatar":头像
286 }, 270 },
287 }) 271 })
288 */ 272 */
@@ -291,7 +275,7 @@ class User extends Api @@ -291,7 +275,7 @@ class User extends Api
291 $user_id = $this->getUserId(); 275 $user_id = $this->getUserId();
292 $data = Db::name('user') 276 $data = Db::name('user')
293 ->where('id',$user_id) 277 ->where('id',$user_id)
294 - ->field('id,score,identity,nickname,avatar') 278 + ->field('id,score,identity,nickname,avatar,mobile')
295 ->find(); 279 ->find();
296 280
297 $farm = Db::name('farm') 281 $farm = Db::name('farm')
@@ -72,6 +72,7 @@ class Userinfo extends Api @@ -72,6 +72,7 @@ class Userinfo extends Api
72 public function updnickname() 72 public function updnickname()
73 { 73 {
74 $user_id = $this->getUserId(); 74 $user_id = $this->getUserId();
  75 +// print_r($user_id);die;
75 $nickname = $this->request->param('nickname'); 76 $nickname = $this->request->param('nickname');
76 if(empty($nickname)){ 77 if(empty($nickname)){
77 $this->error('缺少必要参数'); 78 $this->error('缺少必要参数');
@@ -229,7 +229,7 @@ @@ -229,7 +229,7 @@
229 <a href="javascript:;" data-id="55" class="list-group-item"></a> 229 <a href="javascript:;" data-id="55" class="list-group-item"></a>
230 <a href="javascript:;" data-id="56" class="list-group-item">小程序登录注册</a> 230 <a href="javascript:;" data-id="56" class="list-group-item">小程序登录注册</a>
231 <a href="javascript:;" data-id="57" class="list-group-item">通过code获取token</a> 231 <a href="javascript:;" data-id="57" class="list-group-item">通过code获取token</a>
232 - <a href="javascript:;" data-id="58" class="list-group-item">用户信息</a> 232 + <a href="javascript:;" data-id="58" class="list-group-item"></a>
233 <a href="javascript:;" data-id="59" class="list-group-item">个人中心</a> 233 <a href="javascript:;" data-id="59" class="list-group-item">个人中心</a>
234 <a href="javascript:;" data-id="60" class="list-group-item">邻居家的余粮</a> 234 <a href="javascript:;" data-id="60" class="list-group-item">邻居家的余粮</a>
235 </div> 235 </div>
@@ -2404,8 +2404,7 @@ @@ -2404,8 +2404,7 @@
2404 "address":"address",//详细地址 2404 "address":"address",//详细地址
2405 "project_num"://创建项目 2405 "project_num"://创建项目
2406 "createtime"://入驻时间 2406 "createtime"://入驻时间
2407 - }  
2408 - }</pre> 2407 + "is_ti"://是否已经提交(1提交过2没有提交过</pre>
2409 </div> 2408 </div>
2410 </div> 2409 </div>
2411 </div><!-- #sample --> 2410 </div><!-- #sample -->
@@ -4443,24 +4442,7 @@ @@ -4443,24 +4442,7 @@
4443 <div class="panel panel-default"> 4442 <div class="panel panel-default">
4444 <div class="panel-heading"><strong>Headers</strong></div> 4443 <div class="panel-heading"><strong>Headers</strong></div>
4445 <div class="panel-body"> 4444 <div class="panel-body">
4446 - <table class="table table-hover">  
4447 - <thead>  
4448 - <tr>  
4449 - <th>名称</th>  
4450 - <th>类型</th>  
4451 - <th>必选</th>  
4452 - <th>描述</th>  
4453 - </tr>  
4454 - </thead>  
4455 - <tbody>  
4456 - <tr>  
4457 - <td>token</td>  
4458 - <td>string</td>  
4459 - <td></td>  
4460 - <td>请求的Token</td>  
4461 - </tr>  
4462 - </tbody>  
4463 - </table> 4445 +
4464 </div> 4446 </div>
4465 </div> 4447 </div>
4466 <div class="panel panel-default"> 4448 <div class="panel panel-default">
@@ -4497,17 +4479,6 @@ @@ -4497,17 +4479,6 @@
4497 <div class="row"> 4479 <div class="row">
4498 <div class="col-md-12"> 4480 <div class="col-md-12">
4499 <div class="panel panel-default"> 4481 <div class="panel panel-default">
4500 - <div class="panel-heading"><strong>Headers</strong></div>  
4501 - <div class="panel-body">  
4502 - <div class="headers">  
4503 - <div class="form-group">  
4504 - <label class="control-label" for="token">token</label>  
4505 - <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">  
4506 - </div>  
4507 - </div>  
4508 - </div>  
4509 - </div>  
4510 - <div class="panel panel-default">  
4511 <div class="panel-heading"><strong>参数</strong></div> 4482 <div class="panel-heading"><strong>参数</strong></div>
4512 <div class="panel-body"> 4483 <div class="panel-body">
4513 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/farm/other" method="POST" name="form27" id="form27"> 4484 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/farm/other" method="POST" name="form27" id="form27">
@@ -6968,24 +6939,7 @@ @@ -6968,24 +6939,7 @@
6968 <div class="panel panel-default"> 6939 <div class="panel panel-default">
6969 <div class="panel-heading"><strong>Headers</strong></div> 6940 <div class="panel-heading"><strong>Headers</strong></div>
6970 <div class="panel-body"> 6941 <div class="panel-body">
6971 - <table class="table table-hover">  
6972 - <thead>  
6973 - <tr>  
6974 - <th>名称</th>  
6975 - <th>类型</th>  
6976 - <th>必选</th>  
6977 - <th>描述</th>  
6978 - </tr>  
6979 - </thead>  
6980 - <tbody>  
6981 - <tr>  
6982 - <td>token</td>  
6983 - <td>string</td>  
6984 - <td></td>  
6985 - <td>请求的Token</td>  
6986 - </tr>  
6987 - </tbody>  
6988 - </table> 6942 +
6989 </div> 6943 </div>
6990 </div> 6944 </div>
6991 <div class="panel panel-default"> 6945 <div class="panel panel-default">
@@ -7034,17 +6988,6 @@ @@ -7034,17 +6988,6 @@
7034 <div class="row"> 6988 <div class="row">
7035 <div class="col-md-12"> 6989 <div class="col-md-12">
7036 <div class="panel panel-default"> 6990 <div class="panel panel-default">
7037 - <div class="panel-heading"><strong>Headers</strong></div>  
7038 - <div class="panel-body">  
7039 - <div class="headers">  
7040 - <div class="form-group">  
7041 - <label class="control-label" for="token">token</label>  
7042 - <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">  
7043 - </div>  
7044 - </div>  
7045 - </div>  
7046 - </div>  
7047 - <div class="panel panel-default">  
7048 <div class="panel-heading"><strong>参数</strong></div> 6991 <div class="panel-heading"><strong>参数</strong></div>
7049 <div class="panel-body"> 6992 <div class="panel-body">
7050 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/project/get_all" method="POST" name="form36" id="form36"> 6993 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/project/get_all" method="POST" name="form36" id="form36">
@@ -8976,8 +8919,8 @@ @@ -8976,8 +8919,8 @@
8976 <div class="panel panel-default"> 8919 <div class="panel panel-default">
8977 <div class="panel-heading" id="heading-58"> 8920 <div class="panel-heading" id="heading-58">
8978 <h4 class="panel-title"> 8921 <h4 class="panel-title">
8979 - <span class="label label-primary">POST</span>  
8980 - <a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> 用户信息 <span class="text-muted">/api/user/member</span></a> 8922 + <span class="label label-success">GET</span>
  8923 + <a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> <span class="text-muted">/api/user/member</span></a>
8981 </h4> 8924 </h4>
8982 </div> 8925 </div>
8983 <div id="collapseOne58" class="panel-collapse collapse"> 8926 <div id="collapseOne58" class="panel-collapse collapse">
@@ -8995,28 +8938,11 @@ @@ -8995,28 +8938,11 @@
8995 8938
8996 <div class="tab-pane active" id="info58"> 8939 <div class="tab-pane active" id="info58">
8997 <div class="well"> 8940 <div class="well">
8998 - 用户信息 </div> 8941 + </div>
8999 <div class="panel panel-default"> 8942 <div class="panel panel-default">
9000 <div class="panel-heading"><strong>Headers</strong></div> 8943 <div class="panel-heading"><strong>Headers</strong></div>
9001 <div class="panel-body"> 8944 <div class="panel-body">
9002 - <table class="table table-hover">  
9003 - <thead>  
9004 - <tr>  
9005 - <th>名称</th>  
9006 - <th>类型</th>  
9007 - <th>必选</th>  
9008 - <th>描述</th>  
9009 - </tr>  
9010 - </thead>  
9011 - <tbody>  
9012 - <tr>  
9013 - <td>token</td>  
9014 - <td>string</td>  
9015 - <td></td>  
9016 - <td>请求的Token</td>  
9017 - </tr>  
9018 - </tbody>  
9019 - </table> 8945 +
9020 </div> 8946 </div>
9021 </div> 8947 </div>
9022 <div class="panel panel-default"> 8948 <div class="panel panel-default">
@@ -9036,20 +8962,9 @@ @@ -9036,20 +8962,9 @@
9036 <div class="row"> 8962 <div class="row">
9037 <div class="col-md-12"> 8963 <div class="col-md-12">
9038 <div class="panel panel-default"> 8964 <div class="panel panel-default">
9039 - <div class="panel-heading"><strong>Headers</strong></div>  
9040 - <div class="panel-body">  
9041 - <div class="headers">  
9042 - <div class="form-group">  
9043 - <label class="control-label" for="token">token</label>  
9044 - <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">  
9045 - </div>  
9046 - </div>  
9047 - </div>  
9048 - </div>  
9049 - <div class="panel panel-default">  
9050 <div class="panel-heading"><strong>参数</strong></div> 8965 <div class="panel-heading"><strong>参数</strong></div>
9051 <div class="panel-body"> 8966 <div class="panel-body">
9052 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/member" method="POST" name="form58" id="form58"> 8967 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/member" method="get" name="form58" id="form58">
9053 <div class="form-group"> 8968 <div class="form-group">
9054 8969
9055 </div> 8970 </div>
@@ -9084,15 +8999,7 @@ @@ -9084,15 +8999,7 @@
9084 <div class="tab-pane" id="sample58"> 8999 <div class="tab-pane" id="sample58">
9085 <div class="row"> 9000 <div class="row">
9086 <div class="col-md-12"> 9001 <div class="col-md-12">
9087 - <pre id="sample_response58">{  
9088 - "code": 1,  
9089 - "msg": "SUCCESS",  
9090 - "time": "1553839125",  
9091 - "data": {  
9092 - "id": "id",//用户id  
9093 - "nickname": "nickname",//用户昵称  
9094 - "avatar": "avatar",//头像  
9095 - "is_ren"://是否认证过(1认证过2没有认证过</pre> 9002 + <pre id="sample_response58"></pre>
9096 </div> 9003 </div>
9097 </div> 9004 </div>
9098 </div><!-- #sample --> 9005 </div><!-- #sample -->
@@ -11268,7 +11175,7 @@ @@ -11268,7 +11175,7 @@
11268 11175
11269 <div class="row mt0 footer"> 11176 <div class="row mt0 footer">
11270 <div class="col-md-6" align="left"> 11177 <div class="col-md-6" align="left">
11271 - Generated on 2019-12-28 16:37:51 </div> 11178 + Generated on 2019-12-30 16:21:32 </div>
11272 <div class="col-md-6" align="right"> 11179 <div class="col-md-6" align="right">
11273 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 11180 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
11274 </div> 11181 </div>