<?php

class train_tools_model extends CI_Model {
	private $order="";//订单号

    function __construct() {
        parent::__construct();
        $this->HT = $this->load->database('HT', TRUE);
		$this->INFO = $this->load->database('INFO', TRUE);
    }
	
	public function updateOrderInfo($table,$id,$key,$value){
		if($table == 'trainsystem'){
			$idKey = 'ts_id';
		}elseif($table == 'trainsystem_tickets'){
			$idKey = 'tst_id';
		}else{
			exit();
		}
		$sql = "
			update {$table} set {$key} = '{$value}' where {$idKey} = {$id}
		";
		$this->INFO->query($sql);
	}
	
}