<?php

namespace App\Model;

use App\Exceptions\DatabaseException;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class OrganizationModel extends Model
{
    protected static $collection = "organization";

    public static function orgList($request){


        try{
            $orgList = DB::connection("mongodb")->collection(self::$collection)->paginate(10);
        }catch (\Exception $exception){
            throw new DatabaseException("组织不存在");
        }

        return $orgList;
    }
}
