初始化
This commit is contained in:
42
addons/webman/model/ActivityContent.php
Normal file
42
addons/webman/model/ActivityContent.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class ActivityContent
|
||||
* @property int id 主键
|
||||
* @property string name 活动名称
|
||||
* @property int activity_id 活动id
|
||||
* @property string lang 语言标识
|
||||
* @property string link 链接
|
||||
* @property string picture 活动主图
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Activity activity 活动
|
||||
* @property ActivityContent activity_content 活动内容
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ActivityContent extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
//数据权限字段
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.activity_content_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function activity(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.activity_model'), 'activity_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user