WIN-2308041133\Administrator 8 hónapja
szülő
commit
ebff55ff90

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

@@ -42,11 +42,11 @@ class Platform extends Api
         $map = []; // 初始化$map数组,避免未定义时的错误
         if(input('uid', 0) > 0){
             // 明确指定uid所属的表(假设主表为video_share)
-            $map['video_share.uid'] = input('uid');
+            $map['uid'] = input('uid');
         }
         $config = $this->config();
         $list = model('VideoShare')
-            ->with('videolist,user')
+            ->with('videolist,users')
             ->where($map)
             ->limit(10)
             ->select();

+ 4 - 0
application/common/model/VideoShare.php

@@ -29,4 +29,8 @@ class VideoShare extends Model
     {
         return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->setEagerlyType(0);
     }
+    public function users()
+    {
+        return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->field('id,avatar,nickname,istel,mobile,isrz,level,group_id')->setEagerlyType(0);
+    }
 }