商品额外信息
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/aliupcapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -379,3 +381,34 @@ func InsertUpcDepot(db *DaoDB, result *aliupcapi.GetAliUpcInfoResult) (err error
|
||||
_, err = ExecuteSQL(db, sql, sqlParams)
|
||||
return err
|
||||
}
|
||||
|
||||
func GetSkuExinfos(db *DaoDB, nameIDs []int, vendorID int, exPrefix string, fromTime, toTime time.Time) (skuExinfoMaps []*model.SkuExinfoMap, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM sku_exinfo_map
|
||||
WHERE deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if len(nameIDs) > 0 {
|
||||
sql += " AND name_id IN (" + GenQuestionMarks(len(nameIDs)) + ")"
|
||||
sqlParams = append(sqlParams, nameIDs)
|
||||
}
|
||||
if vendorID != -1 {
|
||||
sql += " AND vendor_id = ?"
|
||||
sqlParams = append(sqlParams, vendorID)
|
||||
}
|
||||
if exPrefix != "" {
|
||||
sql += " AND ex_prefix LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+exPrefix+"%")
|
||||
}
|
||||
if fromTime != utils.ZeroTimeValue && toTime != utils.ZeroTimeValue {
|
||||
sql += " AND NOT (begin_at > ? OR end_at < ?)"
|
||||
sqlParams = append(sqlParams, toTime, fromTime)
|
||||
}
|
||||
if err = GetRows(db, &skuExinfoMaps, sql, sqlParams...); err == nil {
|
||||
return skuExinfoMaps, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -285,12 +285,12 @@ type SkuNameExt struct {
|
||||
type SkuExinfoMap struct {
|
||||
ModelIDCULD
|
||||
|
||||
ExPrefix string `orm:"size(255)" json:"exPrefix"`
|
||||
ImgWatermark string `orm:"size(512)" json:"imgWatermark"` //图片水印
|
||||
NameID int `orm:"column(name_id)" json:"nameID"`
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"`
|
||||
EndAt time.Time `orm:"type(datetime);index" json:"endAt"`
|
||||
BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"` //设置起始时间
|
||||
EndAt time.Time `orm:"type(datetime);index" json:"endAt"` //设置结束时间
|
||||
ExPrefix string `orm:"size(255)" json:"exPrefix"` //额外前缀
|
||||
ImgWatermark string `orm:"size(512)" json:"imgWatermark"` //图片水印
|
||||
}
|
||||
|
||||
func (*SkuExinfoMap) TableIndex() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user