- add created_at, updated_at, last_operator to WeiXins
This commit is contained in:
@@ -16,7 +16,8 @@ func CreateWeiXins(db *DaoDB, user *legacymodel.WeiXins) (err error) {
|
||||
openid = IF(openid = '', NULL, openid),
|
||||
openid_mini = IF(openid_mini = '', NULL, openid_mini),
|
||||
openid_union = IF(openid_union = '', NULL, openid_union),
|
||||
tel = IF(tel = '', NULL, tel)
|
||||
tel = IF(tel = '', NULL, tel),
|
||||
parentid = IF(parentid = 0, -1, parentid)
|
||||
WHERE id = ?
|
||||
`, user.ID); err != nil {
|
||||
Rollback(db)
|
||||
|
||||
@@ -15,7 +15,6 @@ func TestCreateWeiXins(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(places, false))
|
||||
}
|
||||
|
||||
func TestGetWeiXinUserByIDs(t *testing.T) {
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
package legacymodel
|
||||
|
||||
import "time"
|
||||
|
||||
type WeiXins struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
JxStoreID int `orm:"column(jxstoreid);index" json:"storeID"`
|
||||
OpenID string `orm:"column(openid);size(70);unique;null" json:"-"`
|
||||
OpenIDMini string `orm:"column(openid_mini);size(70);unique;null" json:"-"`
|
||||
OpenIDUnion string `orm:"column(openid_union);size(70);unique;null" json:"-"`
|
||||
Tel string `orm:"size(15);null;unique" json:"tel"`
|
||||
ParentID int `orm:"column(parentid);default(-1);index" json:"parentID"`
|
||||
NickName string `orm:"column(nickname);size(30)" json:"nickname"`
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
CreatedAt time.Time `orm:"auto_now_add;type(datetime);null" json:"createdAt"`
|
||||
UpdatedAt time.Time `orm:"auto_now;type(datetime);null" json:"updatedAt"`
|
||||
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
||||
JxStoreID int `orm:"column(jxstoreid);index" json:"storeID"`
|
||||
OpenID string `orm:"column(openid);size(70);unique;null" json:"-"`
|
||||
OpenIDMini string `orm:"column(openid_mini);size(70);unique;null" json:"-"`
|
||||
OpenIDUnion string `orm:"column(openid_union);size(70);unique;null" json:"-"`
|
||||
Tel string `orm:"size(15);null;unique" json:"tel"`
|
||||
ParentID int `orm:"column(parentid);default(-1);index" json:"parentID"`
|
||||
NickName string `orm:"column(nickname);size(30)" json:"nickname"`
|
||||
}
|
||||
|
||||
func (*WeiXins) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user