<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2020/3/9
 * Time: 11:28
 */

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

class gcmodel extends Model{
    protected $table='t_g2c';
    protected $resultSetType ='collection';

    public function insinfo($arr){
        $this->allowField(true)->save($arr);
        return $this->id;

    }
    /*
     * 20200309
     * 根据班组查合同
     */
    public function selcinfobygid($gid){
        $where_arr['gid']=$gid;
        $rec=$this->where($where_arr)->find();
        return $rec;
    }

    /*
     * 20200310
     * 按合同查询所有项目
     */

    public function selgidbycid($cid){
        $where_arr['cid']=$cid;
        $rlist=$this->where($where_arr)->select()->toArray();

        return $rlist;
    }
}