<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2021/5/6
 * Time: 20:34
 */
namespace app\index\model;
use think\Model;
class uplogmodel extends Model{
    protected $table='t_uplog';

    /*
     * 20210506
     * 插入记录
     */
    public function insinfo($arr){
        $this->allowField(true)->isUpdate(false)->setAttr('id',null)->save($arr);
        return $this->id;
    }

    /*
     * 20210506
     */
    public function selinfobyfname($fname){
        $where_arr['upfilename']=$fname;
        $rinfo=$this->where($where_arr)->find();
        return $rinfo;

    }

    /*
     * 20210509
     * 获取所有的导入记录
     */
    public function selalllist(){
        $rlist=$this->order('id','desc')->select();
        $rlist=collection($rlist)->toArray();
        return $rlist;
    }


    /*
     * 20230214
     *
     */
    public function sellistbycid($cid){
        $where_arr['companyid']=$cid;
        $rlist=$this->where($where_arr)->order('id','desc')->select();
        $rlist=collection($rlist)->toArray();
        return $rlist;
    }


}