新增统计,小游戏,系统设置
This commit is contained in:
32
app/admin/model/PromoReward.php
Normal file
32
app/admin/model/PromoReward.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
use think\model\relation\BelongsTo;
|
||||
|
||||
/**
|
||||
* PromoReward 模型
|
||||
*/
|
||||
class PromoReward extends model
|
||||
{
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $updateTime = false;
|
||||
|
||||
public static function onBeforeDelete(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getGameTypeTextAttr($value, $data)
|
||||
{
|
||||
$gameType = $data['game_type'] ?? 0;
|
||||
return UserScoreLog::GAME_TYPE_LIST[$gameType] ?? 'Unknown Game';
|
||||
}
|
||||
protected $append = ['game_type_text'];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user