时间:2021-07-01 10:21:17 帮助过:22人阅读
function index(){
$goods= D('question');
$count = $goods->count();
$Page = new \Think\Page($count,6);
$list = $goods->table('ask.question question, ask.answer answer,ask.user user')->where('question.id = answer.tqu and question.userid= user.id')->field('question.id as quid,question.text as qutext,question.addtext as quadd, question.userid as quuserid,answer.text as antext,answer.addtext as answeradd, answer.userid as anuserid,answer.up,answer.down,user.name')->order(' question.id asc' )->limit($Page->firstRow.','.$Page->listRows)->select();
$show = $Page->show();
$this->assign('list',$list);
var_dump($list);
$this->assign('page',$show);
$this->display();