随笔分类 -  Yii2.0

摘要:附加条件你可以使用 andWhere() 或者 orWhere() 在原有条件的基础上 附加额外的条件。你可以多次调用这些方法来分别追加不同的条件。 例如, $status = 10; $search = 'yii'; $query->where(['status' => $status]); if 阅读全文
posted @ 2021-07-15 17:59 5572 阅读(259) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-11-25 10:07 5572 阅读(422) 评论(0) 推荐(0) 编辑
摘要:yii2.0['like', 'name', '%tester', false] => name LIKE '%tester' 阅读全文
posted @ 2020-11-04 09:25 5572 阅读(279) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩