0
0

更新代码

This commit is contained in:
2020-08-04 10:09:42 +08:00
parent 6118b5b63b
commit c2ac5d964e
478 changed files with 34410 additions and 0 deletions

33
app/Models/LotteryLog.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use App\User;
use RuLong\Order\Models\Order;
class LotteryLog extends Model
{
protected $dates = [
'used_at',
];
public function user()
{
return $this->belongsTo(User::class)->withDefault();
}
public function lottery()
{
return $this->belongsTo(Lottery::class)->withDefault();
}
public function gift()
{
return $this->belongsTo(LotteryGift::class)->withDefault();
}
public function getOrderAttribute()
{
return Order::where('item_id', $this->id)->where('type', 'lottery')->first();
}
}