SimithGriffin (@steve5wutongyu6)NewAPI定时重置余额 中发帖

定时将指定用户的余额重置为指定数值 
-- 创建事件
CREATE EVENT IF NOT EXISTS reset_quota_daily
ON SCHEDULE EVERY 1 DAY
STARTS TIMESTAMP(CURRENT_DATE, '00:00:00')
DO
BEGIN
-- 更新用户配额
UPDATE users
SET quota = 500000000, used_quota = 0
WHERE username = '你的用户名';

-- 在logs表中插入日志记录
INSERT INTO logs (user_id, created_at, type, content, username, quota)
SELECT
id,
UNIX_TIMESTAM...