<?php

namespace App\Models\Virtual;

use App\Core\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Virtual\Relations\OrderRelations;
use App\Models\Virtual\Scopes\OrderCardPartitionNotRefundedScope;

/**
 * App\Models\Virtual\OrderCardPartition
 *
 * @property int $id 关联表ID
 * @property int $type
 * @property int $sim SIM卡号
 * @property int $order_id 订单ID
 * @property int $company_id 企业ID
 * @property int $package_id 套餐ID
 * @property int $counts 数量
 * @property string|null $service_start_at 服务开始时间
 * @property string|null $service_end_at 服务结束时间
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property string|null $deleted_at
 * @property-read \App\Models\Card\Card $card
 * @property-read \App\Models\Virtual\Company $company
 * @property-read \App\Models\Virtual\Order $order
 * @property-read \App\Models\Virtual\Package $package
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Virtual\OrderCardPartition onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereCompanyId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereCounts($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereOrderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition wherePackageId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereServiceEndAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereServiceStartAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereSim($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Virtual\OrderCardPartition withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Virtual\OrderCardPartition withoutTrashed()
 * @mixin \Eloquent
 * @property int $unit_price 单价
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereProductId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Virtual\OrderCardPartition whereUnitPrice($value)
 */
class OrderCardPartition extends Model
{
    use SoftDeletes, OrderRelations;

    protected $table = 'virtual_order_cards_partition';

    /**
     * 模型的「启动」方法
     *
     * @return void
     */
    protected static function boot()
    {
        parent::boot();

        static::addGlobalScope(new OrderCardPartitionNotRefundedScope);
    }
}
