improve quote handling of table string for package gdb; improve rotation feature for package glog

This commit is contained in:
John
2020-03-26 22:22:27 +08:00
parent ba56eb87b1
commit 495b5758ec
8 changed files with 34 additions and 24 deletions

View File

@ -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()
}