eyoucms balance payment record

Keywords: PHP

Application scenario: in the current version, the user's order with balance payment will not be displayed in the personal recharge record. The individual wants the user to know the balance consumption record clearly, so the following improvements are made:

1. Add variable:
Find pay_cause_type_arr increase in application/extra/global.php

'pay_cause_type_arr' => array(
        0   => 'Upgrade consumption',
        1   => 'Account recharge',
        2   => 'Product consumption',
        // 3 = > 'add later',
    ),

2. Method in controller:
Balance payment found in application/user/controller/Pay.php

Add in if (! Empty ($users ﹐ ID)) {

 // Add data to order table
                        $pay_cause_type_arr = Config::get('global.pay_cause_type_arr');
                        $time = getTime();
                        $cause_type = 2;
                        $order_number = date('Ymd') . $time . rand(10,100); //Order generation rules
                        $data = [
                            'users_id'      => $this->users_id,
                            'money'         => $Data['order_amount'],
                            'users_money'   => '',
                            'cause'         => $pay_cause_type_arr[$cause_type],
                            'cause_type'    => $cause_type,
                            'status'        => 2,
                            'pay_details'   => '',
                            'order_number'  => $order_number,
                            'lang'          => $this->home_lang,
                            'add_time'      => $time,
                            'update_time'   => $time,
                        ];
                        $this->users_money_db->add($data);

3. Finally, change the negative value in the template list
Change judgment to consumption value in pay ﹣ consumer ﹣ details.htm

Posted by lpxxfaintxx on Sun, 26 Apr 2020 09:22:17 -0700