29 lines
785 B
PHP
29 lines
785 B
PHP
<?php
|
|
namespace app\common\model\custom;
|
|
|
|
use app\common\model\BaseModel;
|
|
use app\common\model\dict\DictData;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
|
|
/**
|
|
* Custom模型
|
|
* Class Custom
|
|
* @package app\common\model\custom
|
|
*/
|
|
class Custom extends BaseModel
|
|
{
|
|
use SoftDelete;
|
|
protected $name = 'custom';
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
public function getCustomTypeTextAttr($value,$data){
|
|
$dict = DictData::where('type_value','custom_type')->column('name','value');
|
|
return !empty($data['custom_type']) ? $dict[$data['custom_type']] : '';
|
|
}
|
|
|
|
public function getCreditRatingTextAttr($value,$data){
|
|
$dict = DictData::where('type_value','credit_rating')->column('name','value');
|
|
return !empty($data['credit_rating']) ? $dict[$data['credit_rating']] : '';
|
|
}
|
|
} |