tp 多表查詢與if顯示

$user_id = session('uid');
$data['user_id'] = $user_id;
$appointment = M('appointment');   
$count = $appointment->join('tb_order ON tb_appointment.order_id = tb_order.order_id')->where($data)->count();
$Page = new \Think\Page($count,15);  
      $Page->setConfig('header', '<li class="rows">&nbsp'.getLanguage('第').'<b>%NOW_PAGE%</b>'.getLanguage('頁').'/'.getLanguage('共').'<b>%TOTAL_PAGE%</b>'.getLanguage('頁').'</li>');
      $Page->setConfig('prev', getLanguage('上一頁'));
      $Page->setConfig('next', getLanguage('下一頁'));
      $Page->setConfig('last', getLanguage('末頁'));
      $Page->setConfig('first', getLanguage('首頁'));
      $Page->setConfig('first', getLanguage('首頁'));
      $Page->setConfig('theme', '%FIRST%%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%%END%%HEADER%');
      $Page->rollPage=8;
$show = $Page->show(); 
$list = $appointment->join('tb_order ON tb_appointment.order_id = tb_order.order_id')->where($data)->limit($Page->firstRow.','.$Page->listRows)->order('date desc')->select();
$this->assign('appointment',$list);
$this->assign('page',$show);
$this->display();

<volist name="pres" id="vo">
                  <if condition="$i != count($pres)">
           <a href="__MODULE__/<if condition="$vo['type'] eq 1">Arlistsession

<elseif condition="$vo['type'] eq 2"/>Pageapp

<elseif condition="$vo['type'] eq 3"/>Messageui

<elseif condition="$vo['type'] eq 4"/>Zplistthis

<elseif condition="$vo['type'] eq 5"/>Carlistget

<elseif condition="$vo['type'] eq 6"/>Ryit

<elseif condition="$vo['type'] eq 7"/>Jobio

</if>/index/cateid/{$vo.id}">{$vo.name}</a> &gt;
                  <else />
                  <font>{$vo.name}</font>
                  </if>
                  </volist>ast

相關文章
相關標籤/搜索