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 < 1715201368 AND g.promote_end_date > 1715201368 THEN g.promote_price WHEN g.real_promote_price != '' AND g.real_promote_start_date < 1715201368 AND g.real_promote_end_date > 1715201368 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 ('788') OR g.goods_id IN ('720','721','723','1292','1310','5984','7603','7676','8763','8772','8776','8855','10804','10815','10870','10881','11000','11082','11347','11358') )AND g.brand_id=1039 AND g.is_direct_pro = 1 AND g.goods_id IN ('2732','4259','5332','5343','5344','5345','5346','5347','5351','5353','5354','5355','5356','5357','5358','5359','5360','5361','5362','5363','5364','5365','5366','5367','5368','5369','5370','5371','6461','6483','6500','6513','6515','6517','6678','16683','16684','16686','16687','16689','16690','16691','16692','16693','16694','16695','16696','16699','16700','16701','16702','16703','16704','16705','16706','16707','16708','16709','16710','16711','16712','16713','16714','16715') ORDER BY g.is_identity_c desc, salenum DESC |