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);

更多編程相關內容,請關注php中文網yii框架欄目!

? 版權聲明
THE END
喜歡就支持一下吧
點贊6 分享