我不知道如何显示管理员(医生)每天观看的用户(患者)数量。我有这份每日报告,可以打印我每天的总销售额,但如果我需要显示数量用户(pacientes)他看到(如 10 个 pacientes)代码打印 2000 或更多..
你能帮我解决这个问题吗?
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Fecha</th>
<th>Total Pacientes vistos</th>
<th>Total diario</th>
</tr>
</thead>
<tbody>
<tr>
<?
include 'config.php';
$sql = $conn->prepare("SELECT DATE(start) AS date, SUM(id_paciente) AS total_pacientes, SUM(honorario) AS total_diario
FROM CITAS WHERE start >= CURDATE() AND start < CURDATE() + INTERVAL 1 DAY ORDER BY start ASC");
$sql->execute();
while($row = $sql->fetch(PDO::FETCH_ASSOC)) {
?>
<td class="center"><? echo $row['date']; ?></td>
<td class="center"><? echo $row['total_pacientes']; ?></td>
<td class="center"><? echo $row['total_diario']; ?></td>
</tr> <? } ?>
</tbody>
</table>
表 CITAS
- 开始 日期时间
- Honorario varchar
- id_paciente int
我需要这样的报告显示:
date(fecha)--------total_user(total de pacientes)-----total_sales(total diario)
- 10-junio-2013----------25---------------------------------650.00
- 09-junio-2013----------10---------------------------------250.00
- 08-junio-2013----------15---------------------------------375.00
但现在显示它是这样的:
date(fecha)--------total_user(total de pacientes)-----total_sales(total diario)
- 10-junio-2013---------65725---------------------------------650.00
- 09-junio-2013----------34510---------------------------------250.00
- 08-junio-2013----------49815---------------------------------375.00
id_paciente 有 17,000 个用户,是表 PACIENTES 的 FK