mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化记录存储
This commit is contained in:
@@ -14,6 +14,13 @@ use think\model\Relation;
|
||||
|
||||
class Post extends Common
|
||||
{
|
||||
public function initialize()
|
||||
{
|
||||
if ($this->request->action() != 'markVisit') {
|
||||
parent::initialize();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源.
|
||||
*
|
||||
@@ -52,6 +59,7 @@ class Post extends Common
|
||||
->limit(12)
|
||||
->cache(60)
|
||||
->select();
|
||||
|
||||
View::assign('post', $model_post);
|
||||
View::assign('list_last_visit', $list_last_visit);
|
||||
|
||||
@@ -96,9 +104,7 @@ class Post extends Common
|
||||
|
||||
public function markVisit($visit_id)
|
||||
{
|
||||
$model_visit = PostVisit::find($visit_id);
|
||||
$model_visit->is_js_run = 1;
|
||||
$model_visit->save();
|
||||
PostVisit::where('id', $visit_id)->update(['is_js_run' => 1]);
|
||||
|
||||
return json_message();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user