init
This commit is contained in:
62
application/admin/model/yq/base_config/Perimeter.php
Normal file
62
application/admin/model/yq/base_config/Perimeter.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\yq\base_config;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Perimeter extends Model
|
||||
{
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'perimeter';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
//禁停
|
||||
public function getStopList()
|
||||
{
|
||||
return ['0' => __('不做计算'), '1' => __('区域禁停'), '2' => __('区域可停')];
|
||||
}
|
||||
|
||||
//禁行
|
||||
public function getBanList()
|
||||
{
|
||||
return ['0' => __('不做计算'), '1' => __('区域禁行'), '2' => __('区域可行')];
|
||||
}
|
||||
|
||||
//危险源
|
||||
public function getHazardList()
|
||||
{
|
||||
return ['0' => __('不做计算'), '1' => __('是'), '2' => __('不是')];
|
||||
}
|
||||
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo('Perimeter', 'pid', 'id');
|
||||
}
|
||||
|
||||
public function typeo()
|
||||
{
|
||||
return $this->belongsTo('PerimeterType', 'region_lv', 'id')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function typet()
|
||||
{
|
||||
return $this->belongsTo('PerimeterType', 'region_type', 'id')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user