<?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,end_money';
    protected $_orderby = array('tixian_id'=>'DESC');

    public function sum($field,$where){
        $sql = "select sum(".$field.") as total FROM ".$this->table($this->_table)." WHERE " . $where;
        $ret = $this->db->Execute($sql);  
        $res = $ret->fetch();
        return $res['total'];
    }
    
}