Fix message path ordering
This commit is contained in:
parent
01d54794a8
commit
97384ce3a0
@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Jenssegers\Mongodb\Eloquent\Model;
|
||||
use Jenssegers\Mongodb\Eloquent\SoftDeletes;
|
||||
|
||||
@ -37,7 +38,10 @@ class Echomail extends Model implements Packet
|
||||
|
||||
public function getPathAttribute($value): Collection
|
||||
{
|
||||
return Address::whereIn('id',$value)->get()->pluck('ftn3d');
|
||||
return Address::whereIn('id',$value)
|
||||
->orderBy(DB::raw(sprintf("position (id::text in '(%s)')",join(',',$value))))
|
||||
->get()
|
||||
->pluck('ftn3d');
|
||||
}
|
||||
|
||||
public function getSeenByAttribute($value): Collection
|
||||
|
Loading…
Reference in New Issue
Block a user