Changeset 707 for pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php
- Timestamp:
- Jan 27, 2015 10:53:31 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/services/controllers/recharge.php
r698 r707 15 15 public function recharge_card() 16 16 { 17 $trackingFile = '/srv/www/sbg/log/recharge_card.log'; 18 error_log ('--START CARD CHARGE--'."\n", 3, $trackingFile); 19 error_log ('TIME: '.date('Y-m-d H:i:s')."\n", 3, $trackingFile); 20 17 21 $userID = $this->uri->segment(4); 18 22 $input = $this->input->post(); … … 21 25 $isLocked = 0; 22 26 27 error_log ('$cardSerial: '.$cardSerial."\n", 3, $trackingFile); 28 error_log ('$cardSerial: '.$pinCard."\n", 3, $trackingFile); 29 error_log ('$userID: '.$userID."\n", 3, $trackingFile); 30 23 31 $user = $this->objUserModel->get_user_by_id($userID); 24 32 $lockFilePreFix = $user['cellphone']; … … 26 34 $maxReach = $this->config->item('topup_lock_max_reach'); 27 35 $timeToUnlock = $this->config->item('topup_unlock_minute'); 36 37 error_log ('Phone num: '.$user['cellphone']."\n", 3, $trackingFile); 38 error_log ('Locked: '.($isLocked ? 'LOCKED':'UNLOCKED')."\n", 3, $trackingFile); 28 39 29 40 $isLocked = createLockFile($lockFilePreFix, $maxReach, $timeToUnlock, $lockFilePath, TRUE); … … 56 67 $chargCard = $this->services_model->cardPaidProcess($aryParams, $aryResult); 57 68 $status = $chargCard; 69 70 error_log ('CALL TOPUP SERVICE: '.($status ? 'SUCCESS':'NOT SUCCESS')."\n", 3, $trackingFile); 71 error_log ('CALL TOPUP SERVICE DATA: '.var_export($aryResult, TRUE)."\n", 3, $trackingFile); 58 72 59 73 $paidType = 2; … … 66 80 $updateData = array('acc_balanced' => $user['acc_balanced'], 'updated_time' => $user['updated_time'] ); 67 81 $updated = $this->objUserModel->updateUser($userID, $updateData); 82 error_log ('UPDATE ACCOUNT SUCCESS: '.($updated ? 'SUCCESS':'NOT SUCCESS')."\n", 3, $trackingFile); 68 83 } 69 84 … … 76 91 $aryPatterns = array('/:amount:/', '/:username:/', '/:acc_balanced:/'); 77 92 $result['message'] = preg_replace($aryPatterns, array($amount, $user['cellphone'], $user['acc_balanced']), lang('_SBG_CHARGING_FROM_CARD_SUCCESS_MSG')); 78 $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime); 93 $paidResult = $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime); 94 error_log ('INSERT PAID LOG: '.var_export($paidResult, TRUE)."\n", 3, $trackingFile); 79 95 releaseLockFile($lockFilePreFix, $lockFilePath); 80 96 } … … 89 105 } 90 106 91 $this->objUserModel->insertCardlog($user['cellphone'],$userID, $status, $pinCard, $cardSerial, $cardValue, $updatedTime); 92 107 $cardLogResult = $this->objUserModel->insertCardlog($user['cellphone'],$userID, $status, $pinCard, $cardSerial, $cardValue, $updatedTime); 108 error_log ('INSERT CARD LOG: '.var_export($cardLogResult, TRUE)."\n", 3, $trackingFile); 109 93 110 $result['us_id'] = $userID; 94 111 $result['UPDATED_DATA'] = $user; 95 112 $result['errMsg'] = $errMsg; 96 113 echo json_encode($result); 114 error_log ('RETURN JSON: '.json_encode($result)."\n", 3, $trackingFile); 115 error_log ('--FINISH CARD CHARGE--'."\n", 3, $trackingFile); 97 116 } 98 117 }
Note: See TracChangeset
for help on using the changeset viewer.