123456789101112131415161718192021222324252627282930 |
- package models
- import (
- "rdluck_tools/orm"
- "time"
- )
- type SmsRecord struct {
- Id int `orm:"column(id);pk"`
- Body string
- Mobile string
- SmsDate string
- CreateTime time.Time
- }
- //新增视频
- func AddSmsRecord(item *SmsRecord) (newId int64, err error) {
- o := orm.NewOrm()
- newId, err = o.Insert(item)
- return
- }
- func GetSmsRecordCount(mobile, smsDate string) (count int, err error) {
- o := orm.NewOrm()
- sql := `SELECT COUNT(1) AS count
- FROM sms_record AS a
- WHERE mobile=? AND sms_date=? `
- err = o.Raw(sql, mobile, smsDate).QueryRow(&count)
- return
- }
|