我的收藏
This commit is contained in:
@@ -3,6 +3,7 @@ namespace app\common\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\model\Post;
|
||||
use app\common\model\PostMedia;
|
||||
use app\common\model\User;
|
||||
use app\common\service\OssService;
|
||||
use app\common\traits\crud\CrudControllerTrait;
|
||||
@@ -67,6 +68,15 @@ class PostFavoriteController extends BaseController
|
||||
}
|
||||
$post['user'] = $postUser;
|
||||
}
|
||||
|
||||
$ossservice = new OssService();
|
||||
if (isset($post['id'])){
|
||||
$post['media'] = PostMedia::where('post_id', $post['id'])->get()->toArray();
|
||||
foreach ($post['media'] as &$media) {
|
||||
$media['url_pull'] = $ossservice->generatePrivateUrl($media['url']);
|
||||
}
|
||||
}
|
||||
|
||||
$data['post'] = $post;
|
||||
}
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user