SQL | SELECT g.goods_id,g.cat_id, g.goods_name, g.goods_name_style, g.click_count, g.goods_number, g.market_price,g.consignor_id, g.is_new, g.is_best, g.is_hot, g.is_limit, g.is_shipping, g.shop_price AS org_price, g.mappoint,g.is_act_field,g.is_seckill_act_field, IFNULL(mp.user_price, g.shop_price * '1') AS shop_price,g.is_promote,g.is_real_promote, g.promote_price,g.real_promote_price, CASE WHEN g.promote_price != '' AND g.promote_start_date < 1714354568 AND g.promote_end_date > 1714354568 THEN g.promote_price WHEN g.real_promote_price != '' AND g.real_promote_start_date < 1714354568 AND g.real_promote_end_date > 1714354568 THEN g.real_promote_price ELSE shop_price END AS shop_p, g.goods_type, g.promote_start_date, g.promote_end_date,g.real_promote_start_date, g.real_promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, g.supplier_id FROM `haoduobaduo`.`ecs_goods` AS g LEFT JOIN `haoduobaduo`.`ecs_member_price` AS mp ON mp.goods_id = g.goods_id AND mp.user_rank = '0' WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND (g.cat_id IN ('746') OR g.goods_id IN ('2053','2054','2055','3053','3059','3635','3636','3637','3638','3639','3649','3975','4037','4372','4392','4465','4492','4498','4500','4502','4505','4506','4508','4533','4867','4913','4914','4915','4916','4943','4945','4946','4978','5008','5009','5012','5093','5094','5095','5096','7587','8434','9381','9382','9383','9384','9449','9454','9455','9458','9460','9461','9467','9470','9473','9476','9477','9478','9479','9480','9481','9724','9821','9844','9845','9846','9847','10763','10764','10765','10766','10767','11377','11392','15252','16092','16093','16114','16187','16189') )AND g.brand_id=615 AND g.is_direct_pro = 1 ORDER BY g.is_identity_c desc, salenum DESC |