// 帅选 品牌 规格 属性 价格
$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 | afe9ef6fb059c92a589633ec2390a8f3 |
html | false |
filter_param | { "id": 1, "brand_id": "38" } |
id | 1 |
brand_id | 38 |
spec | 0 |
attr | |
sort | goods_id |
sort_asc | asc |
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 | [ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 114, 115, 374, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535 ] |