hyuser.inc.php
2.94 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
if($_GPC['keywords']){
$op=$_GPC['keywords'];
$where="%$op%";
}else{
$where='%%';
}
/* $sql="select * from " . tablename("cjdc_user") ." WHERE name LIKE :name and uniacid=:uniacid";
$list=pdo_fetchall($sql,array(':name'=>$where,'uniacid'=>$_W['uniacid']));*/
$pageindex = max(1, intval($_GPC['page']));
$pagesize=10;
$sql="select * from " . tablename("cjdc_user") ." WHERE name LIKE :name and uniacid=:uniacid and name!='' and UNIX_TIMESTAMP(dq_time)>=".time()." order by id DESC";
$select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
$list = pdo_fetchall($select_sql,array(':uniacid'=>$_W['uniacid'],':name'=>$where));
$total=pdo_fetchcolumn("select count(*) from " . tablename("cjdc_user") ." WHERE name LIKE :name and uniacid=:uniacid and name!='' and UNIX_TIMESTAMP(dq_time)>=".time(),array(':uniacid'=>$_W['uniacid'],':name'=>$where));
$pager = pagination($total, $pageindex, $pagesize);
if($_GPC['id']){
$res4=pdo_delete("cjdc_user",array('id'=>$_GPC['id']));
if($res4){
message('删除成功!', $this->createWebUrl('hyuser'), 'success');
}else{
message('删除失败!','','error');
}
}
if(checksubmit('submit2')){
$res=pdo_update('cjdc_user',array('wallet +='=>$_GPC['reply']),array('id'=>$_GPC['id2']));
if($res){
$data['money']=$_GPC['reply'];
$data['user_id']=$_GPC['id2'];
if($_GPC['reply']<0){
$data['type']=2;
$data['note']='后台扣分';
}else{
$data['type']=1;
$data['note']='后台充值';
}
$data['time']=date('Y-m-d H:i:s');
$res2=pdo_insert('cjdc_qbmx',$data);
if($res2){
message('充值成功!', $this->createWebUrl('hyuser'), 'success');
}else{
message('充值失败!','','error');
}
}
}
if(checksubmit('submit3')){
if($_GPC['reply']<0){
$data['type']=2;
$data['note']='后台扣分';
}else{
$data['type']=1;
$data['note']='后台充值';
}
if($_GPC['reply']!=0){
$res=pdo_update('cjdc_user',array('total_score +='=>$_GPC['reply']),array('id'=>$_GPC['id3']));
}
if($res){
$data['score']=abs($_GPC['reply']);
$data['user_id']=$_GPC['id3'];
$data['cerated_time']=date('Y-m-d H:i:s');
$data['uniacid']=$_W['uniacid'];//小程序id
$res2=pdo_insert('cjdc_integral',$data);
if($res2){
message('充值成功!', $this->createWebUrl('hyuser'), 'success');
}else{
message('充值失败!','','error');
}
}
}
if(checksubmit('submit4')){
$res=pdo_update('cjdc_user',array('user_address '=>''),array('uniacid'=>$_W['uniacid']));
if($res){
message('清空成功', $this->createWebUrl('hyuser'), 'success');
}else{
message('清空失败!','','error');
}
}
include $this->template('web/hyuser');