Files
park/application/admin/model/yq/perimeter/EnterpriseCheck.php
MeSHard b22d09bd39 init
2025-12-01 11:19:23 +08:00

62 lines
1.1 KiB
PHP

<?php
namespace app\admin\model\yq\perimeter;
use app\admin\model\yq\base_config\Perimeter;
use app\admin\model\yq\electronic_waybill\Waybill;
use think\Model;
class EnterpriseCheck extends Model
{
// 表名
protected $name = 'check_record';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['1' => __('Status 1')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ?: ($data['status'] ?? '');
$list = $this->getStatusList();
return $list[$value] ?? '';
}
public function perimeter()
{
return $this->belongsTo(Perimeter::class, 'check_uid', 'id')->setEagerlyType(1);
}
public function waybill()
{
return $this->belongsTo(Waybill::class, 'waybill_id', 'id')->setEagerlyType(1);
}
}