<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2020/1/27
 * Time: 14:13
 */
namespace app\index\model;
use think\Model;

class pinfomodel extends Model{
    protected $table='t_pinfo';

    function getallpinfo(){
        $plist=$this->where('is_worker=1')->select();
        //$plist=collection($plist)->toArray();
        return $plist;
    }

    function sellistbycid($companyid){
        $where_arr['companyid']=$companyid;
        $where_arr['is_worker']=1;
        $plist=$this->where($where_arr)->order('id','asc')->select();
        //$plist=collection($plist)->toArray();
        return $plist;
    }

    public function saveprjinfo($prj){
        $id=$this->save($prj);
        return $id;
    }

    public function getbyid($id){
        $where_arr['id']=$id;
        $pinfo=$this->where($where_arr)->find();

        return $pinfo;
    }


}