- param isBySku added for GetStoreSkus
This commit is contained in:
@@ -87,7 +87,7 @@ type StoreOpRequestInfo struct {
|
||||
|
||||
// 商品不可售,直接排除
|
||||
// 如果门店商品是可售状态,那么会忽略区域限制。否则有区域限制
|
||||
func GetStoreSkus(ctx *jxcontext.Context, storeID int, isFocus bool, keyword string, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *StoreSkuNamesInfo, err error) {
|
||||
func GetStoreSkus(ctx *jxcontext.Context, storeID int, isFocus bool, keyword string, isBySku bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *StoreSkuNamesInfo, err error) {
|
||||
db := dao.GetDB()
|
||||
sql := `
|
||||
FROM sku_name t1
|
||||
@@ -212,8 +212,11 @@ func GetStoreSkus(ctx *jxcontext.Context, storeID int, isFocus bool, keyword str
|
||||
t1.unit,
|
||||
t1.price,
|
||||
t1.img,
|
||||
t1.elm_img_hash_code
|
||||
`
|
||||
t1.elm_img_hash_code`
|
||||
if isBySku {
|
||||
sql += `,
|
||||
t2.id`
|
||||
}
|
||||
sqlData := `
|
||||
SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
|
||||
@@ -39,12 +39,13 @@ type StoreSkuController struct {
|
||||
// @Param isGetOpRequest query bool false "是否返回相应的待审核变动请求,缺省为false不返回"
|
||||
// @Param offset query int false "门店列表起始序号(以0开始,缺省为0)"
|
||||
// @Param pageSize query int false "门店列表页大小(缺省为50,-1表示全部)"
|
||||
// @Param isBySku query bool false "是否按SKU分拆"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetStoreSkus [get]
|
||||
func (c *StoreSkuController) GetStoreSkus() {
|
||||
c.callGetStoreSkus(func(params *tStoreSkuGetStoreSkusParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetStoreSkus(params.Ctx, params.StoreID, params.IsFocus, params.Keyword, params.MapData, params.Offset, params.PageSize)
|
||||
retVal, err = cms.GetStoreSkus(params.Ctx, params.StoreID, params.IsFocus, params.Keyword, params.IsBySku, params.MapData, params.Offset, params.PageSize)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user