<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 17-11-10
 * Time: 上午10:54
 * To change this template use File | Settings | File Templates.
 */
class Service_Charge
{
    /**
     * @var null
     */
    public static $_modelClass = null;

    public static function getModelInstance(){
        if (is_null(self::$_modelClass)){
            self::$_modelClass = new Table_Charge();
        }
        return self::$_modelClass;
    }

    public static function add($row){
        $model = self::getModelInstance();
        return $model->add($row);
    }

    public static function update($row, $value, $field = "charge_id"){
        $model = self::getModelInstance();
        return $model->update($row, $value, $field);
    }

    public static function delete($value, $field = "charge_id"){
        $model = self::getModelInstance();
        return $model->delete($value, $field);
    }

    public static function getByField($value, $field = 'charge_id', $colums = "*"){
        $model = self::getModelInstance();
        return $model->getByField($value,$field,$colums);
    }

    public static function getByCondition($condition = array(), $type = '*', $pageSize = 0, $page = 1, $order = ""){
        $model = self::getModelInstance();
        return $model->getByCondition($condition, $type, $pageSize, $page, $order);
    }

}
