|
@ -25,6 +25,7 @@ type AreaStore struct { |
|
|
RawPassword string `json:"raw_password" xorm:"not null default '' comment('密码') VARCHAR(255)"` |
|
|
RawPassword string `json:"raw_password" xorm:"not null default '' comment('密码') VARCHAR(255)"` |
|
|
IsImport int `json:"is_import" xorm:"not null default 0 comment('是否导入的数据') TINYINT(1)"` |
|
|
IsImport int `json:"is_import" xorm:"not null default 0 comment('是否导入的数据') TINYINT(1)"` |
|
|
AreaGoodsRuleSwitch int `json:"area_goods_rule_switch" xorm:"not null default 0 comment('地区专属商品规则1开启(用自己地区的商品)0关闭(共用主会场的商品)') TINYINT(1)"` |
|
|
AreaGoodsRuleSwitch int `json:"area_goods_rule_switch" xorm:"not null default 0 comment('地区专属商品规则1开启(用自己地区的商品)0关闭(共用主会场的商品)') TINYINT(1)"` |
|
|
|
|
|
UserId int `json:"user_id" xorm:"not null default 0 comment('用户id') INT(11)"` |
|
|
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"` |
|
|
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"` |
|
|
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"` |
|
|
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"` |
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"` |
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"` |
|
@ -37,6 +38,11 @@ func (t *AreaStore) Login(activityId int, username, password string) (bool, erro |
|
|
password = helper.Md5("hdzj==" + password) |
|
|
password = helper.Md5("hdzj==" + password) |
|
|
return core.GetXormAuto().Where("activity_id=? and phone=? and password=?", activityId, username, password).Get(t) |
|
|
return core.GetXormAuto().Where("activity_id=? and phone=? and password=?", activityId, username, password).Get(t) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (t *AreaStore) GetByUserId(activityId, userId int) (bool, error) { |
|
|
|
|
|
return core.GetXormAuto().Where("user_id=? and activity_id=?", userId, activityId).Get(t) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (t *AreaStore) GetByCustomerId(customerId, activityId interface{}) (bool, error) { |
|
|
func (t *AreaStore) GetByCustomerId(customerId, activityId interface{}) (bool, error) { |
|
|
return core.GetXormAuto().Where("is_delete=0 and customer_id=? and activity_id=?", customerId, activityId).Get(t) |
|
|
return core.GetXormAuto().Where("is_delete=0 and customer_id=? and activity_id=?", customerId, activityId).Get(t) |
|
|
} |
|
|
} |
|
|