<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 18-9-6
 * Time: 下午4:17
 * To change this template use File | Settings | File Templates.
 */
class Service_OrderSendList extends Common_Service
{
    /**
     * @var null
     */
    public static $_modelClass = null;

    /**
     * @return Table_OrderAddressBook|null
     */
    public static function getModelInstance(){
        if (is_null(self::$_modelClass)){
            self::$_modelClass = new Table_OrderSendList();
        }
        return self::$_modelClass;
    }

    /**
     * @param $row
     * @return mixed
     */
    public static function add($row){
        $model = self::getModelInstance();
        return $model->add($row);
    }

    public static function update($row, $value, $field = "osl_id"){
        $model = self::getModelInstance();
        return $model->update($row, $value, $field);
    }

    public static function delete($value, $field = "osl_id"){
        $model = self::getModelInstance();
        return $model->delete($value, $field);
    }

    public static function getByField($value, $field = 'osl_id', $colums = "*"){
        $model = self::getModelInstance();
        return $model->getByField($value, $field , $colums);
    }

    /**
     * @return mixed
     */
    public static function getAll()
    {
        $model = self::getModelInstance();
        return $model->getAll();
    }

    /**
     * @param array $condition
     * @param string $type
     * @param int $pageSize
     * @param int $page
     * @param string $order
     * @return mixed
     */
    public static function getByCondition($condition = array(), $type = '*', $pageSize = 0, $page = 1, $order = "")
    {
        $model = self::getModelInstance();
        return $model->getByCondition($condition, $type, $pageSize, $page, $order);
    }

    /**
     * @param array $params
     * @return array
     */
    public  function getFields()
    {
        $row = array(

            'E0'=>'osl_id',
            'E1'=>'guid',
            'E2'=>'order_code',
            'E3'=>'send_type',
            'E4'=>'refercence_no',
            'E5'=>'send_status',
            'E6'=>'agent_code',
            'E7'=>'cop_no',
            'E8'=>'pre_no',
            'E9'=>'invt_no',
            'E10'=>'ebc_code',
            'E11'=>'ebp_code',
            'E12'=>'bill_no',
            'E13'=>'statistics_flag',
            'E14'=>'msg_seq_no',
            'E15'=>'return_status',
            'E16'=>'return_time',
            'E17'=>'return_info',
            'E18'=>'add_time',
            'E19'=>'last_send_time',
            'E20'=>'cmbl_xml_path',
            'E21'=>'cmbl_send_status',
        );
        return $row;
    }
}
