<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2020/1/13
 * Time: 16:35
 */

namespace app\index\model;
use think\Model;

class checkinfomodel extends Model{
    protected $table='t_nowcheckinfo';

    public function getcheckworkerlistbydate($checkdate,$shift,$pid){
        $where_arr['checkdate']=$checkdate;
        $where_arr['checkorder']=$shift;
        $where_arr['pid']=$pid;
        $c_workerlist=$this->where($where_arr)->select();
        return $c_workerlist;
    }

    public function savechecklist($checklist){
        $list=$this->saveall($checklist);
        return count($list);
    }
    //根据用户id获取记录
    public function getusercheckinfobywid($wid){
        $where_arr['wid']=$wid;
        $list=$this->where($where_arr)->order('checkdate,checkorder')->select();
        return $list;
    }

    //20200203 日起停止使用
    //获取某人，某班次的评分数据
    public function getchecklistbyheader($header_id,$chheckdate,$checkshift){
        $where_arr['checkheadid']=$header_id;
        $where_arr['checkdate']=$chheckdate;
        $where_arr['checkorder']=$checkshift;
        $list=$this->where($where_arr)->select();
        return $list;
    }


}