Ignore:
Timestamp:
Jan 15, 2015 12:08:25 PM (10 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r690 r695  
    100100                                $aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/');
    101101                                $trialdays = $this->config->item('trial_period');
    102                                 $sms = preg_replace($aryPatterns, array($trialdays, $username, $password), lang('_SBG_MO_USER_REGISTER_SUCCESS_MSG'));
     102                                $trialdays = strlen($trialdays) < 2 ? '0'. $trialdays : $trialdays;
     103                                $sms = preg_replace($aryPatterns, array($trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_REGISTER_SUCCESS_MSG'));
    103104                                $status = 1;
    104105                                $aryPatterns = array('/:collaborator:/');
     
    410411       
    411412        public function updateUser($us_id, $data) {
    412                 $this->db->query ( 'UNLOCK TABLES' );
     413                //$this->db->query ( 'UNLOCK TABLES' );
    413414                $this->db->where ( 'us_id', $us_id );
    414                 $this->db->update ( 'tbluser', $data );
     415                return $this->db->update ( 'tbluser', $data );
    415416        }
    416417       
     
    458459                $paidlog = array ();
    459460                $paidlog ['us_id'] = isset ( $user ['us_id'] ) ? $user ['us_id'] : NULL;
    460                 $paidlog ['paidType'] = $paidType;
     461                $paidlog ['paid_type'] = $paidType;
    461462                $paidlog ['amount'] = $amount;
    462463                $paidlog['source'] = "";
     
    464465                {
    465466                        $paidlog['source'] = $sentNumber;
    466                        
    467                 }else
     467                }
     468                elseif ($paidType == 2)
    468469                {
    469                         $paidlog['source'] = null;
    470                 }
    471                 $paidlog ['paidTime'] = $paidTime;
    472                 $this->db->query ( 'UNLOCK TABLES' );
     470                        $paidlog['source'] = 'Thẻ cào';
     471                }
     472                else
     473                {
     474                        $paidlog['source'] = '';
     475                }
     476                $paidlog ['paid_time'] = $paidTime;
    473477                $sql = 'INSERT INTO tblpaidlog(us_id, paid_type, amount, source, paid_time) VALUES (?,?,?,?,?)';
    474                 $query = $this->db->query ( $sql, $paidlog );
    475         }
    476        
    477         public function insertCardlog($username, $pinCode, $serialNum, $cardValue, $receiveTime)
     478
     479                return $this->db->query ( $sql, $paidlog );
     480        }
     481       
     482        public function insertCardlog($username, $us_id, $status, $pinCode, $serialNum, $cardValue, $receiveTime)
    478483        {
    479484                try {
     
    484489                $cardlog = array();
    485490                $cardlog['sender'] = $username;
    486                 $cardlog['us_id'] = isset ( $user ['us_id'] ) ? $user ['us_id'] : NULL;
     491                $cardlog['us_id'] = $us_id;
     492                $cardlog['status'] = $status;
    487493                $cardlog['pin_code'] = $pinCode;
    488494                $cardlog['serial_num'] = $serialNum;
Note: See TracChangeset for help on using the changeset viewer.