Parcourir la source

内容h5详情

wzq il y a 5 ans
Parent
commit
116c2635c1

+ 1 - 0
app/Transformers/Post/DetailTransformer.php

@@ -68,6 +68,7 @@ class DetailTransformer extends TransformerAbstract
             'is_collect' => PostCollect::where('post_id', $post['id'])->where('uid', $this->uid)->exists()?1:0,
             'is_follow' => $isFollow,
             'h5url' => config('customer.share_post_h5url')."?post_id={$post['id']}&invite_code={$this->invite_code}",
+            'desc_url' => $post['type'] == 'html'?config('customer.app_service_url').'/post/fragment/detail/'.$post['id']:'',
         ];
     }
 }

Fichier diff supprimé car celui-ci est trop grand
+ 18 - 0
resources/views/post/detail.php


+ 5 - 0
routes/web.php

@@ -19,3 +19,8 @@ $router->get('/', function () use ($router) {
 $router->get('/test', function () use ($router) {
     return 'test';
 });
+
+$router->get('/fragment/detail/{id:[0-9]+}', ['as'=> 'fragment.detail', function ($id) use ($router) {
+    $desc = \App\Models\Post::where('id',$id)->value('content');
+    return view('post.detail', ['desc'=>$desc]);
+}]);