|
@@ -30,6 +30,7 @@ type ProductAttr struct {
|
|
|
AttrKeyId int64 `orm:"column(attr_key_id)" json:"attr_key_id"` // int(11)
|
|
AttrKeyId int64 `orm:"column(attr_key_id)" json:"attr_key_id"` // int(11)
|
|
|
Name string `orm:"column(name);null" json:"name"` // varchar(64)
|
|
Name string `orm:"column(name);null" json:"name"` // varchar(64)
|
|
|
IsSelect bool `orm:"-" json:"is_select"` // tinyint(1)
|
|
IsSelect bool `orm:"-" json:"is_select"` // tinyint(1)
|
|
|
|
|
+ Status bool `orm:"status" json:"-"` // tinyint(1)
|
|
|
Recommend int64 `orm:"column(recommend);null" json:"-"` // tinyint(1)
|
|
Recommend int64 `orm:"column(recommend);null" json:"-"` // tinyint(1)
|
|
|
CreatedAt time.Time `orm:"column(created_at);auto_now_add;type(datetime)" json:"-"` // datetime
|
|
CreatedAt time.Time `orm:"column(created_at);auto_now_add;type(datetime)" json:"-"` // datetime
|
|
|
UpdatedAt time.Time `orm:"column(updated_at);auto_now;type(datetime)" json:"-"` // datetime
|
|
UpdatedAt time.Time `orm:"column(updated_at);auto_now;type(datetime)" json:"-"` // datetime
|
|
@@ -78,7 +79,7 @@ func GetProductConfigAttrsByPId(pId int64) (items []*ProductAttrConfig) {
|
|
|
func GetProductAttrsByKId(kId int64) (items []*ProductAttr) {
|
|
func GetProductAttrsByKId(kId int64) (items []*ProductAttr) {
|
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
|
item := new(ProductAttr)
|
|
item := new(ProductAttr)
|
|
|
- _, err := o.QueryTable(item).Filter("attr_key_id", kId).All(&items)
|
|
|
|
|
|
|
+ _, err := o.QueryTable(item).Filter("attr_key_id", kId).Filter("status", true).All(&items)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
beego.BeeLogger.Error("GetProductAttrsByKId(%d) err=%s", kId, err)
|
|
beego.BeeLogger.Error("GetProductAttrsByKId(%d) err=%s", kId, err)
|
|
|
}
|
|
}
|