1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Slowlyo\OwlAdmin\Models\BaseModel as Model;
- class Wallet extends Model
- {
- use SoftDeletes;
- protected $table = 'wallet';
- protected $fillable = [
- 'owner_type',
- ];
-
- public function transRecords()
- {
- return $this->hasMany(WalletTransRecord::class, 'wallet_id', 'id');
- }
-
- public function withdrawRecords()
- {
- return $this->hasMany(WalletWithdrawRecord::class, 'wallet_id', 'id');
- }
-
- public function member()
- {
- return $this->belongsTo(MemberUser::class, 'owner_id', 'id');
- }
-
- public function refundRecords()
- {
- return $this->hasMany(WalletRefundRecord::class, 'wallet_id', 'id');
- }
- }
|