Changeset 768


Ignore:
Timestamp:
Feb 26, 2015 11:47:44 AM (10 years ago)
Author:
dungnv
Message:
 
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  
    435435        }
    436436       
    437         public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime) {
     437        public function insertSmslog($sentNumber, $serviceID, $commandcode, $info, $receiveTime, $mtbody = null, $responseTime = null) {
    438438                if (preg_match ( '/^(84)([0-9]{9,10})$/', $sentNumber, $aryMatch ) == 1) {
    439439                        $sentNumber = '0' . $aryMatch [2];
     
    452452                $smslog ['info'] = $info;
    453453                $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(?,?,?,?,?,?,?,?)';
    456459                $query = $this->db->query($sql, $smslog);
    457460        }
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php

    r758 r768  
    8080                        $CI->load->model ( 'Services_model' );
    8181                        $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 );
    8582                       
     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' );
    8687                        $aryResult = explode ( '|', $result );
     88
     89                        $CI->objUserModel->insertSmslog ( $receiverID, $serviceID, $commandCode, $info, $receiveTime , $mtBody, $responseTime);
     90                       
    8791                        return $aryResult [0] . '|' . $msgType . '|' . $aryResult [1];
    8892                }
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r721 r768  
    101101         * @return string
    102102         */
    103         public function processMORequest ($sentNumber, $message)
     103        public function processMORequest ($sentNumber, $message, &$mtBody = null)
    104104        {
    105105                $debugMsg = $message."\n";
     
    133133                                        $smsReturn = $collaboratorMsg;
    134134                                        $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                                                                               
    137140                                }
    138141                                else {
     
    141144
    142145                                break;
    143                         case _SBG_MO_PHONENUM_CHANGE:
     146                        /* case _SBG_MO_PHONENUM_CHANGE:
    144147                                if (!preg_match('/^(09\d{8}|01\d{9})$/', $aryContents[0])) {
    145148                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
     
    157160                                $sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'));
    158161                                $sendMT = $changeResult == 1 ? $this->sendMT($this->formatPhoneNumber($oldPhoneNumber, -1), $sms) : '';
    159                                 break;
     162                                break; */
    160163                        case _SBG_MO_PASSWORD_RECOVERY:
    161164                                $smsReturn = $this->objUserModel->changePassword($sentNumber);
     
    170173
    171174                                if (trim($arySmsReturn[1]) == trim(lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG'))) {
    172                                        
     175                                        $maxCharging = 50000;
    173176                                        $amount = $packageData ['p_price'];
    174177                                        $count = $amount > $maxCharging ? ceil($amount/ _SBG_CHARGING_MAX_VALUE) : 1;
     
    216219                                                $aryPatterns = array('/:amount:/', '/:sentNumber:/');
    217220                                                $smsMT = preg_replace($aryPatterns, array($amount, $sentNumber), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_MSG'));
     221                                                $mtBody = $smsMT;
    218222                                                $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $smsMT);
    219223                                                $smsReturn = $arySmsReturn[0].'|'.preg_replace(array('/:amount:/','/:username:/'), array($amount, $userName), lang('_SBG_MO_PAY_TO_ACCOUNT_FOR_OTHER_SUCCESS_MSG'));
     
    252256                                break;
    253257                }
     258               
     259                $mtBody = $smsReturn . "\n" . $mtBody;
    254260               
    255261                return $smsReturn.'|'.$case;
Note: See TracChangeset for help on using the changeset viewer.