Files
fast_response/superadmin/application/admin/model/Aicustomerservicefirmstorelist.php
2025-04-11 15:37:22 +08:00

59 lines
1.1 KiB
PHP

<?php
namespace app\admin\model;
use think\Model;
class Aicustomerservicefirmstorelist extends Model
{
// 表名
protected $name = 'aicustomerservicefirmstorelist';
// 自动写入时间戳字段
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 aicustomerservice()
{
return $this->belongsTo('Aicustomerservice', 'aicustomerservice_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function firm()
{
return $this->belongsTo('Firm', 'firm_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}