SQL | select
a.*,
(select count(id) as total from site_shop_order_brand where brandcode = a.brandcode) as order_cnt
from site_brand a where 1 and status != '2' and ( left(brandcode,3) != '061' ) and brandcode LIKE '058%' and new_icon in(1) and ( left(brandcode,3) != '014' and left(brandcode,6) != '014022' and left(brandcode,3) != '068' and left(brandcode,3) != '014' ) and (FIND_IN_SET ('gold4130', not_cate_id ) = 0 or FIND_IN_SET ('gold4130', not_cate_id ) is null) and (FIND_IN_SET (2, etc_result) = 0 or FIND_IN_SET (3, etc_result) != 0) and (pay_goods_use = 1 ) and new_icon=1 order by %20wdate%20desc%20 limit 0, 24 |