Files
fast_response/superadmin/application/admin/model/Firmcustomer.php
2025-03-27 14:45:54 +08:00

66 lines
1.3 KiB
PHP

<?php
namespace app\admin\model;
use think\Model;
class Firmcustomer extends Model
{
// 表名
protected $name = 'firmcustomer';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['yes' => __('Status yes'), 'no' => __('Status no')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function firmstoreprojectstwo()
{
return $this->belongsTo('Firmstoreprojectstwo', 'firmstoreprojectstwo_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function firmcustomerorigin()
{
return $this->belongsTo('Firmcustomerorigin', 'firmcustomerorigin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function firmemployee()
{
return $this->belongsTo('Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}