初始化
This commit is contained in:
48
addons/webman/model/PlayerBankruptcyRecord.php
Normal file
48
addons/webman/model/PlayerBankruptcyRecord.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerBankruptcyRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 渠道id
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerBankruptcyRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_bankruptcy_record_table'));
|
||||
} // 減少
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user