sjlqlist.inc.php 1006 B

123456789101112131415161718192021222324
  1. <?php
  2. global $_GPC, $_W;
  3. $storeid=$_COOKIE["storeid"];
  4. $cur_store = $this->getStoreById($storeid);
  5. $GLOBALS['frames'] = $this->getNaveMenu2($storeid);
  6. if(!$_GPC['type']){
  7. $_GPC['type']='all';
  8. }
  9. $where=" where a.coupons_id=:coupons_id and a.pay_type=2";
  10. $data[':coupons_id']=$_GPC['id'];
  11. if($_GPC['type']=='ok'){
  12. $where .= " and a.state=1";
  13. }
  14. if($_GPC['type']=='no'){
  15. $where .= " and a.state=2";
  16. }
  17. $pageindex = max(1, intval($_GPC['page']));
  18. $pagesize=10;
  19. $sql="SELECT a.*,b.name as user_name,b.img as user_img FROM ".tablename('zhtc_usercoupons'). " a" . " left join " . tablename("zhtc_user") . " b on a.user_id=b.id ".$where." ORDER BY a.id DESC";
  20. $total=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('zhtc_usercoupons'). " a" . " left join " . tablename("zhtc_user") . " b on a.user_id=b.id ".$where." ORDER BY a.id DESC",$data);
  21. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  22. $list=pdo_fetchall($select_sql,$data);
  23. include $this->template('web/sjlqlist');