An Error Was Encountered
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (store_item.`brand` in (13,88) OR (tag like '%,94,%' OR tag like '%,95,%' OR' at line 1
select store_item.*, store_item_brand.title as brand_title, SUM(stock) as stock, SIGN(SUM(stock)) as stock_sign from store_item inner join store_item_brand on store_item.brand = store_item_brand.id left join store_item_stock on store_item.id = item_id WHERE store_item.`sort` = '10' AND store_item.size=default AND (store_item.`brand` in (13,88) OR (tag like '%,94,%' OR tag like '%,95,%' OR tag like '%,136,%' OR tag like '%,239,%' OR tag like '%,281,%' OR tag like '%,339,%' OR tag like '%,1821,%' OR tag like '%,475,%' OR tag like '%,1820,%' OR tag like '%,753,%' OR tag like '%,831,%' OR tag like '%,1064,%' OR tag like '%,1344,%' OR tag like '%,1354,%' OR tag like '%,1424,%' OR tag like '%,1530,%' OR tag like '%,1822,%' OR tag like '%,1823,%' OR tag like '%,1824,%' OR tag like '%,1825,%' OR tag like '%,1827,%' OR tag like '%,2123,%' OR tag like '%,2131,%') OR store_item.`field2` = '0' OR store_item.`title` like '%0%') group by store_item.id order by stock_sign DESC, time DESC, id DESC limit 0 , 50