lizhen_gitee 4 月之前
父節點
當前提交
80c325f5b5
共有 2 個文件被更改,包括 10 次插入13 次删除
  1. 5 8
      application/api/controller/Baseconfig.php
  2. 5 5
      application/api/controller/User.php

+ 5 - 8
application/api/controller/Baseconfig.php

@@ -38,15 +38,12 @@ class Baseconfig extends Api
         $this->success('success',$config);
     }
 
-    //启动广告图,没用到,前端固定死的
-    /*public function start_advert(){
-
-
+    //启动广告图
+    public function start_advert(){
         $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
-
-        $info = info_domain_image($info,['image']);
-        $this->success_find('success',$info);
-    }*/
+        $info = info_domain_image($info,['images','video_file']);
+        $this->success('success',$info);
+    }
 
 
 

+ 5 - 5
application/api/controller/User.php

@@ -181,6 +181,7 @@ class User extends Api
         $nickname = input('nickname', '', 'trim'); //昵称
         $birthday = input('birthday', '', 'strtotime'); //生日
         $hometown_cityid = input('hometown_cityid', '', 'trim'); //城市id
+        $bio = input('bio', '', 'trim'); //个性签名
         $hobby = input('hobby', '', 'trim'); //爱好
         $marital = input('marital', '', 'trim'); //婚姻
         $introcode = input('introcode', '', 'trim'); //邀请码
@@ -205,6 +206,9 @@ class User extends Api
             }
             $data['hometown_cityid'] = $hometown_cityid;
         }
+        if ($bio) {
+            $data['bio'] = $bio;
+        }
         if ($hobby) {
             $data['hobby'] = $hobby;
         }
@@ -212,8 +216,6 @@ class User extends Api
             $data['marital'] = $marital;
         }
         if ($introcode && !$this->auth->intro_uid) {
-
-
             $intro_user = Db::name('user')->field('id, intro_uid')->where('introcode', $introcode)->find();
             if ($intro_user && $intro_user['id'] != $this->auth->id && $intro_user['intro_uid'] != $this->auth->id) {
                 $data['intro_uid'] = $intro_user['id'];
@@ -221,11 +223,9 @@ class User extends Api
             }
         }
 
-
-
         //开启事务
         Db::startTrans();
-        $update_rs = Db::name('user')->where('id',$this->auth->id)->setField($data);
+        $update_rs = Db::name('user')->where('id',$this->auth->id)->update($data);
         if($update_rs === false){
             Db::rollback();
             $this->error('修改失败');