更新功能
This commit is contained in:
31
backend/app/Services/Auth/DepartmentService.php
Normal file
31
backend/app/Services/Auth/DepartmentService.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user