Quellcode durchsuchen

用户资料枚举

lizhen_gitee vor 3 Monaten
Ursprung
Commit
fe4554601b
2 geänderte Dateien mit 8 neuen und 16 gelöschten Zeilen
  1. 1 1
      application/api/controller/Sms.php
  2. 7 15
      application/api/controller/User.php

+ 1 - 1
application/api/controller/Sms.php

@@ -59,7 +59,7 @@ class Sms extends Api
         if ($ret) {
             $this->success(__('发送成功'));
         } else {
-            $this->error(__('发送失败,发送过于频繁'));
+            $this->error(__('发送失败'));
         }
     }
 

+ 7 - 15
application/api/controller/User.php

@@ -228,7 +228,7 @@ class User extends Api
      */
     public function profile()
     {
-        $field_array = ['nickname','introcode','gender','birthday','height','weight','bio','audio_bio','avatar','photo_images','education','hobby','job','marital','tag','wages','hometown_cityid','hide_is_finishinfo',/*'wechat_account',*/'character','constellation','stature','is_appointment', 'greet_voice', 'greet_chat', 'is_cohabit', 'live', 'is_house', 'car', 'chest', 'waist'];
+        $field_array = ['nickname','introcode',/*'gender',*/'birthday','height','weight','bio','audio_bio','avatar','photo_images','education','hobby','job','marital','tag','wages','hometown_cityid','hide_is_finishinfo',/*'wechat_account',*/'character','constellation','stature','is_appointment', 'greet_voice', 'greet_chat', 'is_cohabit', 'live', 'is_house', 'car', 'chest', 'waist'];
 
         $data = [];
         foreach($field_array as $key => $field){
@@ -1239,8 +1239,8 @@ class User extends Api
         $nickname = input('nickname', '', 'trim'); //昵称
         $birthday = input('birthday', '', 'strtotime'); //生日
         $hometown_cityid = input('hometown_cityid', '', 'trim'); //城市id
-        $job_id = input('job_id', '', 'trim'); //职业id
-        $character_id = input('character_id', '', 'trim'); //性格id
+        $hobby = input('hobby', '', 'trim'); //爱好
+        $marital = input('marital', '', 'trim'); //婚姻
         $introcode = input('introcode', '', 'trim'); //邀请码
 
         $data = [];
@@ -1263,19 +1263,11 @@ class User extends Api
             }
             $data['hometown_cityid'] = $hometown_cityid;
         }
-        if ($job_id) {
-            $count = Db::name('enum_job')->where('id', $job_id)->count('id');
-            if (!$count) {
-                $this->error('职业不存在');
-            }
-            $data['job_id'] = $job_id;
+        if ($hobby) {
+            $data['hobby'] = $hobby;
         }
-        if ($character_id) {
-            $count = Db::name('enum_character')->where('id', $character_id)->count('id');
-            if (!$count) {
-                $this->error('性格不存在');
-            }
-            $data['character_id'] = $character_id;
+        if ($marital) {
+            $data['marital'] = $marital;
         }
         if ($introcode && !$this->auth->intro_uid) {