随笔分类 - Yii2.0
摘要:附加条件你可以使用 andWhere() 或者 orWhere() 在原有条件的基础上 附加额外的条件。你可以多次调用这些方法来分别追加不同的条件。 例如, $status = 10; $search = 'yii'; $query->where(['status' => $status]); if
阅读全文
摘要:use yii\db\Expression; $query->andWhere([ 'or', ['os.user_id' => \Yii::$app->user->id], new Expression("FIND_IN_SET(:other_ids, other_ids)",[":other_i
阅读全文
摘要:yii2.0['like', 'name', '%tester', false] => name LIKE '%tester'
阅读全文