select distinct trim(teacher) name,count(bc) value,
case when teacher ='333 then '#FF0000'
when teacher ='111' then '#D87093'
else '#43CD80'
end color,
min(str_to_date(CONCAT(year,'/',month,'/',day),'%Y/%m/%d')) smalldate,
max(str_to_date(CONCAT(year,'/',month,'/',day),'%Y/%m/%d')) lastdate,
year,
month
from netcenter_duty where month=date_format(now(),'%m')
case when teacher ='333 then '#FF0000'
when teacher ='111' then '#D87093'
else '#43CD80'
end color,
min(str_to_date(CONCAT(year,'/',month,'/',day),'%Y/%m/%d')) smalldate,
max(str_to_date(CONCAT(year,'/',month,'/',day),'%Y/%m/%d')) lastdate,
year,
month
from netcenter_duty where month=date_format(now(),'%m')
group by teacher