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 ('149','160','249','256','259','261','271','275','310','312','313','318','319','321','323','504','589','590','914','915','998','999','1000','1001','1002','1003','1004','1005','1006','1007','1008','1009','1010','1011','1145','1162','1166','1169','1177','1182','1188','1308','1310','1316','1319','1320','1321','1322','1323','1325','1327','1328','1329','4823','4824','4825','4826','4827','4828','4829','4830','4831','4832','4833','4834','4835','4862','4868','4869','4871','4882','4884','4885','4886','4888','4889','4891','4892','6196','6197','6198','6199','6200','6201','6202','6203','6204','6205','6237','6238','6239','6245','6248','6249','6250','6251','6253','6254','6255','6256','6257','6376','8026','8027','8028','8029','8030','8031','8032','8033','8034','8035','8330','8331','8332','8333','8334','8335','8336','8337','8338','8339','8340','8341','8342','8343','8344','9776','9777','9778','9779','9780','9781','9782','9784','9785','9786','9787','9788','10001','10002','10013','10014','10015','10016','10017','10018','10351','10357','10441','10442','10443','10444','10471','10575','10576','10591','10592','10593','10594','10687','10688','10695','10736','10737','10748','10827','10866','10884','10885','10886','10887','10888','10889','10890','10891','10892','10971','10973','10974','10976','10979','10980','10981','10983','10985','10987','11079','11293','11294','11295','11296','11297','11298','11299','11300','11301','11302','11303','11304','11305','11306','11307','11308','11309','11310','11311','11312','11316','11317','11319','11320','11322','11325','11327','11329','11330','11331','11333','13017','14708','14709','14714','14715','14773','14774','14794','14826','14888','14962','14964','14965','14966','14967','14968','14969','14970','14971','14972','14976','15064','15065','15066','15067','15068','15069','15070','15071','15072','15073','15124','15314','15612','15625','15626','15627','15628','15629','15630','15631','15632','15633','15634','15635','15636','15784','15785','15787','15788','15789','15790','15791','15792','15793','15860','15908','15910','15911','15916','15918','15921','15922','15924','15926','15928','15929','15930','15931','15932','15933','15934','15983','15984','15986','15988','15989','15990','15991','15992','16015','16085','16089','16129','16379','16380','16381','16382','16384','16385','16386','16387','16390','16391','16392','16393','16394','16395','16396','16397','16398','16399','16400','16401','16402','16403','16404','16405','16406','16407','16421','16422','16423','16457','16966','17280','17347','17348','17376','17489','17503','17510','17524','17678','17679','17681','17791','17866','17867','17868','17869','17893','17894','17901','17903','17904','17913','17914','17929','18180','18324','18325') ) 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,1175,1505,1174,486,1184) , g.store_sort asc LIMIT 0,16