有一个表Holiday, 有startDate,endDate.
我现在传入一个日期,想判断这个日期是不是节日,怎么做?
我的原生sql写法:
$db=M('');
$sql=' SELECT count(recId) as nums FROM hr_holiday where '.$currDate.' between startTime and endTime ';
$recordCount=$db->query($sql);
echo $recordCount['nums'];
失败...
如果用M('holiday'),用M('holiday')->where($condition)->count().
这个$condition怎么写啊?直接丢 '.$currDate.' between startTime and endTime '这个么?
最佳答案