|
|
@@ -15,17 +15,26 @@ use Carbon\Carbon;
|
|
|
* @property string $visitor_id
|
|
|
* @property string $phone 用户手机号
|
|
|
* @property string $admin_note
|
|
|
+ * @property $last_active_time 最后活跃时间
|
|
|
*/
|
|
|
class User extends BaseModel
|
|
|
{
|
|
|
protected $table = 'users';
|
|
|
- protected $fillable = ['usdt', 'is_banned', 'visitor_id', 'register_ip', 'status', 'admin_note', 'member_id', 'first_name', 'game_id', 'username', 'secret_key', 'secret_pass', 'language'];
|
|
|
+ protected $fillable = ['usdt', 'is_banned', 'last_active_time', 'visitor_id', 'register_ip', 'status', 'admin_note', 'member_id', 'first_name', 'game_id', 'username', 'secret_key', 'secret_pass', 'language'];
|
|
|
protected $attributes = [
|
|
|
'language' => 'zh',
|
|
|
];
|
|
|
protected $hidden = ['updated_at'];
|
|
|
|
|
|
|
|
|
+ function getLastActiveTimeAttribute($value): string
|
|
|
+ {
|
|
|
+ if ($value > 0) {
|
|
|
+ return date('Y-m-d H:i', strtotime($value));
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
function getCreatedAtAttribute($value): string
|
|
|
{
|
|
|
return Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d');
|