You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
595 B
PHTML
30 lines
595 B
PHTML
|
2 months ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
use App\Utils\Tools;
|
||
|
|
|
||
|
|
class Payback extends Model
|
||
|
|
{
|
||
|
|
protected $connection = "default";
|
||
|
|
protected $table = 'payback';
|
||
|
|
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
$user = User::where("id", $this->attributes['userid'])->first();
|
||
|
|
if ($user == null) {
|
||
|
|
return null;
|
||
|
|
} else {
|
||
|
|
return $user;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getRefTime()
|
||
|
|
{
|
||
|
|
if ($this->attributes['datetime'] == 0) {
|
||
|
|
return "从未使用喵";
|
||
|
|
}
|
||
|
|
return Tools::toDateTime($this->attributes['datetime']);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|