@my943813636
2020-06-23T02:18:19.000000Z
字数 8159
阅读 516
分类关系
%d 为父分类id
父分类下套子分类, 数据为直接子分类
hash
- key 分类id
- value // 直接子分类
{"id": 3,"categorie_id": 41,"cid": 1,"sort": 1,"range": 999,"num": 100,"rule": "sort_asc","is_enabled": 0}
//@params:cid 分类id//1. 清空原有的 category:sections:${cid}//2. 根据直接子分类生成数据 [ {key,value}] ,如果没有子分类不添加 添加category:sections:${cid}func syncCategorySections(cid int)
hash
- key 分类id
- value
{"id": 3,"parent_id": 41,"nest_left": 2,"nest_right": 173,"nest_depth": 1,"name": "Girl","name2": "ガーリー","slug": "second-sisilily","page_title": "Girl ガーリー","meta_keywords": "","meta_description": "","position": 2,"description": "","is_enabled": 1,"app_icon": "//img.sisilily.com/public/5d5/ce9/454/thumb_457_50x50_0_0_auto.png","thumb": "//img.sisilily.com/public/5dd/3bb/da5/thumb_47286_50x50_0_0_auto.png","origin_app_icon": "//img.sisilily.com/public/5d5/ce9/454/5d5ce9454bc8a082229987.png","origin_thumb": "//img.sisilily.com/public/5dd/3bb/da5/5dd3bbda54446331588658.png"}
//@params:cid 分类id// 生成分类信息数据func syncCategory(cid int)
hash
- key 分类id
- value
[{"id": 1,"title": "図案","sort": 0,"options": [{"name": "無地","val": "1"},{"name": "プリント","val": "2,7,13,14,16"}]}]
//@params:cid 分类id// 生成所有分类数据func syncCategoryFeatures(cid int)
hash
- key 分类id
- value
[{"type": "category","keyword": "トップス","name": "second","val": "11","slugType": "tops"}]
//@params:cid 分类id// 生成所有分类数据func syncCategoryHotwords(cid int)
hash
- key : 分类id
- value
[{"amount_type": "point", //ratio , specify"amount": 1,"user_group": 1,}]
amount_type 类型:
- ratio 比例
- specify 固定金额
// 生成所有积分策略数据func syncCategoryPoints()
//返回全部分类的idfunc getCategoryIdList() []int
//@params:id 促销id//返回该促销下的关联的产品id列表, 如果折扣类型不是产品返回 []func getPromoteProductIdList(id int) []int
//@params:id 促销id//返回该折扣类型是产品的促销列表func getPromoteIdList() []int
hash
- key : 广告位code
- value :
{"name": "首页-GIRL类目快速入口","members_count": 1,"enabled_cycle": 0,"is_enabled": 1,"from_date": 946742399,"to_date": 946742399,"members": [{"id": 255,"name": "トップス","link": "https://m.sisilily.com/design.html?first=3&second=7","sort": 1,"is_enabled": 1,"describe": "<p>トップス</p>","url": "https://img.sisilily.com/storage/app/uploads/public/5e2/588/877/5e2588877a709985817768.png"}]}
//@params:id 广告位id//给定广告位id 同步广告位 和 广告位成员数据func syncAvert(id int)
//返回全部广告位id 列表func getBannerIdList() []int
Zset
- score : 商品排序
- member : 商品id
//@params:code 勾选位code//清空原有的勾选位数据 product_sections:${code}//给定勾选位code 同步勾选位商品数据 和 商品排序 key product_sections:${code}func syncProductSections(code string)
//返回全部商品勾选位code 列表func getProductSectionsCodeList() []string
//@params:code 勾选位code//返回勾选位关联的商品列表func getProductSectionsRelateProduct(code string) int[]
hash
- key : 商品id
- value :
{"id": 1129,"code": "1129","name": "レトロハイヒールスエードジッパーショート丈ブーツ","pid": 1551157,"name2": "","slug": "b-shoes-boots-1129","status": "instock","spu": "0001551157","spu_status": 1,"stock_status": 1,"list_price": 478000,"price": 239000,"activity_price": 0,"amount": 9999,"sales_num": 1,"collect": 4,"rating": 5,"reviews_count": 7,"sort": 9999,"sort_section": 0,"sort2": 9999,"sort3": 9999,"thumb": "//img.sisilily.com/public/5d6/ce5/47b/thumb_8949_344x420_0_0_auto_65.jpg","s_thumb": "//img.sisilily.com/public/5d6/ce5/486/thumb_8950_344x420_0_0_auto.jpg","instock_time": 1567670771}
//@params:id 商品id//@params:isSyncActivePrice 是否需要同步 活动价格,如果需要同步活动价格需要查询商品所属的促销规则,然后根据促销规则同步活动价格,如果不属于任何促销活动活动价格为 0 , 字段 activity_price//1. 如果 activity_price 是false 需要先判断 redis 中是否存在这个商品数据, 如果存在保留redis中的 activity_price 不存在 使用 0 作为默认值,表示没有参与活动//给定商品id 同步商品基础信息, 价格需要 * 100 结果为整数 , instock_time 为utc 时间戳 秒func syncProduct(id int, isSyncActivePrice bool)
hash
- key : 商品id
- value :
{"id": 4923,"product_id": 2,"sizes": "[{\"id\":1330558,\"first_name\":\"尺码\",\"trans_name\":\"サイズ(CM)\",\"values\":[\"フリー\"]},{\"id\":1330559,\"first_name\":\"袖长\",\"trans_name\":\"袖丈\",\"values\":[\"33\"]},{\"id\":1330560,\"first_name\":\"衣长\",\"trans_name\":\"着丈\",\"values\":[\"39\"]},{\"id\":1330561,\"first_name\":\"胸围\",\"trans_name\":\"バスト\",\"values\":[\"106\"]}]","size_image": "","size_group": ""}
//@params:id 商品id//给定商品id 同步商品尺码信息func syncProductSize(id int)
hash
- key : 商品id
- value :
{"content": "<p></p>",}
//@params:id 商品id//给定商品id 同步商品详情信息func syncProductContent(id int)
hash
- key : 商品id
- value :
{"id": 39,"name": "カバン模様","name2": "包包图案","group_id": 0,"type": "","sort": 1,"description": "","display_on_product": 1,"options": 0,"values": "{\"533\":{\"id\":533,\"feature_id\":39,\"name\":\"\\u914d\\u8272\",\"name2\":\"\\u914d\\u8272\",\"code\":\"\",\"sort\":1,\"options\":0}}"}
//@params:id 商品id// 清空原有的商品特征值数据 product:features:${id}//给定商品id 同步商品详情信息func syncProductFeatures(id int)
hash
- key : 评论 id
- value :
{"id": 8556,"admin_id": 535,"parent_id": 0,"uid": 0,"product_id": 10198,"title": "外出するのも良いかも","name": "和智麻衣","email": "","rating": 5,"audit": 1,"location": "frontend","content": "これから暑くなるので薄着になる事が多くなると思います。シャツ1枚で外出するのには抵抗があったのですが、このシャツなら1枚で外出するのも良いかもと思える位のシャツだと感じてます。","user_cate": "2","thumbs": ["://img.sisilily.com"]}
//@params:id 商品id//清空原有的商品评论数据 product:reviews:${id}//给定商品id 同步商品评论 ( thumbs 为带图评论 如果有图片返回图片地址列表)func syncProductReviews(id int)
hash
- key : 商品id
- value :
["//img.sisilily.com/public/5d6/74d/606/5d674d60610df766731997.jpg","//img.sisilily.com/public/5d6/74d/628/5d674d62877b7953816338.jpg"]
//@params:id 商品id//给定商品id 同步商品图片列表func syncProductReviews(id int)
hash
- key : 商品选项 id
- value :
{"id": 19952,"parent_id": 0,"name": "カラー","name2": "颜色","product_id": 10107,"sort": 3,"type": "radio","variate_value": 0,"required": 0,"comment": "","values": [{"id": 65751,"option_id": 19952,"name": "イエロー","name2": "黄色","remind_tags": "","price_variate": "+","variate_value": 0,"sort": 3,"f_thumb": "","o_thumb": "//img.sisilily.com/public/5e2/69b/bc2/thumb_93040_40x40_0_0_crop.jpg","origin_f_thumb": "","origin_o_thumb": "//img.sisilily.com/public/5e2/69b/bc2/5e269bbc24d55949232313.jpg"}]}
//@params:id 商品id//清空原有的商品选项 product:options:${id}//给定商品id 同步商品选项列表func syncProductOptions(id int)
hash
- key : 商品sku id
- value :
{"id": 112784,"product_id": 10036,"option_values": "{\"19810\":{\"65323\":\"\\u7816\\u7ea2\\u8272\\u5957\\u88c5\"},\"19811\":{\"65331\":\"85B\"}}","sku": "000276163200024","item_id": "","sku_price": 7200,"sku_status": 1,"sku_list_price": 21400,"sku_stock": 7427,"presell": 1}
//@params:id 商品id//清空原有的商品选项 product:skus:${id}//给定商品id 同步商品sku列表func syncProductSkus(id int)
set
- value : 商品 id
//@params:id 商品id//清空原有的商品猜你喜欢 product:guess_like:${id}//给定商品id 同步商品sku列表func syncProductGuessLike(id int)
set
- value : 商品 id
//@params:id 商品id//清空原有的商品推荐 product:recommend:${id}//给定商品id 同步商品推荐列表func syncProductRecommend(id int)
hash
- key : 商品 id
- value
// tag type/**1. 场馆2. 不处理 (后台绑定标签)3. HOT4. NEW5. time-sale6. new-sale7. special-sale**/{"product_id": 68,"tags": [{"type": 1,"content": "Lady"}]}
//@params:id 商品id//给定商品id 同步商品标签func syncProductTags(id int)
hash
- key : 商品 id
- value : [4, 24,15] 所属分类层级
//@params:id 商品id//给定商品id 同步商品分类层级 分类关系如下/**- 4- 24- 15**///排序后 [4,24,15]func syncProductCategories(id int)
//@params:startProductId 起始商品id 包含//@params:endProductId 结束商品id 不包含//获取商品id范围内全部商品的id列表func getProductIdList(startProductId int, endProductId int) []int