|
@@ -14,6 +14,7 @@ type SmsRecord struct {
|
|
|
CreateTime time.Time
|
|
|
ModifyTime time.Time
|
|
|
SmsDateTime time.Time
|
|
|
+ UnionCode string
|
|
|
}
|
|
|
|
|
|
//新增记录
|
|
@@ -30,12 +31,12 @@ func AddSmsRecordMulti(items []*SmsRecord) (newId int64, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetSmsRecordCount(mobile, smsDate string) (count int, err error) {
|
|
|
+func GetSmsRecordCount(unionCode 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)
|
|
|
+ WHERE union_code=? `
|
|
|
+ err = o.Raw(sql, unionCode).QueryRow(&count)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -59,3 +60,17 @@ type SmsReq struct {
|
|
|
Date string
|
|
|
Sign string
|
|
|
}
|
|
|
+
|
|
|
+func ModifySmsRecordUnicode(unionCode string,id int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE sms_record SET union_code=? WHERE id=? `
|
|
|
+ _, err = o.Raw(sql, unionCode, id).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetSmsRecordList()(list []*SmsRecord,err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM sms_record WHERE union_code<>'' `
|
|
|
+ _, err = o.Raw(sql).Exec()
|
|
|
+ return
|
|
|
+}
|