Ken il y a 1 semaine
Parent
commit
59cf0d7574
2 fichiers modifiés avec 3 ajouts et 48 suppressions
  1. 1 24
      app/Models/Address.php
  2. 2 24
      app/Models/BalanceLog.php

+ 1 - 24
app/Models/Address.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 Address extends Authenticatable
+class Address extends BaseModel
 {
-    use HasApiTokens, Notifiable;
     protected $table = 'address';
-    protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['member_id', 'address', 'alias'];
-
-    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');
-    }
 }

+ 2 - 24
app/Models/BalanceLog.php

@@ -2,30 +2,8 @@
 
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Foundation\Auth\User as Authenticatable;
-use Illuminate\Notifications\Notifiable;
-use Laravel\Sanctum\HasApiTokens;
-
-/**
- * @mixin Builder
- * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
- */
-class BalanceLog extends Authenticatable
+class BalanceLog extends BaseModel
 {
-    use HasApiTokens, Notifiable;
-
     protected $table = 'balance_logs';
-    protected $hidden = ['created_at', 'updated_at'];
-    protected $fillable = ['room_id', 'member_id', 'amount', 'before_balance', 'after_balance', 'change_type', 'remark','related_id'];
-
-    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');
-    }
+    protected $fillable = ['room_id', 'member_id', 'amount', 'before_balance', 'after_balance', 'change_type', 'remark', 'related_id'];
 }