publicfunctionquery_money(){$m=M();$where="1=1";//fanwe_payment_notice.user_id>70000$count=$m->where($where)->query("SELECTcount(*)fromfanwe_payment_noticeLEFTJOINfanwe_useron(fanwe_user.id=fanwe_payment_notice.user_id)");//selectu.id,u.user_name,u.mobile,p.notice_sn,p.is_paid,p.money,p.pay_date,p.memofromfanwe_useru,fanwe_payment_noticepwherep.user_id=u.id$p=getpage($count[0]['count(*)'],10);$sql="SELECTfanwe_user.id,fanwe_user.user_name,fanwe_user.mobile,fanwe_payment_notice.notice_sn,fanwe_payment_notice.is_paid,fanwe_payment_notice.money,fanwe_payment_notice.pay_datefromfanwe_payment_noticeLEFTJOINfanwe_useron(fanwe_user.id=fanwe_payment_notice.user_id)";$list=$m->field(true)->where($where)->order('id')->limit($p->firstRow,$p->listRows)->query($sql);$this->assign('page',$p->show());//赋值分页输出$this->assign('list',$list);//赋值数据集$this->display();}
leftjion很简单
jion