我想计算readdate,它在表中必须为空。我想用html启动代码,有一个表,它包含像id,storeid,message,readdate,entrydate这样的字段。如果readdate为空,那么我想计算它并显示这些计数。
<html>
<div class="orange-count">
<?php
echo $unread_recommendation = Storenotification::model()->count("id='" . Yii::app()->session['id'] . "' AND readdate='null' ");
?>
</div>
</html>
2条答案
按热度按时间t3psigkw1#
空计数的Sql命令
根据您的框架进行更改。
r7s23pms2#
试试看:
这应该也能用,不过我还没有测试过: