请教 数据库多条件怎么查询 [ 2.0 版本 ]
请教下 $model->where(['type'=>1])->andWhere(['like', 'content', $keyword]) 还有个条件 create_time > $time 应该怎么写
最佳答案
-
Accountdoc::find() ->andFilterWhere(['=','nShopID',$this->nShopID])
->andFilterWhere(['=','nAccountTransacType',$type]) ->andFilterWhere(['=','sAccountName',$filter]) ->andFilterWhere(['>','nDateTime',$from])
可以类似这样写
共 1 条回复http://www.yiiframework.com/doc-2.0/yii-db-query.html#where()-detail
可以去看看原文的官方網站裡面有詳細的條件查詢(幫你標記了)
其他 3 个回答
路人甲
注册时间:2015-06-24
最后登录:2017-09-26
在线时长:11小时13分
最后登录:2017-09-26
在线时长:11小时13分
- 粉丝3
- 金钱125
- 威望0
- 积分235