chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
 
class subpay_controller extends train{
 
    function index_action(){
 
        $CompanyOrderM    =    $this->MODEL('companyorder');
        
        include(CONFIG_PATH."db.data.php");
        $this->yunset("arr_data",$arr_data);
        
 
        //查询账户余额信息        
        $statis                =    $this->train_satic();
        $statis['freeze']    =    sprintf("%.2f", $statis['freeze']);
        $this->yunset("statis",$statis);
 
        $where['com_id']        =    $this->uid;
        $where['usertype']        =    $this->usertype;
        $where['type']            =    2;
        $where['pay_remark']    =    array('like','课程报名费');
        //查询金额明细记录
        $urlarr['c']            =    "subpay";
        $urlarr['consume']        =    "ok";
        $urlarr['pay_remark']    =    "{{page}}";
        $pageurl    =    Url('member',$urlarr);
        $pageM        =    $this  -> MODEL('page');
        $pages        =    $pageM -> pageList('company_pay',$where,$pageurl,$_GET['page']);
    
        $where['limit']        =    $pages['limit'];
        $where['orderby']    =    array('pay_time,desc');
 
        $rows    =    $CompanyOrderM->getPayList($where);
 
        if(is_array($rows)){
 
            foreach($rows as $k=>$v){
 
                $rows[$k]['order_price']    =    floatval($v['order_price']);
                $rows[$k]['pay_time']        =    date("Y-m-d H:i:s",$v['pay_time']);
            }
        }
        $this->yunset("rows",$rows);
        $this->train_tpl('subpay');
    }
 
    //提现
    function withdraw_action(){
        //查询账户余额信息
        $PackM     =     $this->MODEL('pack');
        
        if($_POST){
            $return    =    $PackM->withDraw($this->uid,$this->usertype,$_POST['price'],$_POST['real_name']);
                
            if($return['errcode'] == 1){
                //提现成功
                $this->ACT_layer_msg("提现成功,请关注微信账户提醒!",9,$_SERVER['HTTP_REFERER']);
            }else{
                //生成失败 返回具体原因
                $this->ACT_layer_msg($return['msg'],8,$_SERVER['HTTP_REFERER']);
            }
 
        }else{
            $statis    =    $this->train_satic();
            $this->yunset("statis",$statis);
            $this->train_tpl('withdraw');
        }
    }
 
    function withdrawlist_action(){
        
        $PackM    =    $this->MODEL('pack');
        
        $where['uid']    =    $this->uid;
        $urlarr['c']    =    "subpay";
        $urlarr['act']    =    "withdrawlist";
        $urlarr['page']    =    "{{page}}";
        
        $pageurl    =    Url('member',$urlarr);
        $pageM        =    $this  -> MODEL('page');
        $pages        =    $pageM -> pageList('member_withdraw',$where,$pageurl,$_GET['page']);
    
        $where['limit']        =    $pages['limit'];
        $where['orderby']    =    array('id,desc');
 
        $rows    =    $PackM->getList($where);
        $this->yunset("rows",$rows);
 
        $statis    =     $this->train_satic();
        $this->yunset("statis",$statis);
 
        $this->train_tpl('withdrawlist');
        
    }
    function change_action(){
 
        $StatisM        =    $this->MODEL('statis');
        $CompanyOrderM    =    $this->MODEL('companyorder');
        
        $statis    =    $StatisM->getInfo($this->uid,array('usertype'=>4));
        $this->yunset("statis",$statis);
 
        $where['com_id']        =    $this->uid;
        $where['usertype']        =    $this->usertype;
        $where['pay_remark']    =    array('like','转换'.$this->config['integral_pricename']);
        $where['pay_time']        =    array('>=',strtotime(date("Y-m-d 00:00:00")));
        
        $changeNum    =    $CompanyOrderM->getCompanyPayNum($where);
        $this->yunset("changeNum",$changeNum);
 
        $this->train_tpl('change');
    }
    function savechange_action(){
 
        $data['uid']            =    $this->uid;
        
        $data['usertype']        =    4;
        
        $data['changeprice']     =    $_POST['changeprice'];
        
        $data['changeintegral']    =    $_POST['changeintegral'];
        
        $packM                    =    $this    ->    MODEL('pack');
        $return                    =    $packM    ->    saveChange($data);
        
        echo json_encode($return);
    }
    function changelist_action(){
        
        $CompanyOrderM    =    $this->MODEL('companyorder');
        $StatisM        =    $this->MODEL('statis');
        
        $where['com_id']        =    $this->uid;
        $where['usertype']        =    $this->usertype;
        $where['pay_remark']    =    array('like','转换'.$this->config['integral_pricename']);
 
        $urlarr['c']    =    "subpay";
        $urlarr['act']    =    "changelist";
        $urlarr['page']    =    "{{page}}";
        
        $pageurl    =    Url('member',$urlarr);        
        $pageM        =    $this  -> MODEL('page');
        $pages        =    $pageM -> pageList('company_pay',$where,$pageurl,$_GET['page']);
    
        $where['limit']        =    $pages['limit'];
        $where['orderby']    =    array('pay_time,desc');
        $rows    =    $CompanyOrderM->getPayList($where);
        $this->yunset("rows",$rows);
                
        $statis    =    $StatisM->getInfo($this->uid,array('usertype'=>4));
        $this->yunset("statis",$statis);
        
        $this->train_tpl('changelist');
    }
}
?>