@@ -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();
@@ -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);
+ }