chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/*
* $Author :PHPYUN开发团队
*
* 官网: http://www.phpyun.com
*
* 版权所有 2009-2021 宿迁鑫潮信息技术有限公司,并保留所有权利。
*
* 软件声明:未经授权前提下,不得用于商业运营、二次开发以及任何形式的再次发布。
 */
class admin_withdraw_controller extends siteadmin_controller{
    function set_search(){
        $search_list[]    =    array("param"=>"order_state","name"=>'提现状态',"value"=>array("0"=>"等待审核","1"=>"提现成功","2"=>"提现失败"));
        
        $lo_time        =    array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月');
        $search_list[]    =    array("param"=>"time","name"=>'提现时间',"value"=>$lo_time);
        
        $this -> yunset("search_list",$search_list);
    }
    function index_action(){
        $this -> set_search();
        $packM                            =    $this -> MODEL('pack');
        
        $where                            =   array();
       
        $keywordStr                        =   trim($_GET['keyword']);
        if($_GET['news_search']){
            if (!empty($keywordStr) && $_GET['typeca']=='1') {
                
                $where['order_id']        =    array('like', $keywordStr);
                
            }elseif(!empty($keywordStr) && $_GET['typeca']=='2'){
                
                $UserinfoM                =    $this -> MODEL('userinfo');
                $orderinfo                =    $UserinfoM -> getList(array('username'=>array('like',$keywordStr)),array('field'=>'uid'));
                
                if (is_array($orderinfo)){
                    foreach ($orderinfo as $val){
                        $orderuids[]    =    $val['uid'];
                    }
                    $where['uid']        =    array('in', pylode(",",$orderuids));
                }
            }
            $urlarr['keyword']            =    $keywordStr;
            $urlarr['typeca']            =    $_GET['typeca'];
            $urlarr['news_search']        =    $_GET['news_search'];
        }
        if($_GET['order_state']!=""){
            $where['order_state']        =    $_GET['order_state'];
 
            $urlarr['order_state']        =    $_GET['order_state'];
        }
        if($_GET['time']){
            if($_GET['time'] == 1){
                $where['time']    =    array('>=',strtotime(date("Y-m-d 00:00:00")));
            }else{
                $where['time']    =    array('>=',strtotime('-'.intval($_GET['time']).' day'));
            }
            $urlarr['time']                =    $_GET['time'];
        }
        
        $urlarr['page']                    =    "{{page}}";
        
        $pageurl                        =    Url($_GET['m'],$urlarr,'admin');
        
        $pageM                            =    $this  -> MODEL('page');
        
        $pages                            =    $pageM -> pageList('member_withdraw',$where,$pageurl,$_GET['page']);
 
        if($pages['total'] > 0){
            //limit order 只有在列表查询时才需要
            if($_GET['order']){
                $where['orderby']        =    $_GET['t'].','.$_GET['order'];
 
                $urlarr['order']        =    $_GET['order'];
                $urlarr['t']            =    $_GET['t'];
            }else{
                $where['orderby']        =    array('id,desc');
            }
            $where['limit']                =    $pages['limit'];
 
            $rows                        =   $packM -> getList($where,array('utype'=>'admin'));
        }
        $this->yunset("get_type", $_GET);
        $this->yunset("rows",$rows);
        $this->siteadmin_tpl(array('admin_withdraw'));
    }
    function setpay_action(){
        $this -> check_token();
        $id            =    intval($_GET['id']);
        $packM        =    $this -> MODEL('pack');
        $return        =    $packM -> setPay($id);
        $this -> layer_msg($return['msg'],$return['errcode'],0,$_SERVER['HTTP_REFERER']);
    }
    function del_action(){
        $this -> check_token();
        $packM        =    $this -> MODEL('pack');
        $id            =    intval($_GET['id']);
        $return        =    $packM -> delWithDraw($id);
        $this -> layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']);
    }
}
?>