示例#1
0
 private function user_charge()
 {
     global $_K;
     global $_lang;
     $uid = $this->_uid;
     $order_id = $this->_order_id;
     $order_id = keke_order_class::update_order_charge($this->_out_trade_no, $this->_total_fee);
     $order_info = db_factory::get_one(sprintf(" select order_status,order_type from %switkey_order_charge where order_id='%d' and uid='%d'", TABLEPRE, $order_id, $uid));
     if ($order_info['order_status'] == 'wait') {
         db_factory::execute(sprintf(" update %switkey_order_charge set order_status='ok' where order_id='%d'", TABLEPRE, $order_id));
         $res = keke_finance_class::cash_in($uid, $this->_total_fee, $order_info['order_type'], $this->_charge_type, 'user_charge', $order_id);
         $v_arr = array($_lang['recharge_account'] => $this->_total_fee);
         keke_shop_class::notify_user($this->_uid, $this->_username, "pay_success", $_lang['online_recharge_success'], $v_arr, 2);
     } else {
         $res = true;
     }
     if ($res) {
         return $this->struct_response($_lang['operate_notice'], $_lang['online_recharge_success'], $url, 'success');
     } else {
         return $this->struct_response($_lang['operate_notice'], $_lang['online_recharge_fail'], $url, 'warning');
     }
 }