chengkun
2025-05-22 1a8aea45ebb1582c9f65d9e8dcd520002f83ae12
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
<?php
 
 
 
class paylog_controller extends company
{
 
    function index_action(){
 
        include(CONFIG_PATH . "db.data.php");
        $this->yunset("arr_data", $arr_data);
        $this->public_action();
        $this->company_satic();
 
 
        $comorderM  =   $this->MODEL('companyorder');
        $allprice   =   $comorderM->getCompanyPaySumPrice(array('com_id' => $this->uid, 'usertype' => 2, 'type' => '1', 'order_price' => array('<', '0')));
        $this->yunset("integral", number_format(str_replace("-", "", $allprice)));
 
        $pageM        =    $this  -> MODEL('page');
 
        if($_GET['consume']=="ok"){
 
            $urlarr                =    array("c"=>"paylog","consume"=>"ok","page"=>"{{page}}");
            $pageurl            =    Url('member',$urlarr);
            $where['com_id']    =    $this->uid;
            $where['usertype']    =    $this->usertype;
            $where['orderby']    =    array('id,desc','pay_time,desc');
            $pages                =    $pageM -> pageList('company_pay',$where,$pageurl,$_GET['page'],$this->config['sy_listnum']);
            
            if($pages['total'] > 0){
                
                $where['limit']        =    $pages['limit'];
                $rows                =    $comorderM -> getPayList($where);
                $this->yunset("rows", $rows);
            }
 
            $this->yunset("ordertype", "ok");
        }else{
 
            $urlarr                =    array("c"=>"paylog","page"=>"{{page}}");
            $pageurl            =    Url('member',$urlarr);
            
            if ($_GET['order_state']){
                
                $where['order_state'] = (int)$_GET['order_state'];
            }
            $where['uid']        =    $this    ->    uid;
            $where['usertype']    =    $this    ->    usertype;
            $where['orderby']    =    array('order_time,desc','order_state,asc');
 
            $pages                =    $pageM -> pageList('company_order',$where,$pageurl,$_GET['page'],$this->config['sy_listnum']);
            
            if($pages['total'] > 0){
 
                $where['limit'] =   $pages['limit'];
                $rows           =   $comorderM->getList($where);
 
                $this->yunset("rows", $rows);
            }
        }
 
        if ($_POST['submit']) {
            if (trim($_POST['order_remark']) == "") {
 
                $this->ACT_layer_msg("备注不能为空!", 8, $_SERVER['HTTP_REFERER']);
            }
 
            $return =   $comorderM->upInfo((int)$_POST['id'], array('order_remark' => trim($_POST['order_remark'])), $this->uid);
            if ($return['errcode'] == 9) {
 
                $this->MODEL('log')->addMemberLog($this->uid, 2, "修改订单备注", 88, 2);//会员日志
            }
            $this->ACT_layer_msg($return['msg'], $return['errcode'], $_SERVER['HTTP_REFERER']);
        }
 
        $this->com_tpl('paylog');
    }
    
    
    function del_action(){
        
        if($this->usertype!='2' || $this->uid==''){
        
            echo '0';die;
        }else{
            
            $comorderM    =    $this    ->    MODEL('companyorder');
            
            $oid        =    $comorderM    ->    getList(array('uid'=>$this->uid,'id'=>(int)$_GET['id'],'order_state'=>'1'));
            
            if(empty($oid[0])){
                
                echo '0';die;
            }else{
                
                $comorderM    ->    del($oid[0]['id'],array('uid'=>$this -> uid));
                echo '1';die;
            }
        }
    }
    
    function card_action(){
        $_POST    =    $this    ->    post_trim($_POST);
        $whereData['card']        =    $_POST['card'];
        $whereData['password']    =    $_POST['password'];
 
        $data['uid']        =    $this->uid;
        $data['username']    =    $this->username;
        $data['userdid']    =    $this->userdid;
        $data['usertype']    =    2;
        
        $couponM    =    $this    ->    MODEL('coupon');
        $return        =    $couponM    ->    usePreCard($whereData,$data);
        $this        ->    ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER']);
    }
}
?>