TP5使用where条件,如何使用or,and

浏览:23875 发布日期:2018/06/12 分类:求助交流
我写的代码是这样的。
$uid=11;
$muid=13;
$yymsg=Db::table('p_message')
->alias('t1')
->join('user t2','t1.muid = t2.uid')
->field('t1.*,t2.nickname,t2.head')
->where(['t1.muid'=>$uid,'t1.uid'=>$muid])
->whereOr(['t1.muid'=>$muid,'t1.uid'=>$uid])
->select();

但得到的where条件长这样(WHERE `t1`.`muid` = 11 AND `t1`.`uid` = 13 OR `t1`.`muid` = 13 OR `t1`.`uid` = 11),
想要的where条件是这样(WHERE `t1`.`muid` = 11 AND `t1`.`uid` = 13 OR `t1`.`muid` = 13 AND `t1`.`uid` = 11),应该怎么写
最佳答案
评论( 相关
后面还有条评论,点击查看>>