Pārlūkot izejas kodu

限制视频发布个数

15954078560 3 gadi atpakaļ
vecāks
revīzija
ae58533a46

+ 6 - 0
application/api/controller/Eyemargin.php

@@ -39,6 +39,12 @@ class Eyemargin extends Common
         $userAuthInfo = \app\common\model\UserAuth::userIsAuth($this->auth->id);
         if($userAuthInfo['status'] == 0) $this->error($userAuthInfo['msg']);
 
+        //限制视频数量
+        $eyemargin_count = Db::name('eyemargin')->where(['user_id' => $this->auth->id])->count('id');
+        if ($eyemargin_count >= 10) {
+            $this->error('眼缘最多发布10个');
+        }
+
         $data = [];
         $data["user_id"] = $this->auth->id;
         $data["eye_type"] = $eye_type;

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

@@ -957,7 +957,7 @@ class User extends Api
         $where['a.user_id'] = $user_id;
         $where['a.createtime'] = ['egt', time() - 86400];
         $res = \app\common\model\UserFate::alias("a")
-            ->field("a.id,u.id as user_id,u.avatar,u.nickname,u.age,u.constellation,u.hobby_ids,u.profession,u.wechat,u.copy_mobile,u.mobile")
+            ->field("a.id,u.id as user_id,u.avatar,u.nickname,u.age,u.constellation,u.hobby_ids,u.profession,u.wechat,u.copy_mobile,u.mobile,u.gender")
             ->join("hx_user u","u.id = a.fate_user_id")
             ->where($where)
             ->order("a.createtime",'desc')
@@ -1002,7 +1002,7 @@ class User extends Api
 //
 //        if(!$userInfo){
             // 获取用户信息
-            $field = 'id,avatar,nickname,is_goddess,is_auth,recharge_auth,vipStatus(vip_duetime) as is_vip,age,lng,lat,city_name,district_name,constellation,hobby_ids,profession,declaration,wechat,income,copy_mobile,mobile,is_auth_person';
+            $field = 'id,avatar,nickname,is_goddess,is_auth,recharge_auth,vipStatus(vip_duetime) as is_vip,age,lng,lat,city_name,district_name,constellation,hobby_ids,profession,declaration,wechat,income,copy_mobile,mobile,is_auth_person,gender';
             $userInfo = \app\common\model\User::field($field)->where(['id'=>$user_id])->find();
             $userInfo['hobby_ids'] = \app\common\model\Hobby::getHobbyNames($userInfo['hobby_ids']);
             // 获取是否有眼缘

+ 2 - 2
application/common/model/UserLike.php

@@ -23,7 +23,7 @@ class UserLike extends Model
         $where = [];
         $where["a.fans_id"] = $user_id;
         $list = $this->alias("a")
-            ->field("a.id,a.user_id,a.fans_id,u.nickname,u.avatar,u.age,u.constellation,u.wechat,hobby_ids,profession,u.copy_mobile,u.mobile")
+            ->field("a.id,a.user_id,a.fans_id,u.nickname,u.avatar,u.age,u.constellation,u.wechat,hobby_ids,profession,u.copy_mobile,u.mobile,u.gender")
             ->join("hx_user u","u.id = a.user_id","left")
             ->where($where)
             ->limit($pageStart,$pageNum)
@@ -62,7 +62,7 @@ class UserLike extends Model
         $where = [];
         $where["a.user_id"] = $user_id;
         $list = $this->alias("a")
-            ->field("a.id,a.fans_id as user_id,u.nickname,u.avatar,u.age,u.constellation,u.wechat,hobby_ids,profession,u.copy_mobile,u.mobile")
+            ->field("a.id,a.fans_id as user_id,u.nickname,u.avatar,u.age,u.constellation,u.wechat,hobby_ids,profession,u.copy_mobile,u.mobile,u.gender")
             ->join("hx_user u","u.id = a.fans_id","left")
             ->where($where)
             ->limit($pageStart,$pageNum)