<?php

namespace app\common\model;

use support\think\Model;

class WithdrawOrder extends Model
{
    protected $name = 'withdraw_order';

    protected $autoWriteTimestamp = true;

    protected $type = [
        'create_time' => 'integer',
        'update_time' => 'integer',
        'review_time' => 'integer',
        'amount' => 'string',
        'fee' => 'string',
        'actual_amount' => 'string',
        'status' => 'integer',
    ];

    public function user(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    public function channel(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(Channel::class, 'channel_id', 'id');
    }

    public function reviewAdmin(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\Admin::class, 'review_admin_id', 'id');
    }
}
