Ken 1 settimana fa
parent
commit
8cec6b18a5
2 ha cambiato i file con 2 aggiunte e 42 eliminazioni
  1. 1 18
      app/Models/Config.php
  2. 1 24
      app/Models/Game.php

+ 1 - 18
app/Models/Config.php

@@ -2,16 +2,9 @@
 
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\Model;
-/**
- * @mixin Builder
- * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
- */
-class Config extends Model
+class Config extends BaseModel
 {
     protected $table = 'config';
-    protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['field', 'val', 'remark','group_id'];
     /*
      * group_id
@@ -21,14 +14,4 @@ class Config extends Model
      *
      *
      */
-
-    protected function getCreatedAtAttribute($value)
-    {
-        return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
-    }
-
-    protected function getUpdatedAtAttribute($value)
-    {
-        return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
-    }
 }

+ 1 - 24
app/Models/Game.php

@@ -1,32 +1,9 @@
 <?php
 
-
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Foundation\Auth\User as Authenticatable;
-use Illuminate\Notifications\Notifiable;
-use Laravel\Sanctum\HasApiTokens;
-
-/**
- * Admin
- * @mixin Builder
- * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
- */
-class Game extends Authenticatable
+class Game extends BaseModel
 {
-    use HasApiTokens, Notifiable;
     protected $table = 'games';
-    protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['game_name'];
-
-    protected function getCreatedAtAttribute($value)
-    {
-        return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
-    }
-
-    protected function getUpdatedAtAttribute($value)
-    {
-        return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
-    }
 }