Ken 1 هفته پیش
والد
کامیت
6f48b35220
5فایلهای تغییر یافته به همراه8 افزوده شده و 116 حذف شده
  1. 2 24
      app/Models/PaymentOrder.php
  2. 2 26
      app/Models/Permission.php
  3. 1 26
      app/Models/PermissionUser.php
  4. 1 13
      app/Models/Prediction.php
  5. 2 27
      app/Models/Rebate.php

+ 2 - 24
app/Models/PaymentOrder.php

@@ -2,21 +2,10 @@
 
 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 PaymentOrder extends Authenticatable
+class PaymentOrder extends BaseModel
 {
-    use HasApiTokens, Notifiable;
+
     protected $table = 'payment_orders';
-    // protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['type', 'order_no', 'member_id', 'amount', 'channel', 'bank_name', 'account', 'card_no', 'status', 'callback_url', 'callback_data', 'remark', 'pay_no', 'pay_url', 'pay_data', 'fee'];
 
 
@@ -24,15 +13,4 @@ class PaymentOrder extends Authenticatable
     {
         return $this->belongsTo(User::class, 'member_id', 'member_id')->select(['member_id','username','first_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');
-    }
 }

+ 2 - 26
app/Models/Permission.php

@@ -1,32 +1,8 @@
 <?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 Permission extends Authenticatable
+class Permission extends BaseModel
 {
-    use HasApiTokens, Notifiable;
     protected $table = 'menus';
-    protected $hidden = ['created_at', 'updated_at'];
-    protected $fillable = ['name', 'display_name', 'description' ];
-
-    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 = ['name', 'display_name', 'description'];
 }

+ 1 - 26
app/Models/PermissionUser.php

@@ -1,33 +1,8 @@
 <?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 PermissionUser extends Authenticatable
+class PermissionUser extends BaseModel
 {
-    use HasApiTokens, Notifiable;
     protected $table = 'menus';
-    protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['permission_id', 'role_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');
-    // }
 }

+ 1 - 13
app/Models/Prediction.php

@@ -2,21 +2,9 @@
 
 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 Prediction extends Authenticatable
+class Prediction extends BaseModel
 {
-    use HasApiTokens, Notifiable;
     protected $table = 'prediction';
-    protected $hidden = ['created_at'];
     protected $fillable = ['issue_no', 'size', 'odd_or_even', 'is_valid', 'winning_numbers'];
 
 

+ 2 - 27
app/Models/Rebate.php

@@ -1,24 +1,12 @@
 <?php
 
-
 namespace App\Models;
 
-use Carbon\Carbon;
-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 Rebate extends Authenticatable
+class Rebate extends BaseModel
 {
-    use HasApiTokens, Notifiable;
+
 
     protected $table = 'rebates';
-    // protected $hidden = ['created_at', 'updated_at'];
     protected $fillable = ['date', 'member_id', 'betting_amount', 'rebate_ratio',
         'amount', 'status', 'first_name', 'username', 'audited_by',
         'profit', 'huishui_percentage', 'huishui_restriction', 'huishui_amount',
@@ -83,17 +71,4 @@ class Rebate extends Authenticatable
         }
         return $value;
     }
-
-
-    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');
-    }
-
-
 }