复合查询_complex的问题,望大家帮忙

浏览:726 发布日期:2018/12/12 分类:求助交流
复合查询时条件后面只有or条件并没有type=0这个条件$type = 0;
        $page = $_REQUEST['page'];
        $where['n.today'] = array('gt', 0);
        $where['n.yes']   = array('gt', 0);
        $where['n.week']  = array('gt', 0);
        $where['n.month'] = array('gt', 0);
        $where['_logic'] = 'or';
        $map['_complex'] = $where;
        $map['n.type']   = $type;
        $res = M('pay_num as n')
                -> field('n.*,v.nickname,v.name,v.headimgurl,v.saleuid')
                -> join('wechat_vip as v ON v.unitid = n.unitid')
                -> where($where)
                -> order('n.today desc')
                -> limit($page,10)
                -> select();
SELECT n.*,v.nickname,v.name,v.headimgurl,v.saleuid FROM wechat_pay_num as n INNER JOIN wechat_vip as v ON v.unitid = n.unitid WHERE n.today > 0 OR n.yes > 0 OR n.week > 0 OR n.month > 0 ORDER BY n.today desc LIMIT 0,10
最佳答案
评论( 相关
后面还有条评论,点击查看>>