Riverlist.php 1.7 KB
<?php

namespace app\admin\model\river;

use think\Model;


class Riverlist extends Model
{


    // 表名
    protected $name = 'river_list';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];


    public function rivercat()
    {
        return $this->belongsTo('app\admin\model\river\RiverCat', 'cat_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function reservoirprovince()
    {
        return $this->belongsTo('app\admin\model\reservoir\Province', 'province_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function reservoirstate()
    {
        return $this->belongsTo('app\admin\model\reservoir\State', 'state_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function reservoircounty()
    {
        return $this->belongsTo('app\admin\model\reservoir\County', 'county_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function reservoirstreet()
    {
        return $this->belongsTo('app\admin\model\reservoir\Street', 'street_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function reservoirvillage()
    {
        return $this->belongsTo('app\admin\model\reservoir\Village', 'village_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function inspectiondepart()
    {
        return $this->belongsTo('app\admin\model\inspection\Depart', 'depart_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function inspectionstaff()
    {
        return $this->belongsTo('app\admin\model\inspection\Staff', 'user_id', 'user_id', [], 'LEFT')->setEagerlyType(0);
    }
}