select if(CONCAT(year(ph.created), '_', week(ph.created)) = dt.cr, -1,
if(CONCAT(year(ph.created), '_', week(ph.created)) = dt.nx, -2, (year(ph.created) * 100) + week(ph.created))) t
from test ph
inner join (select CONCAT(year(now()), '_', week(now())) cr,
CONCAT(year(now()), '_', week(now()) + 1) nx from dual) dt on 1=1
order by t