<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace Modules\Member\Models;

use App\Models\BaseModel;

class MemberAccount extends BaseModel {

	protected $table = 'member_account';
	protected $fillable = ['store_id', 'order_id', 'member_id', 'type', 'account_type', 'amount', 'bf_amount', 'af_amount', 'status', 'remark', 'fee_rate', 'actual_amount', 'pay_type', 'bank_id'];
	// protected $hidden = ['deleted_at'];

	public function member(){
		return $this->belongsTo(Member::class, 'member_id', 'uid');
	}

	public function admin(){
		return $this->belongsTo(\Modules\Auth\Models\Admin::class, 'member_id', 'uid');
	}

	public function order(){
		return $this->belongsTo(\Modules\Order\Models\OrderItem::class, 'order_id', 'id');
	}

	public function bank(){
		return $this->belongsTo(\Modules\Member\Models\MemberBank::class, 'bank_id', 'id');
	}
}
