新手问题 How to decrease a field value every other day in rails?

zzz6519003 · 2014年09月24日 · 最后由 zzz6519003 回复于 2014年09月25日 · 1499 次阅读

One method would be to use cron job. https://github.com/javan/whenever.

Is there any other way to do this?

能算出来吗?

比如说这样的公式,初始值 - c * (当前时间 - 创建时间)。

如果值变化的话,加个 xx 值改变时间的字段,然后接着套公式。

#1 楼 @Yujing_Z 超级感谢!

#2 楼 @yfractal good call!太谢谢啦~

需要 登录 后方可回复, 如果你还没有账号请 注册新账号