组合名字函数修改

This commit is contained in:
苏尹岚
2019-12-18 10:06:14 +08:00
parent 404a7b9040
commit 8cd09089a8
19 changed files with 54 additions and 71 deletions

View File

@@ -199,10 +199,13 @@ type ActStoreSku2 struct {
SkuName string `json:"skuName"`
Prefix string `json:"-"`
SkuNameName string `orm:"column(sku_name_name)" json:"-"`
Unit string `orm:"size(8)" json:"-"`
SpecQuality float32 `json:"-"`
SpecUnit string `json:"-"`
Comment string `json:"-"`
Prefix string `json:"-"`
ExPrefix string
ExPrefixBegin time.Time
ExPrefixEnd time.Time
SkuNameName string `orm:"column(sku_name_name)" json:"-"`
Unit string `orm:"size(8)" json:"-"`
SpecQuality float32 `json:"-"`
SpecUnit string `json:"-"`
Comment string `json:"-"`
}

View File

@@ -101,7 +101,7 @@ func GetActStoreSkuVendorList(db *DaoDB, actID int, vendorIDs, storeIDs, skuIDs
END vendor_sku_id,
t4.comment, t4.spec_quality, t4.spec_unit,
t6.name store_name,
t7.name sku_name_name, t7.unit, t7.prefix
t7.name sku_name_name, t7.unit, t7.prefix, t7.ex_prefix, t7.ex_prefix_begin, t7.ex_prefix_end
FROM act_store_sku t1
%s JOIN act_store_sku_map t2 ON t2.act_id = ? AND t2.bind_id = t1.id AND t2.deleted_at = ?`, jdVendorIDField, leftOrEmpty)
sqlParams := []interface{}{

View File

@@ -278,7 +278,7 @@ func GetPriceReferSnapshot(db *DaoDB, cityCodes, skuIDs []int, snapDate time.Tim
err = err2
if len(skuList) > 0 {
skuAndName := skuList[0]
jxSkuDetailName := jxutils.ComposeSkuName(skuAndName.Prefix, skuAndName.Name, skuAndName.Comment, skuAndName.Unit, skuAndName.SpecQuality, skuAndName.SpecUnit, 0)
jxSkuDetailName := jxutils.ComposeSkuName(skuAndName.Prefix, skuAndName.Name, skuAndName.Comment, skuAndName.Unit, skuAndName.SpecQuality, skuAndName.SpecUnit, 0, "", utils.ZeroTimeValue, utils.ZeroTimeValue)
v.SkuName = jxSkuDetailName
}
}

View File

@@ -76,7 +76,7 @@ func GetCategories(db *DaoDB, parentID, level int, catIDs []int) (cats []*model.
func GetSkus(db *DaoDB, skuIDs, nameIDs, statuss, catIDs []int) (skuList []*model.SkuAndName, err error) {
sql := `
SELECT t1.*, t2.name, t2.unit, t2.prefix, t2.is_spu
SELECT t1.*, t2.name, t2.unit, t2.prefix, t2.is_spu, t2.ex_prefix, t2.ex_prefix_begin, t2.ex_prefix_end
FROM sku t1
JOIN sku_name t2 ON t2.id = t1.name_id AND t2.deleted_at = ?
`

View File

@@ -229,10 +229,13 @@ type Sku struct {
type SkuAndName struct {
Sku
Name string
Unit string
Prefix string
IsSpu int
Name string
Unit string
Prefix string
IsSpu int
ExPrefix string
ExPrefixBegin time.Time
ExPrefixEnd time.Time
}
func (*Sku) TableUnique() [][]string {