love_php/app/Models/CoinLog.php
2026-04-02 09:20:51 +08:00

54 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use App\Models\Live\Anchor;
use Illuminate\Database\Eloquent\Model;
class CoinLog extends Model
{
protected $fillable = [];
protected $guarded = [];
public const RECSYSTEM = 'RECSYSTEM';//系统赠送
public const RECROSE = "RECROSE";//限时玫瑰赠予
public const PROFILEREMARK = '完善基本资料';//基本资料完善
public const PROFILEPHOTOREMARK = "完善个人相册";//完善个人相册
public const INTROREMARK = "完善个人简介";
public const INTERESTREMARK = "完善兴趣爱好";
public const IDEALREMARK = "完善择偶标准";
public const APPROVEREMARK = "完善认证信息";
public function user(){
return $this->belongsTo(User::class);
}
public function shareUser()
{
return $this->hasOne(User::class, 'id', 'type_id');
}
public function anchor()
{
return $this->hasOne(Anchor::class, 'id', 'type_id');
}
public function scopeShareLogs($query)
{
return $query->where('type', self::RECSYSTEM)->where('remark', '分享用户');
}
public function scopeProfileLog($query, $remark)
{
return $query->where('type', self::RECSYSTEM)->where('remark', $remark);
}
public function scopeprofilePhotoLog($query)
{
return $query->where('type', self::RECSYSTEM)->where('remark', self::PROFILEPHOTOREMARK);
}
public function scopeApproveLog($query)
{
return $query->where('type', self::RECSYSTEM)->where('remark', self::APPROVEREMARK);
}
}