- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
66 lines
1.1 KiB
PHP
66 lines
1.1 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\model\work;
|
|
|
|
|
|
use crmeb\basic\BaseModel;
|
|
use crmeb\traits\ModelTrait;
|
|
use think\model\relation\HasMany;
|
|
|
|
/**
|
|
* Class WorkWelcome
|
|
* @package app\model\work
|
|
*/
|
|
class WorkWelcome extends BaseModel
|
|
{
|
|
|
|
use ModelTrait;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $name = 'work_welcome';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $key = 'id';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $autoWriteTimestamp = 'int';
|
|
|
|
/**
|
|
* 成员
|
|
* @return HasMany
|
|
*/
|
|
public function userList(): HasMany
|
|
{
|
|
return $this->hasMany(WorkWelcomeRelation::class, 'welcome_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @param $value
|
|
* @return false|string
|
|
*/
|
|
public function setAttachmentsAttr($value)
|
|
{
|
|
return json_encode($value);
|
|
}
|
|
|
|
/**
|
|
* @param $value
|
|
* @return mixed
|
|
*/
|
|
public function getAttachmentsAttr($value)
|
|
{
|
|
return json_decode($value, true);
|
|
}
|
|
|
|
|
|
}
|