1234567891011121314151617181920212223242526272829303132333435363738 |
- --[[
- Descripttion:明细
- version:
- Author: Neo,Huang
- Date: 2023-11-23 23:22:46
- LastEditors: Neo,Huang
- LastEditTime: 2023-11-23 23:23:57
- --]]
- local timer = require("timer")
- local baseService = require("baseService")
- local lib_game_mysql = require("lib_game_mysql")
- local timeUtil = require("utils.timeUtil")
- local timerDelExpire = nil
- local CMD = {}
- -- 清理明细记录
- local function l_del_expire_record()
- local currTime = skynet_time()
- local maxTime = timeUtil.getDayStartTime(currTime, -7)
- local sql = string.format("delete from mdl_itemrecord where createTime < %s;", tostring(maxTime))
- local ret = lib_game_mysql:query(sql)
- log.info("l_del_expire_record sql[%s] ret[%s]", tostring(sql), tostring(ret))
- end
- function CMD.onStart()
- -- 每天1点开始删除
- timerDelExpire = timer.timeOfDay(1, 0, 0, l_del_expire_record)
- end
- function CMD.onStop()
- -- 取消定时器
- timerDelExpire.func = nil
- end
- baseService.start(CMD, ".itemrecordCenter", true)
|