- normal store weixin msg.
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
DefPageSize = 50
|
||||
UnlimitedPageSize = 999999999
|
||||
UnlimitedPageSize = math.MaxInt32
|
||||
)
|
||||
|
||||
type GoodsOrderExt struct {
|
||||
|
||||
@@ -137,6 +137,17 @@ func CreateEntity(db *DaoDB, item interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// InsertMulti执行成功后ID不会改写成正确的(象Insert一样)
|
||||
func CreateMultiEntities(db *DaoDB, item interface{}) (err error) {
|
||||
if db == nil {
|
||||
db = GetDB()
|
||||
}
|
||||
if _, err = db.db.InsertMulti(20, item); err != nil && !IsDuplicateError(err) {
|
||||
globals.SugarLogger.Errorf("CreateEntity %s failed with error:%v", reflect.TypeOf(item).Name(), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func CreateOrUpdate(db *DaoDB, item interface{}, colConflitAndArgs ...string) (err error) {
|
||||
if db == nil {
|
||||
db = GetDB()
|
||||
|
||||
@@ -9,19 +9,33 @@ const (
|
||||
MessageStatusSendAllSuccess = 1
|
||||
MessageStatusSendSuccess = 2
|
||||
MessageStatusSendAllFailed = 3
|
||||
MessageStatusRead = 4
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
ModelIDCULD
|
||||
Type int8
|
||||
Title string
|
||||
Content string
|
||||
Type int8 `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
func (*Message) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"CreatedAt"},
|
||||
[]string{"DeletedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
type MessageStatus struct {
|
||||
ModelIDCULD
|
||||
MessageID int
|
||||
StoreID int
|
||||
Status int8
|
||||
MessageID int `orm:"column(message_id)" json:"messageID"`
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||
Status int8 `json:"status"`
|
||||
ReadCount int `json:"readCount"`
|
||||
}
|
||||
|
||||
func (*MessageStatus) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"MessageID", "Status"},
|
||||
[]string{"StoreID", "MessageID", "Status"},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user