$sql = Db::name('Hzlist')
->whereNull('delete_time');
$hzlistall = $sql
->count();
$hzlistalldyby = $sql
->whereMonth('daoyuan_time')->count();
$hzlistallsy = $sql
->whereMonth('daoyuan_time','last month')
->count();
$hzlistalljryy = $sql
->whereDay('yuyue_time')
->count();
为什么生成得后面生成得sql会加上前面得sql查询语句?
[2020-11-24 11:46:28][sql] SELECT COUNT(*) AS think_count FROM `ea_hzlist` WHERE `delete_time` IS NULL AND `daoyuan_time` BETWEEN 1604160000 AND 1606751999 [ RunTime:0.000254s ]
[2020-11-24 11:46:28][sql] SELECT COUNT(*) AS think_count FROM `ea_hzlist` WHERE `delete_time` IS NULL AND `daoyuan_time` BETWEEN 1604160000 AND 1606751999 AND `daoyuan_time` BETWEEN 1601481600 AND 1604159999 [ RunTime:0.000251s ]
[2020-11-24 11:46:28][sql] SELECT COUNT(*) AS think_count FROM `ea_hzlist` WHERE `delete_time` IS NULL AND `daoyuan_time` BETWEEN 1604160000 AND 1606751999 AND `daoyuan_time` BETWEEN 1601481600 AND 1604159999 AND `yuyue_time` BETWEEN 1606147200 AND 1606233599 [ RunTime:0.000238s ]