engineering/app/common/model/custom/CustomFollow.php
2024-03-14 15:34:33 +08:00

34 lines
850 B
PHP

<?php
namespace app\common\model\custom;
use app\common\model\BaseModel;
use app\common\model\dict\DictData;
use think\model\concern\SoftDelete;
/**
* CustomFollow模型
* Class CustomFollow
* @package app\common\model\custom_follow
*/
class CustomFollow extends BaseModel
{
use SoftDelete;
protected $name = 'custom_follow';
protected $deleteTime = 'delete_time';
public function getDateAttr($value): string
{
return empty($value) ? '' : date('Y-m-d', $value);
}
public function getNextFollowDateAttr($value): string
{
return empty($value) ? '' : date('Y-m-d', $value);
}
public function getTypesTextAttr($value,$data){
$dictData = DictData::where('type_value','custom_follow_type')->column('name','value');
return !empty($data['types']) ? $dictData[$data['types']] : '';
}
}