Query / Запрос |
select c.id,c.location_id location,c.banner_id,b.name,b.target,b.url,b.text,b.image1,b.w,b.h from ad_campaign c,ad_banners b
where c.banner_id=b.id and c.inwork='1' and c.pause='0' and c.datestart<1615081959
and (c.allpages=1 or c.treeurl like '%,24,%')
and c.extreeurl not like '%,24,%'
and c.timemin<=4 and c.timemax>=4
and c.daysview like '%,7,%'
order by rand() |