Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的系统允许用户输入代码以将积分添加到他们的帐户中。我希望在用户在一周内兑换超过 10,000 点时收到通知。
我认为这需要一个 cron 作业,所以我已经设置好了。我只是想知道是否有某种 mysql 函数可以在查询时帮助我解决这个问题?
谢谢
您的 cron 命令将如下所示:
mysql mydatabase -c "select username, sum(points) as points from redeemed where timestamp > subdate(now(), interval 7 day) group by 1"