Browse Source

fix:个人信息增加是否需要编辑字段

super-yimizi 1 month ago
parent
commit
c402ea4489
1 changed files with 8 additions and 5 deletions
  1. 8 5
      application/api/controller/User.php

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

@@ -44,12 +44,15 @@ class User extends Base
         $info['avatar'] = cdnurl($info['avatar'], true);
         $info['gender_text'] = UserEnum::getGenderText($this->auth->getUser()->gender ?? 0);
         $info['age'] = $this->auth->getUser()->age ?? 0;
-        $signin = get_addon_info('signin');
-        $info['is_install_signin'] = ($signin && $signin['state']);
 
-        $firstlogin = $this->auth->jointime === $this->auth->logintime;
-
-        //判断是否显示昵称更新提示
+        // 判断是否需要编辑个人信息 个人信息是否 都填了  昵称、性别、年龄
+        $isNeedEditProfile = 0;
+        if (!$info['nickname'] || !$info['gender'] || !$info['age']) {
+            $isNeedEditProfile = 1;
+        }
+        $info['is_need_editprofile'] = $isNeedEditProfile;
+      
+        
         $profilePrompt = false;
         $config = get_addon_config('shop');
         if ($config['porfilePrompt'] === 'firstlogin') {