- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
<?php
...
define ( "CSELECT", "select task.value as tvid, count(*) as cnt from ( " );
define ( "CJOIN", " ) as s1
left join m_dict on s1.id_m_dict = m_dict.id " );
define ( "CWHERE", " where task_attr.id_mf = 116
and task_attr.value <> 'Дело'
group by task_attr.value" );
...
$sqltext = CSELECT . "select id, id_dep, id_m_dict
from task
where task.state = 0 and
task.startdate <= '" . $reportDate . " 23:59:59' and
task.id_dep in (2,42) and
task.id_m_dict = 29
" . CJOIN . CWHERE;
...
?>
Я может чего-то не понимаю и так писать круто, но когда этих $sqltext = ... больше 5, то извините, это капец.