Files
sentos/app/services/auth/DepartmentService.php
2022-05-24 16:10:50 +08:00

23 lines
884 B
PHP

<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\services\auth;
use app\model\auth\Departments;
class DepartmentService{
public function getDepartmentList($request){
$param = $request->param();
$map = [];
if(isset($param['keyword']) && $param['keyword']){
$map[] = ['title', 'LIKE', '%' . $param['keyword'] . '%'];
}
return Departments::where($map)->auth()->order('sort asc,id desc')->select();
}
}