<?php
namespace app\api\model;
use think\Model;

/**
 * Created by PhpStorm
 * Author: ihavoc
 * Date: 2020/11/22
 * Time: 16:24
 *
 */
class Jcdw extends model{

    protected $table = 't_jcdw';
    //主键定义为rybh：人员编号
    protected $pk = 'id';


    public function getInfoByLoginName($login_name)
    {
        if (empty($login_name)) {
            return false;
        }
        return $this->where('login_name','=', $login_name)->find();
    }


    public function getInfoById($id)
    {
        if (empty($id)) {
            return false;
        }
        return $this->where('id', '=', $id)->find();
    }

    public function getInfoList($where='',$pageNum=1,$pageSize=10)
    {
        return $this->where($where)->page($pageNum,$pageSize)->select();
    }

    public function getInfoListCount($where='')
    {
        return $this->where($where)->select()->count();
    }

}