在 CodeIgniter 中,我更新视图计数的一个查询执行了两次
CodeIgniter 中有什么东西可以重复调用控制器吗?我的问题是我正在使用查询来设置视图计数:
$this->db->set('user_views', 'user_views+1', FALSE);
$this->db->where('slug', $discussion_slug);
$this->db->update('forum_topics')
我的网站位于http://shinedesk.com/projects/MySeniorLivingGuide/development/forums。请检查该页面中列出的任一讨论的计数。然后单击讨论链接以查看该页面。问题是在查看此讨论并检查论坛页面中的观看次数后,观看次数增加了两倍。
Is anything there in CodeIgniter to call a controller repeatedly? My problem is I am using a query to set the view count by using this query:
$this->db->set('user_views', 'user_views+1', FALSE);
$this->db->where('slug', $discussion_slug);
$this->db->update('forum_topics')
My site is at http://shinedesk.com/projects/MySeniorLivingGuide/development/forums
. Please check the count of any one of the discussions listed in that page. Then click the discussion link to view that page. The problem is after viewing this discussion and checking the view count in the forums page, the view count gets increased by two.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的页面中有 addThis,是否有可能 addThis 服务器正在尝试获取您的页面,从而导致额外的请求?
尝试将 addThis 从页面中取出,看看它是否仍然发生。
You have addThis in your page, is it possible that the addThis server is trying to fetch your page, causing the additional request?
Try taking addThis out of the page and see if it still happens.