<?php
/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */

if(!defined('__CORE_DIR')){
    exit("Access Denied");
}

class Mdl_Xiche_Order_log extends Mdl_Table
{   
    
    protected $_table = 'xiche_order_log';
    protected $_pk = 'log_id';
    protected $_cols = 'log_id,order_id,log,dateline';
    

    public function create($data)
    {

        if(!$order_id = $data['order_id']){
            return false;
        }else if(!$log = $data['log']){
            return false;
        }
        
        
        $a = array('order_id'=>$order_id, 'log'=>$log,'dateline'=>time());    

    	if(!$o = $this->insert($a, true)){

    		return false;
    	}
        
        return $o;
    }
    
    
    
    public function insert($data)
    {

        if($uid = $this->db->insert($this->_table, $data, true)){
            return $uid;
        }
        
    }
}