我的收藏

This commit is contained in:
2025-12-01 18:11:19 +08:00
parent 850ef0cb0e
commit 181269e77f
@@ -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;