Changeset 768
- Timestamp:
- Feb 26, 2015 11:47:44 AM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r744 r768 435 435 } 436 436 437 public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime ) {437 public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime, $mtbody = null, $responseTime = null) { 438 438 if (preg_match ( '/^(84)([0-9]{9,10})$/', $sentNumber, $aryMatch ) == 1) { 439 439 $sentNumber = '0' . $aryMatch [2]; … … 452 452 $smslog ['info'] = $info; 453 453 $smslog ['created_time'] = $receiveTime; 454 $this->db->query ( 'UNLOCK TABLES' ); 455 $sql = 'INSERT INTO tblsmslog(sender, us_id, service_id, commandcode, info, created_time) VALUES(?,?,?,?,?,?)'; 454 $smslog ['mtbody'] = $mtbody; 455 $smslog ['response_time'] = $responseTime; 456 457 $this->db->query ( 'UNLOCK TABLES' ); 458 $sql = 'INSERT INTO tblsmslog(sender, us_id, service_id, commandcode, info, created_time, mtbody, response_time) VALUES(?,?,?,?,?,?,?,?)'; 456 459 $query = $this->db->query($sql, $smslog); 457 460 } -
pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php
r758 r768 80 80 $CI->load->model ( 'Services_model' ); 81 81 $CI->load->model ( 'frontend/User_model', 'objUserModel' ); 82 $result = $CI->Services_model->processMORequest ( $userID, $info );83 error_log ( date ( 'Y-m-d H:i:s' ) . ' -- INFO VAR: ' . var_export ( $info, TRUE ) . "\n\n", 3, '/srv/www/sbg/log/sms.log' );84 $CI->objUserModel->insertSmslog ( $receiverID, $serviceID, $commandCode, $info, $receiveTime );85 82 83 $mtBody = ''; 84 $result = $CI->Services_model->processMORequest ( $userID, $info , $mtBody); 85 $responseTime = date ( 'Y-m-d H:i:s' ); 86 error_log ( $responseTime . ' -- INFO VAR: ' . var_export ( $info, TRUE ) . "\n\n", 3, '/srv/www/sbg/log/sms.log' ); 86 87 $aryResult = explode ( '|', $result ); 88 89 $CI->objUserModel->insertSmslog ( $receiverID, $serviceID, $commandCode, $info, $receiveTime , $mtBody, $responseTime); 90 87 91 return $aryResult [0] . '|' . $msgType . '|' . $aryResult [1]; 88 92 } -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r721 r768 101 101 * @return string 102 102 */ 103 public function processMORequest ($sentNumber, $message )103 public function processMORequest ($sentNumber, $message, &$mtBody = null) 104 104 { 105 105 $debugMsg = $message."\n"; … … 133 133 $smsReturn = $collaboratorMsg; 134 134 $arySMS = explode ('|', $sms); 135 if ((int)$arySMS[0] == 1 ) 136 $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $arySMS[1]); 135 if ((int)$arySMS[0] == 1 ) { 136 $mtBody = $arySMS[1]; 137 $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $mtBody); 138 } 139 137 140 } 138 141 else { … … 141 144 142 145 break; 143 case _SBG_MO_PHONENUM_CHANGE:146 /* case _SBG_MO_PHONENUM_CHANGE: 144 147 if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[0])) { 145 148 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'); … … 157 160 $sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG')); 158 161 $sendMT = $changeResult == 1 ? $this->sendMT($this->formatPhoneNumber($oldPhoneNumber, -1), $sms) : ''; 159 break; 162 break; */ 160 163 case _SBG_MO_PASSWORD_RECOVERY: 161 164 $smsReturn = $this->objUserModel->changePassword($sentNumber); … … 170 173 171 174 if (trim($arySmsReturn[1]) == trim(lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG'))) { 172 175 $maxCharging = 50000; 173 176 $amount = $packageData ['p_price']; 174 177 $count = $amount > $maxCharging ? ceil($amount/ _SBG_CHARGING_MAX_VALUE) : 1; … … 216 219 $aryPatterns = array('/:amount:/', '/:sentNumber:/'); 217 220 $smsMT = preg_replace($aryPatterns, array($amount, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG')); 221 $mtBody = $smsMT; 218 222 $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT); 219 223 $smsReturn = $arySmsReturn[0].'|'.preg_replace(array('/:amount:/','/:username:/'), array($amount, $userName), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG')); … … 252 256 break; 253 257 } 258 259 $mtBody = $smsReturn . "\n" . $mtBody; 254 260 255 261 return $smsReturn.'|'.$case;
Note: See TracChangeset
for help on using the changeset viewer.