Code Monkey home page Code Monkey logo

laravel-easywechat-flexible-voting-system's Introduction

前台界面

后台界面

后台

每日仅允许投一票

每次投票便记入投票表中。

代码采用实现方式一: 判断 vote 表(用户投票表) 中存在用户的投票数据则无法再次进行投票, 使用 crontab 定时任务每晚12:00清空投票表。 在 posts表(作品表) 设置投票数字段,投票时执行 +1.

每日允许多次投票扩展: 判断表中字段出现的次数即可。

防止刷票

添加阅读次数, 当“投票数/每日可投票数量 > 阅读数”则有刷票行为。 那么每日对投票表进行清空就不是很科学了, 无法检测每个作品的投票情况。

实现方式二: 不用设置定时任务, 对用户今日的投票进行检测, 虽然之后也可以对作品的投票数据进行 count 从而检测投票总数, 不过保留 posts 表中的 count 在数据量大的情况更有优势。

注意事项

需要注意的是当初为了应付外包,迎合需求,并未实现作品分类统计。

laravel-easywechat-flexible-voting-system's People

Contributors

yangxyo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.