<?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_Staff_Tixian extends Mdl_Table
{   
  
    protected $_table = 'staff_tixian';
    protected $_pk = 'tixian_id';
    protected $_cols = 'tixian_id,staff_id,money,intro,account_info,status,reason,updatetime,clientip,dateline';

    public function logs($staff_id, $num=0, $intro='',$status = 0,$reason = '',$updateline = null)
    {
        $a = array();
        if(!$staff_id = (int)$staff_id){
            return false;
        }
        $a = array('staff_id'=>$staff_id, 'money'=>$num, 'intro'=>$intro,'status'=>$status,'reason'=>$reason);
        
        if($updateline){
            $a['updateline'] = __CFG::TIME;
        }
        
        $a['clientip'] = __IP;
        $a['dateline'] = __CFG::TIME;
        return $this->db->insert($this->_table, $a, true);
    }

}