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