YII2 查询语句

find和findOne区别 findONe对ID 返回该ID的数据
find()方法
->select()查找需要返回的字段
->where(‘in’,‘id’,$id)条件,有in,not in, and,not and,between,not between,or 等等
->andwhere()添加多一个条件
->filterWhere()过滤
->andFilterWhere()添加多一个过滤
->limit()分页
->offset()分页
->exists()是否存在
->count()统计
->indexBy()索引
->asArray() 也是以数组形式返回的意思 但是有没它区别好大
没有asArray会加载很多
用了asArray
用了asArray
->all()或者one 都是返回数组

猜你喜欢

转载自blog.csdn.net/pandankun/article/details/86505891
今日推荐