<?php

namespace App\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

class OrderByOrderAscScope implements Scope
{
    /**
     * Notes   : 按照 order 字段 正序排序的作用域
     *
     * @Date   : 2021/11/10 10:16 上午
     * @Author : <Jason.C>
     * @param  Builder  $builder
     * @param  Model  $model
     */
    public function apply(Builder $builder, Model $model): void
    {
        $builder->orderBy('order')->orderByDesc('id');
    }
}
