123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Slowlyo\OwlAdmin\Models\BaseModel as Model;
- /**
- * 钱包交易记录
- */
- class WalletTransRecord extends Model
- {
- use SoftDeletes;
- protected $table = 'wallet_trans_records';
- protected $guarded = [];
- /**
- * @Author FelixYin
- * @description 交易记录所属钱包
- */
- public function wallet()
- {
- return $this->belongsTo(Wallet::class, 'wallet_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 钱包交易关联提现记录
- */
- public function withdraw()
- {
- return $this->hasOne(WalletWithdrawRecord::class, 'trans_record_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 交易关联支付记录
- */
- public function paymentRecords()
- {
- return $this->hasMany(WalletPaymentRecord::class, 'trans_record_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 交易关联退款记录
- */
- public function refundRecords()
- {
- return $this->hasMany(WalletRefundRecord::class, 'trans_record_id', 'id');
- }
- }
|