二次改版
This commit is contained in:
26
app/Models/Traits/HasSort.php
Normal file
26
app/Models/Traits/HasSort.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use function collect;
|
||||
|
||||
trait HasSort
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 排序
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date: 2022/6/28 14:49
|
||||
* @param $query
|
||||
* @param $ids
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeBySort($query)
|
||||
{
|
||||
return $query->latest('sort')->latest();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user