测试
This commit is contained in:
@@ -2441,7 +2441,12 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE
|
|||||||
func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNameAndPlaceList []*dao.SkuNameAndPlace, err error) {
|
func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNameAndPlaceList []*dao.SkuNameAndPlace, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
orderCreate := time.Now().AddDate(0, -1, 0)
|
orderCreate := time.Now().AddDate(0, -1, 0)
|
||||||
skuNameAndPlace, err := dao.GetTopSkusByCityCode(db, cityCode, orderCreate)
|
var skuNameAndPlace []*dao.SkuNameAndPlace
|
||||||
|
if cityCode > 0 {
|
||||||
|
skuNameAndPlace, err = dao.GetTopSkusByCityCode(db, cityCode, orderCreate)
|
||||||
|
} else {
|
||||||
|
skuNameAndPlace, err = dao.GetTopSkusByNoCityCode(db, cityCode, orderCreate)
|
||||||
|
}
|
||||||
if storeID > 0 {
|
if storeID > 0 {
|
||||||
var skuNameList []*model.SkuName
|
var skuNameList []*model.SkuName
|
||||||
//不可售的商品nameID列表
|
//不可售的商品nameID列表
|
||||||
|
|||||||
@@ -1669,3 +1669,19 @@ func GetStoreSkuAuditLight(db *DaoDB, storeIDs, nameIDs []int, status int) (stor
|
|||||||
err = GetRows(db, &storeSkuAudit, sql, sqlParams...)
|
err = GetRows(db, &storeSkuAudit, sql, sqlParams...)
|
||||||
return storeSkuAudit, err
|
return storeSkuAudit, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetTopSkusByNoCityCode(db *DaoDB, cityCode int, orderCreate time.Time) (skuNameAndPlace []*SkuNameAndPlace, err error) {
|
||||||
|
skuName := &model.SkuName{
|
||||||
|
BestSeller: 1,
|
||||||
|
}
|
||||||
|
//sqlParams := []interface{}{
|
||||||
|
// utils.DefaultTimeValue,
|
||||||
|
// utils.DefaultTimeValue,
|
||||||
|
// cityCode,
|
||||||
|
// salePriceLimit,
|
||||||
|
// orderCreate,
|
||||||
|
//}
|
||||||
|
err = GetEntity(db, skuName, "best_seller")
|
||||||
|
//err = GetRows(db, &skuNameAndPlace, sql, sqlParams...)
|
||||||
|
return skuNameAndPlace, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ type SkuName struct {
|
|||||||
YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀
|
YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀
|
||||||
JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存
|
JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存
|
||||||
PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长
|
PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长
|
||||||
|
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*SkuName) TableUnique() [][]string {
|
func (*SkuName) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ func (c *StoreSkuController) GetTopSkusByStoreIDs() {
|
|||||||
// @Title 根据城市信息查找推荐商品(按销量)
|
// @Title 根据城市信息查找推荐商品(按销量)
|
||||||
// @Description 根据城市信息查找推荐商品(按销量)
|
// @Description 根据城市信息查找推荐商品(按销量)
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param cityCode query int true "城市id"
|
// @Param cityCode query int false "城市id"
|
||||||
// @Param storeID query int false "门店id"
|
// @Param storeID query int false "门店id"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
|||||||
Reference in New Issue
Block a user