From ee5641b45340bccf9f5a1531127dcacad89241dc Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 8 Jul 2023 17:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0jsrun=E6=A0=87=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Post.php | 11 +++++++++-- view/index/index/visit.html | 5 +++++ view/index/post/read.html | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/index/controller/Post.php b/app/index/controller/Post.php index 7344eac..c2b1551 100644 --- a/app/index/controller/Post.php +++ b/app/index/controller/Post.php @@ -46,7 +46,6 @@ class Post extends Common $model_post->save(); - $list_last_visit = PostVisit::where('post_id', $model_post->id) ->order('id desc') ->group('ip,uid') @@ -55,7 +54,7 @@ class Post extends Common ->select(); View::assign('post', $model_post); View::assign('list_last_visit', $list_last_visit); - + $model_visit = $this->recordVisit($model_post->id); View::assign('model_visit', $model_visit); @@ -95,4 +94,12 @@ class Post extends Common return $model_visit; } + public function markVisit($visit_id) + { + $model_visit = PostVisit::find($visit_id); + $model_visit->is_js_run = 1; + $model_visit->save(); + + return json_message(); + } } diff --git a/view/index/index/visit.html b/view/index/index/visit.html index c8da372..fb96ec0 100644 --- a/view/index/index/visit.html +++ b/view/index/index/visit.html @@ -21,6 +21,11 @@
{$vo.nickname_title}
+ {if $vo.is_js_run == 0 } + + {else /} + + {/if} {$vo.create_time_title} {$vo.client_name} {$vo.client_os_name} diff --git a/view/index/post/read.html b/view/index/post/read.html index 2da4dcf..a92fc1d 100644 --- a/view/index/post/read.html +++ b/view/index/post/read.html @@ -381,6 +381,10 @@ }); + + \ No newline at end of file