本文介绍了CakePHP上的计划任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 CakePHP 3.2 项目上工作。
我有一个属性
实体。
当用户创建属性时,管理员必须验证其是否变为活动。 b $ b之后,我在当前日期+ 10天之内输入 date_of_expiration
字段...
when a user creates a property, the admin must validate it to become active..After that I put in field called date_of_expiration
the current date + 10 days for example ...
我想要的是此属性在此日期(当前日期+ 10天)到期。.通过从更改名为 status
的字段有效变为无效。
What I want is that this property expires in this date (current date + 10 day).. By changing a field called status
from active to inactive..
我在Google中进行了搜索,发现我需要称之为 Sheduled Task strong> ..
I searched in Google and i found that what i nead called Sheduled Task..
我问如何在CakePHP 3.2中做到这一点的最佳方法
I ask about the best way to do this in CakePHP 3.2
推荐答案
- 以查找过期的属性并将其值更改为inac
- Create Shell with the function to find an expired property and change the value to inactive.
- Run Shell from CronJob every day at 00:00:00
这篇关于CakePHP上的计划任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!