我正在一个项目中,其中一项功能需要添加事件的开始时间和结束时间。我想根据计时器的开始和停止来更改前端的内容,并希望在MySQL表行中进行一些更改。
For ex:
Start : 9/7/2018 00:00:00 PM Stop: 12/7/2018 00:00:00 PM
File Name: A.html
//Content change with time
1. Before Starting Timer : Upcoming Event
2. After Timer Starts: Ongoing Event
3. After Timer Stops: Event Finished
MySQL
Table Name: Event
Column Name: is_active
//is_active value
4. Before Starting Timer: Upcoming
5. On Timer Starts: Ongoing
6. On Timer Stops: Finished
我想从MySQL列is_active中获取值Upcoming,Ongoing,Finished,然后将其显示在A.html的第1、2和3点中。 我也想在A.html页面上显示倒数计时器。 我在后端使用Node.js,在MySQL中使用MySQL作为数据库。 希望我已经解决了我的问题。如果我没记错的话,应该在其中应用SQL事件或触发器。
For better understanding it is same as E-commerce flash sales. Before
starting sale "coming soon", as sale starts " Buy", as sale finishes "sold
out" and accordingly change in database and show the countdown timer like sale finishes in "XX-XX-XX" time.
感谢您提供任何帮助。