mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
improve quote handling of table string for package gdb; improve rotation feature for package glog
This commit is contained in:
@ -1,14 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gogf/gf/os/gfile"
|
||||
"github.com/gogf/gf/text/gregex"
|
||||
"github.com/gogf/gf/frame/g"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(gfile.Basename("/tmp/1585227151172826000/access.20200326205231173924.log"))
|
||||
fmt.Println(
|
||||
gregex.IsMatchString(`.+\.\d{20}\.log`,
|
||||
gfile.Basename("/tmp/1585227151172826000/access.20200326205231173924.log")))
|
||||
g.DB().SetDebug(true)
|
||||
tx, err := g.DB().Begin()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
smsTaskInfo := "`sms_sys`.sms_task_info"
|
||||
m := tx.Table(smsTaskInfo)
|
||||
_, err = m.Where("`delete`=0 AND is_review_temp=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(create_time)>=86400").Delete()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user