Browse Source

黄金地址

afa 8 months ago
parent
commit
81121a8de7
2 changed files with 10 additions and 2 deletions
  1. 1 1
      application/api/controller/User.php
  2. 9 1
      application/common/model/UserModel.php

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

@@ -148,7 +148,7 @@ class User extends Api
         // 总推荐数
         $list['total'] = $userModel::where('parent_id', $this->auth->id)->count();
         //直推黄金数量
-        $list['direct_gold'] = $userModel::getDirectGoldNum($this->auth->id);
+        $list['direct_gold'] = $userModel::getDirectGoldAddress($this->auth->id);
         // 直推列表 
         $list['data'] = $userModel::where('parent_id', $this->auth->id)
                     ->field("address,create_time,nickname,is_super,direct_super,REPLACE(phone, SUBSTRING(phone, 4, 4), '****') as phone")

+ 9 - 1
application/common/model/UserModel.php

@@ -113,7 +113,15 @@ class UserModel extends Model
         return self::where('parent_id', $uid)->where('direct_super', '>=' , 10)->count();
     }
 
-
+    /**
+     * 获取直推用户黄金标识地址  direct_super >= 10
+     * @param int $uid
+     * @return void
+     */
+    public static function getDirectGoldAddress(int $uid)
+    {
+        return self::where('parent_id', $uid)->where('direct_super', '>=' , 10)->column('address');
+    }
 
     //社区向上发放奖励津贴
     public static function setCommunityRewards($uid, $pv, $token)