美文网首页
THinkPhp or+leftjoin+field查询

THinkPhp or+leftjoin+field查询

作者: 5990 | 来源:发表于2017-09-15 09:42 被阅读0次
    $model=M('erp_jiaoqi');
    $tiaojian='';
    return $model
    //字段
          ->field('erp_so.createtime,erp_so.changetime,erp_jiaoqi.po,erp_jiaoqi.qty,erp_jiaoqi.spc,erp_jiaoqi.pkid,erp_jiaoqi.so,erp_jiaoqi.cust,erp_jiaoqi.jiaoqi,erp_jiaoqi.prd_no,erp_jiaoqi.prd_name')
    //链接表
                    ->join('left join erp_so on erp_jiaoqi.so = erp_so.cgnum')
    //条件
                    ->where([
                        'so|po|prd_no'=>$tiaojian,
                        '_logic'=>'OR'
                    ])
                    ->limit($page,20)
    //排序
                    ->order('erp_jiaoqi.pkid desc')
                    ->select();
    

    相关文章

      网友评论

          本文标题:THinkPhp or+leftjoin+field查询

          本文链接:https://www.haomeiwen.com/subject/nwqssxtx.html