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
<?php
 
 
 
class pay_controller extends company
{
 
    /**
     * 财务管理 - 积分重置
     */
    function index_action()
    {
 
        $this->public_action();
        $statis     =   $this->company_satic();
 
        $comorderM  =   $this->MODEL('companyorder');
        $nopayorder =   $comorderM->getCompanyOrderNum(array('uid' => $this->uid, 'usertype' => $this->usertype, 'order_state' => '1'));
 
        $this->yunset("statis", $statis);
        $this->yunset('nopayorder', $nopayorder);
        $arr        =   $this->MODEL('cache')->GetCache(array('integralclass'));
 
        $fkey       =   0;
        $class_price=   array();
        foreach ($arr['integralclass_index'] as $k => $v) {
            $arr['integralclass_index'][$k]['val']  =   (int)$v;
            $discount               =   100;
            if ($arr['integralclass_discount'][$v] > 0) {
                $discount           =   $arr['integralclass_discount'][$v];
            }
            $class_price[$v]        =   round($arr['integralclass_name'][$v] / $this->config['integral_proportion'] * $discount / 100, 2);
            $num    =   (int)$arr['integralclass_name'][$v];
            if ($num >= $this->config['integral_min_recharge']) {
                if ($fkey == 0) {
                    $fkey   =   $k + 1;
                }
            }
        }
        if ($fkey != 0) {
 
            $arr['first']           =   $arr['integralclass_index'][$fkey - 1];
            $arr['firstprice']      =   $class_price[$arr['integralclass_index'][$fkey - 1]];
            $arr['firstjf']         =   $arr['integralclass_name'][$arr['integralclass_index'][$fkey - 1]];
        }
        $this->yunset($arr);
        $this->com_tpl('pay');
    }
    /**
     * @desc 生成订单
     */
    function dingdan_action()
    {
        $data['price']          =   $_POST['price'];
        $data['comvip']         =   $_POST['comvip'];
        $data['comservice']     =   $_POST['comservice'];
        $data['price_int']      =   $_POST['price_int'];
        $data['integralid']     =   $_POST['integralid'];
        $data['dkjf']           =   $_POST['dkjf'];
        $data['order_remark']   =   $_POST['remark'];
        $data['uid']            =   $this->uid;
        $data['usertype']       =   $this->usertype;
        $data['did']            =   $this->userdid;
 
        if ($this->comInfo['crm_uid']){
            $data['crm_uid']    =   $this->comInfo['crm_uid'];
        }
 
        $orderM =   $this->MODEL('companyorder');
        $return =   $orderM->addComOrder($data);
        $this->ACT_layer_msg($return['msg'], $return['errcode'], $return['url']);
    }
    /**
     * 积分抵扣全额支付
     */
    function dkzf_action()
    {
 
        $data['uid']        =    $this    ->    uid;
        $data['username']    =    $this    ->    username;
        $data['usertype']    =    $this    ->    usertype;
 
        if($_POST['tcid']){
            $data['tcid']    =    $_POST['tcid'];
        }
        if($_POST['id']){
            $data['id']        =    $_POST['id'];
        }
        $data['server']     =   $_POST['server'];
        
        $jfdkM   =    $this -> MODEL('jfdk');
        $return  =    $jfdkM -> dkBuy($data);
 
        echo json_encode($return);
    }
}
?>