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
<?php
 
class payment_controller extends company{
    function index_action(){
        $ConfigM =    $this->MODEL('config');
        $orderM    =    $this->MODEL('companyorder');
        $rows    =    $ConfigM->getBankList();
        $this    ->    yunset('rows',$rows);
        $order    =    $orderM    ->    getInfo(array('uid'=>$this->uid,'id'=>(int)$_GET['id']),array('bank'=>1));
        if(empty($order)){ 
 
            $this    ->    ACT_msg($_SERVER['HTTP_REFERER'],'订单不存在!'); 
        }elseif($order['order_state']!='1'){ 
 
            header('Location:index.php?c=paylog');
        }else{
            $this    ->    company_satic();
            $companyM        =    $this    ->    MODEL('company');
            $company        =    $companyM    ->    getInfo(array('uid'=>$this->uid),array('field'=>'`linkman`,`linktel`,`address`,`name`'));
            
            $order_remark    =    "我所汇款的银行:\n我汇入的帐号:\n汇款金额:\n汇款时间:\n其他:\n";
 
            if($company['linkman']==''||$company['linktel']==''||$company['address']==''){
                $company['link_null']    =    '1';
            }
 
            $couponM        =    $this    ->    MODEL('coupon');
            $coupons        =    $couponM->    getCouponList(array(
                'uid'            =>    $this->uid,
                'validity'        =>    array('>',time()),
                'coupon_scope'    =>    array('<=',$order['order_price']),
                'status'        =>    '1'
            ));
            
            $this    ->    yunset("coupons",$coupons);
            $this    ->    yunset("company",$company);
            $this    ->    yunset("order",$order);
            $this    ->    yunset("order_remark",$order_remark);
            $this    ->    public_action();
            $this    ->    com_tpl('payment');
        }
    }
     
    /**
     * 微信扫码支付
     */
    function wxurl_action()
    {
        $comorderM  =  $this->MODEL('companyorder');
        
        $data  =  array(
            'uid'      =>  $this->uid,
            'usertype' =>  $this->usertype,
            'orderId'  =>  (int)$_POST['orderId'],
            'coupon'   =>  $_POST['coupon']
        );
        $return  =  $comorderM->payComOrderByWXPC($data);
        
        echo $return['msg'];die;
    }
    /**
     * 银行转账
     */
    function paybank_action()
    {
        $comorderM    =    $this->MODEL('companyorder');
        
        $data['id']                =    $_POST['oid'];
        $data['coupon']            =    $_POST['coupon'];
        $data['file']            =    $_FILES['file'];
        $data['uid']            =    $this->uid;
        $data['usertype']        =    $this->usertype;
        $data['did']            =    $this->userdid;
        $data['bank_name']        =    $_POST['bank_name'];
        $data['bank_number']    =    $_POST['bank_number'];
        $data['bank_price']        =    $_POST['bank_price'];
        $data['bank_time']        =    $_POST['bank_time'];
        $data['order_remark']    =    $_POST['order_remark'];
        
        $return  =  $comorderM->payComOrderByBank($data);
        
        $this->ACT_layer_msg($return['msg'],$return['errcode'],$return['url']);
    }
}
?>