关于饿鲜达商品关注,查询改动

This commit is contained in:
苏尹岚
2020-02-14 15:30:21 +08:00
parent e4bea2e7eb
commit e451901a74
4 changed files with 58 additions and 45 deletions

View File

@@ -415,6 +415,14 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma
sqlParams = append(sqlParams, nameIDs) sqlParams = append(sqlParams, nameIDs)
} }
} }
if params["isExd"] != nil {
var idExd = params["isExd"].(bool)
if idExd {
sql += " AND t2.exd_sku_id <> ''"
} else {
sql += " AND t2.exd_sku_id == ''"
}
}
if params["categoryID"] != nil { if params["categoryID"] != nil {
cat := &model.SkuCategory{} cat := &model.SkuCategory{}
cat.ID = params["categoryID"].(int) cat.ID = params["categoryID"].(int)

View File

@@ -90,7 +90,8 @@ type tStoreSkuBindAndSpec struct {
SkuNamePrice int SkuNamePrice int
SkuNameUnit string SkuNameUnit string
RealSkuID int `orm:"column(real_sku_id)"` RealSkuID int `orm:"column(real_sku_id)"`
ExdSkuID string `orm:"column(exd_sku_id)"`
StoreName string
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核 ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
} }
@@ -976,13 +977,13 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
sql := ` sql := `
SELECT SELECT
t2.*, t2.*,
t1.id real_sku_id, t1.status sku_status, t1.spec_quality, t1.spec_unit,` t1.id real_sku_id, t1.status sku_status, t1.spec_quality, t1.spec_unit, t1.exd_sku_id,`
if needGetExistingUnitPrice { if needGetExistingUnitPrice {
sql += " IF(t5.unit_price > 0, t5.unit_price, t3.price) sku_name_price," sql += " IF(t5.unit_price > 0, t5.unit_price, t3.price) sku_name_price,"
} }
sql += ` sql += `
t3.unit sku_name_unit, t3.name, t3.status sku_name_status, t3.unit sku_name_unit, t3.name, t3.status sku_name_status,
ts.change_price_type ts.change_price_type, ts.name store_name
FROM sku t1 FROM sku t1
JOIN store ts ON ts.id = ? AND ts.deleted_at = ? JOIN store ts ON ts.id = ? AND ts.deleted_at = ?
LEFT JOIN store_sku_bind t2 ON t2.sku_id = t1.id AND t2.store_id = ts.id AND t2.deleted_at = ? LEFT JOIN store_sku_bind t2 ON t2.sku_id = t1.id AND t2.store_id = ts.id AND t2.deleted_at = ?
@@ -1037,6 +1038,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
// globals.SugarLogger.Debug(utils.Format4Output(inSkuBind, false)) // globals.SugarLogger.Debug(utils.Format4Output(inSkuBind, false))
var skuBind *model.StoreSkuBind var skuBind *model.StoreSkuBind
if v.ID == 0 { if v.ID == 0 {
if !(strings.Contains(v.StoreName, model.ExdStoreName) && v.ExdSkuID == "") {
if skuBindInfo.IsFocus == 1 && v.SkuNameStatus == model.SkuStatusNormal && v.SkuStatus == model.SkuStatusNormal && isCanChangePrice { if skuBindInfo.IsFocus == 1 && v.SkuNameStatus == model.SkuStatusNormal && v.SkuStatus == model.SkuStatusNormal && isCanChangePrice {
skuBind = &model.StoreSkuBind{ skuBind = &model.StoreSkuBind{
StoreID: storeID, StoreID: storeID,
@@ -1075,6 +1077,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
} }
} }
} }
}
} else { } else {
beforeMsg := *v beforeMsg := *v
skuBind = &v.StoreSkuBind skuBind = &v.StoreSkuBind

View File

@@ -47,6 +47,7 @@ var (
} }
checkCookieList = []string{ checkCookieList = []string{
"08:00:00", "08:00:00",
"12:00:00",
"18:00:00", "18:00:00",
} }
createStorePriceTimeList = []string{ createStorePriceTimeList = []string{

View File

@@ -147,6 +147,7 @@ func (c *SkuController) SyncCategory() {
// @Param skuCategoryID query int false "商品所属类别ID" // @Param skuCategoryID query int false "商品所属类别ID"
// @Param unit query string false "商品单位" // @Param unit query string false "商品单位"
// @Param isSpu query bool false "是否是SPU" // @Param isSpu query bool false "是否是SPU"
// @Param isExd query bool false "是否是饿鲜达商品"
// @Param fromStatus query int false "查询起始状态0下架1正常" // @Param fromStatus query int false "查询起始状态0下架1正常"
// @Param toStatus query int false "查询起始状态0下架1正常" // @Param toStatus query int false "查询起始状态0下架1正常"
// @Param offset query int false "门店列表起始序号以0开始缺省为0" // @Param offset query int false "门店列表起始序号以0开始缺省为0"