站长资讯网
最全最丰富的资讯网站

yii2判断数据库字段不为空

yii2判断数据库字段不为空

yii2判断数据库字段is null,如下:

相关教程推荐:yii框架

示例:

$query = new Query;               $query->select('ID, City,State,StudentName')        ->from('student')                                       ->where(['IsActive' => 1])        ->andWhere(['not', ['City' => null]])        ->andWhere(['not', ['State' => null]])        ->orderBy(['rand()' => SORT_DESC])              ->limit(10);

赞(0)
分享到: 更多 (0)

网站地图   沪ICP备18035694号-2    沪公网安备31011702889846号