<?php

namespace app\admin\model;

use think\Model;

/**
 * PlatformSettle
 */
class PlatformSettle extends Model
{
    // 表名
    protected $name = 'platform_settle';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function getTotalAmountAttr($value): float
    {
        return (float)$value;
    }

    public function getSettledAmountAttr($value): float
    {
        return (float)$value;
    }

    public function getBackingInvoiceAmountAttr($value): float
    {
        return (float)$value;
    }

    public function getInvoicedAmountAttr($value): float
    {
        return (float)$value;
    }

    public function getDoingInvoiceAmountAttr($value): float
    {
        return (float)$value;
    }

    public function xuqiuOrder()
    {
        return $this->belongsTo(\app\admin\model\XuqiuOrder::class, 'order_id', 'id');
    }

    public function supplier()
    {
        return $this->belongsTo(\app\admin\model\Supplier::class, 'supplier_id', 'id');
    }
}