// 帅选 品牌 规格 属性 价格
$cat_id_arr = getCatGrandson ($id);
$goods_where = ['is_on_sale' => 1, 'exchange_integral' => 0,'cat_id'=>['in',$cat_id_arr]];
$filter_goods_id = Db::name('goods')->where($goods_where)->cache(true)->getField("goods_id",true);
// 过滤帅选的结果集里面找商品
if($brand_id || $price)// 品牌或者价格
{
$goods_id_1 = $goodsLogic->getGoodsIdByBrandPrice($brand_id,$price); // 根据 品牌 或者 价格范围 查找所有商品id
$filter_goods_id = array_intersect($filter_goods_id,$goods_id_1); // 获取多个帅选条件的结果 的交集
}
if($spec)// 规格
{
$goods_id_2 = $goodsLogic->getGoodsIdBySpec($spec); // 根据 规格 查找当所有商品id
$filter_goods_id = array_intersect($filter_goods_id,$goods_id_2); // 获取多个帅选条件的结果 的交集
}
if($attr)// 属性
{
$goods_id_3 = $goodsLogic->getGoodsIdByAttr($attr); // 根据 规格 查找当所有商品id
key | c5a8655036f261f4f471f6d89e28c81d |
html | false |
filter_param | { "id": 1, "brand_id": "67" } |
id | 1 |
brand_id | 67 |
spec | 0 |
attr | |
sort | shop_price |
sort_asc | desc |
price | |
start_price | 0 |
end_price | 0 |
goodsLogic | [] |
goodsCate | { "id": 1, "name": "\u8155\u8868", "mobile_name": "\u8155\u8868", "parent_id": 0, "parent_id_path": "0_1", "level": 1, "sort_order": 0, "is_show": 1, "image": "", "is_hot": 1, "cat_group": 0, "commission_rate": 0, "parent_name": "\u8155\u8868", "select_id": 0 } |
cateArr | [ { "id": 4, "name": "\u8fea\u897f\u6b27", "mobile_name": "\u8fea\u897f\u6b27", "parent_id": 1, "parent_id_path": "0_1_4", "level": 2, "sort_order": 0, "is_show": 1, "image": "\/public\/upload\/category\/2020\/04-01\/99780de7e6ee8259d2f5f11510ea65c9.jpg", "is_hot": 0, "cat_group": 0, "commission_rate": 0, "sub_menu": [] } ] |
cat_id_arr | [ 1, 3, 4 ] |
goods_where | { "is_on_sale": 1, "exchange_integral": 0, "cat_id": [ "in", [ 1, 3, 4 ] ] } |
filter_goods_id | Resource |
goods_id_1 | [ 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ] |