<?php
namespace app\admin\model;

use think\Model;

/**
 * 工单模型
 */
class ServiceLog extends Model
{


    /**
     * 数据统计
     *
     * @access public
     * @param mixed $where 条件
     * @return array 返回类型
     */
    public function countServiceLog($where=[])
    {
        $result = $this->where($where)->count();

        return $result;

    }//end countServiceLog()


    /**
     * 数据查询
     *
     * @access public
     * @param mixed $join 关联表
     * @param mixed $where 条件
     * @return array 返回类型
     */
    public function selectServiceLog($field, $join, $where=[])
    {
        $result = $this->field($field);
        if (empty($join) === false) {
            $result = $result->alias('a');
            foreach ($join as $k => $v) {
                $result = $result->join($k, $v);
            }
        }

        $result = $result->where($where)->select();

        return $result;

    }//end selectServiceLog()


}
