<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2021/5/15
 * Time: 17:18
 */
namespace app\index\model;
use think\Model;
class prjlocationmodel extends Model{
    protected $table='t_prjlocation';

    /*
     * 20210515
     */
    public function sellist(){
        $rlist=$this->order('prjid')->select();
        $rlist=collection($rlist)->toArray();
        return $rlist;
    }

    /*
     * 20230302
     */
    public function insinfo($arr){
        $prjid=$arr['prjid'];
        $rec=$this->selinfobyprjid($prjid);
        if($rec){
            return 0;
        }else{
            $this->allowField(true)->save($arr);
            return $this->id;
        }
    }

    public function updatelocation($arr){
    //    $prjid=$arr['prjid'];
     //   $uplocation['']


    }

    /*
     * 20230302
     */
    public function selinfobyprjid($prjid){
        $where_arr['prjid']=$prjid;
        $rec=$this->where($where_arr)->find();
        return $rec;
    }

    /*
     *
     */
}
