32 lines
983 B
PHP
32 lines
983 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\Models\Auth\Departments;
|
|
use think\facade\Config;
|
|
use App\Support\Tree;
|
|
|
|
class DepartmentService{
|
|
|
|
/**
|
|
* @title 获取部门数据
|
|
*
|
|
* @param [type] $request
|
|
* @return void
|
|
*/
|
|
public function getDepartmentList($request){
|
|
$param = $request->all();
|
|
$map = [];
|
|
if(isset($param['keyword']) && $param['keyword']){
|
|
$map[] = ['title', 'LIKE', '%' . $param['keyword'] . '%'];
|
|
}
|
|
return Departments::where($map)->orderBy('sort', 'asc')->get();
|
|
}
|
|
}
|