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 ('1318','1324','1339','1340','1341','1343','1345','1352','1356','1357','1358','1359','1360','1371','1375','1376','1378','1379','1380','1381','1384','1385','1386','1388','1390','1391','1394','1395','1396','1409','1412','1413','1456','1467','1482','1494','1500','1531','1534','1545','1547','1548','1550','1560','1568','1577','1584','1598','1610','1625','1629','1632','1633','1635','1636','1643','1644','1646','1648','1667','1671','1677','1678','1679','1680','1684','1686','1691','1692','1696','1709','1721','2250','2252','2256','2280','2281','2282','2284','2326','2332','2335','2342','2346','2348','2370','2379','2385','2449','2960','2961','2962','2963','5669','5710','5711','5713','5714','6933','6934','6935','6936','6945','6946','6947','6948','7098','7101','8413','8414','8415','8416','8425','8426','8427','8428','9256','9257','9258','9259','9280','9903','12569','12570','12571','12572','12818','12834','12835','12837','12838','12839','12840','12841','12842','12843','12868','12869','12870','12871','12882','12883','12884','13988','13989','14067','14068','14069','14070','14071','14072','14073','14074','14075','14076','14077','14078','14079','14080','14081','14082') ) 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,1477,1479,1481,1456,1486,1480,1483,1485,1488,2118,2119,2121) , g.store_sort asc LIMIT 0,16