| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- // +----------------------------------------------------------------------
- // | Laravel框架 [ Laravel ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 Laravel研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: wesmiler <12345678@qq.com>
- // +----------------------------------------------------------------------
- namespace App\Services;
- use App\Models\DeptModel;
- /**
- * 部门管理-服务类
- * @author wesmiler
- * @since 2020/11/11
- * Class DeptService
- * @package App\Services
- */
- class DeptService extends BaseService
- {
- /**
- * 构造函数
- * @author wesmiler
- * @since 2020/11/11
- * DeptService constructor.
- */
- public function __construct()
- {
- $this->model = new DeptModel();
- }
- /**
- * 获取数据列表
- * @return array
- * @since 2020/11/11
- * @author wesmiler
- */
- public function getList()
- {
- $param = request()->all();
- // 查询条件
- $map = [];
- // 部门名称
- $name = getter($param, "name");
- if ($name) {
- $map[] = ['name', 'like', "%{$name}%"];
- }
- $list = $this->model->getList($map, [['sort', 'asc']]);
- return message("操作成功", true, $list);
- }
- }
|