mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
版本预发布
This commit is contained in:
43
server/internal/dao/sys_ems_log.go
Normal file
43
server/internal/dao/sys_ems_log.go
Normal file
@@ -0,0 +1,43 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalSysEmsLogDao is internal type for wrapping internal DAO implements.
|
||||
type internalSysEmsLogDao = *internal.SysEmsLogDao
|
||||
|
||||
// sysEmsLogDao is the data access object for table hg_sys_ems_log.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysEmsLogDao struct {
|
||||
internalSysEmsLogDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysEmsLog is globally public accessible object for table hg_sys_ems_log operations.
|
||||
SysEmsLog = sysEmsLogDao{
|
||||
internal.NewSysEmsLogDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
|
||||
// NowDayCount 当天发送次数
|
||||
func (dao *sysEmsLogDao) NowDayCount(ctx context.Context, event, email string) (count int, err error) {
|
||||
count, err = dao.Ctx(ctx).
|
||||
Where("email", email).
|
||||
Where("event", event).
|
||||
WhereGTE("created_at", gtime.Now().Format("Y-m-d")).
|
||||
Count()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user