where('tv_userid',$this->auth->tv_userid)->column('id');//自动注册的用户 和 app注册并绑定盒子的app用户,理论上只需要第二个 $type = input('type',1); $list = Db::name('family')->where('user_id','IN',$ids)->where('type',$type)->order('id desc')->autopage()->select(); if(!empty($list)){ foreach($list as $key => &$val){ $val['media_file'] = localpath_to_netpath($val['media_file']); if($val['type'] == 2){ $images_url = explode('.', $val['media_file']); unset($images_url[count($images_url) - 1]); $val['thumb_image'] = join('.', $images_url) . '_0.jpg'; }else{ $val['thumb_image'] = $val['media_file'] . '?imageView2/1/w/100/h/100/q/85'; } } } $this->success(1,$list); } }