sjgroup.inc.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. global $_GPC, $_W;
  3. $storeid=$_COOKIE["storeid"];
  4. $cur_store = $this->getStoreById($storeid);
  5. $GLOBALS['frames'] = $this->getNaveMenu2($storeid);
  6. $pageindex = max(1, intval($_GPC['page']));
  7. $pagesize=10;
  8. $type=isset($_GPC['type'])?$_GPC['type']:'all';
  9. $where=" where a.uniacid=:uniacid and a.state>0";
  10. $data[':uniacid']=$_W['uniacid'];
  11. if(isset($_GPC['keywords'])){
  12. $where.=" and ( a.goods_name LIKE concat('%', :name,'%') || a.id LIKE concat('%', :name,'%') || b.store_name LIKE concat('%', :name,'%'))";
  13. $data[':name']=$_GPC['keywords'];
  14. $type='all';
  15. }
  16. if($_GPC['time']){
  17. $start=strtotime($_GPC['time']['start']);
  18. $end=strtotime($_GPC['time']['end']);
  19. $where.=" and a.kt_time >='{$start}' and a.kt_time<='{$end}'";
  20. $type='all';
  21. }else{
  22. if($type=='ing'){
  23. $where.=" and a.state=1";
  24. }
  25. if($type=='success'){
  26. $where.=" and a.state=2";
  27. }
  28. if($type=='fail'){
  29. $where.=" and a.state=3";
  30. }
  31. }
  32. $sql="SELECT a.*,b.store_name FROM ".tablename('zhtc_group')." a left join".tablename('zhtc_store')." b on a.store_id=b.id ".$where." ORDER BY a.id DESC";
  33. $total=pdo_fetchcolumn("SELECT * FROM ".tablename('zhtc_group')." a left join".tablename('zhtc_store')." b on a.store_id=b.id " .$where,$data);
  34. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  35. $list=pdo_fetchall($select_sql,$data);
  36. //打印
  37. include $this->template('web/sjgroup');