SELECT s.praise_rate,s.im_qq,s.im_ww,g.goods_id,g.store_sort, g.store_id, g.type, g.goods_name, g.cate_id, g.cate_name, g.brand, g.spec_qty, g.spec_name_1, g.spec_name_2,g.spec_name_3, g.if_show, g.closed, g.add_time, g.recommended, g.default_image, g.special, g.sort,g.store_sort, g.is_copy,g.delete_time,gs.spec_id, gs.spec_1, gs.spec_2, gs.spec_3, gs.yuanjia, gs.color_rgb, gs.price, gs.stock,gs.sku,gs.material, gs.pack,gs.inter_stock,gs.out_stock,gs.discount_x,gs.cost_x,gs.cost_z,gs.discount_z,gs.product_date,s.store_name, s.region_id, s.region_name, s.credit_value, s.sgrade, gp.pvs, gst.views, gst.sales, gst.comments FROM ecm_goods g LEFT JOIN ecm_goods_spec gs ON g.default_spec = gs.spec_id LEFT JOIN ecm_store s ON g.store_id = s.store_id LEFT JOIN ecm_goods_pvs gp ON g.goods_id=gp.goods_id LEFT JOIN ecm_goods_statistics gst ON g.goods_id = gst.goods_id LEFT JOIN `ecm_sbhh_goods` w ON g.goods_id = w.goods_id WHERE g.if_show = 1 AND g.closed = 0 AND g.is_delete=0 AND s.state != 0 AND s.state !=2 AND (g.goods_id IN ('248','252','254','257','260','262','263','266','268','269','270','272','273','274','277','278','279','280','281','282','283','285','288','2594','2597','2601','2603','2606','2607','2609','2611','2614','2617','2620','2623','2627','2628','2634','4112','4117','4118','4119','4120','4121','4122','4123','4124','4125','4126','4127','4128','4129','4130','4131','4132','6179','6180','6181','6182','6183','6184','6185','6186','6187','11076','12944','12945','12946','12947','12948','12949','12950','12951','12952','12953','12954','12955','12956','12957','12958','13012','13013','13014','13015','13020','13021','13022','16140','16141','16142','16599','17546','17972','17973','18462') ) AND ( w.warehouse in (2) OR s.region_id in (510,511,512,513,514,515,516,517,518,519,360,361,362,363,366,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,424,426,431,436,439,441,442,444,448,453,454,456,467,476,511,512,513,514,517,518,519,520,521,522,523,524,525,530,545,555,562,570,572,573,581,589,598,606,611,633,646,687,691,692,702,795)) AND gs.spec_id IS NOT NULL AND s.store_id IS NOT NULL ORDER BY (case when special=3 then 1 ELSE 2 END) , FIELD(s.region_id,510,511,512,513,514,515,516,517,518,519,360,361,362,363,366,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,424,426,431,436,439,441,442,444,448,453,454,456,467,476,511,512,513,514,517,518,519,520,521,522,523,524,525,530,545,555,562,570,572,573,581,589,598,606,611,633,646,687,691,692,702,795) , FIELD(g.cate_id,4101,807,648,802,0) , g.store_sort asc LIMIT 0,16