SELECT sum(a.f06),a.id,a.f03,c.d_name,b.u_name,a.f04,a.f05,a.f06,a.f09 FROM tb_tjdate as a,tb_users as b,tb_depart as c where a.f02=b.id and b.u_depart='$arr[0]' and b.u_depart=c.id and a.f03>='$arr[1]' and a.f03<='$arr[2]' and a.f11=1 group by a.f02 SELECT a.id,a.f03,c.d_name,b.u_name,a.f04,a.f05,a.f06,a.f09 FROM tb_tjdate as a,tb_users as b,tb_depart as c where a.f02=b.id and b.u_depart='$arr[0]' and b.u_depart=c.id and a.f03>='$arr[1]' and a.f03<='$arr[2]' and a.f11=1 order by a.f03,b.u_name LIMIT $p , 30 if ($#arr9>=0) { if ($#arr9==0) { if ($ar1[3]==0) { $ar1[3]=1; } $jb=ct($arr9[0])-ct("18:00"); } if ($#arr9==1) { if ($ar1[3]==0) { $ar1[3]=1; } $jb=ct($arr9[1])-ct($arr9[0]); } if ($#arr9==2) { if ($ar1[3]==0) { $ar1[3]=1; } $jb=ct($arr9[2])-ct($arr9[1]); } }