mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码
This commit is contained in:
43
server/internal/dao/sys_sms_log.go
Normal file
43
server/internal/dao/sys_sms_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"
|
||||
)
|
||||
|
||||
// internalSysSmsLogDao is internal type for wrapping internal DAO implements.
|
||||
type internalSysSmsLogDao = *internal.SysSmsLogDao
|
||||
|
||||
// sysSmsLogDao is the data access object for table hg_sys_sms_log.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysSmsLogDao struct {
|
||||
internalSysSmsLogDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysSmsLog is globally public accessible object for table hg_sys_sms_log operations.
|
||||
SysSmsLog = sysSmsLogDao{
|
||||
internal.NewSysSmsLogDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
|
||||
// NowDayCount 当天发送次数
|
||||
func (dao *sysSmsLogDao) NowDayCount(ctx context.Context, event, mobile string) (count int, err error) {
|
||||
count, err = dao.Ctx(ctx).
|
||||
Where("mobile", mobile).
|
||||
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