PositionService.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Laravel框架 [ Laravel ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 Laravel研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: wesmiler <12345678@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Services;
  12. use App\Models\PositionModel;
  13. /**
  14. * 岗位管理-服务类
  15. * @author wesmiler
  16. * @since 2020/11/11
  17. * Class PositionService
  18. * @package App\Services
  19. */
  20. class PositionService extends BaseService
  21. {
  22. /**
  23. * 构造函数
  24. * @author wesmiler
  25. * @since 2020/11/11
  26. * PositionService constructor.
  27. */
  28. public function __construct()
  29. {
  30. $this->model = new PositionModel();
  31. }
  32. /**
  33. * 获取列表
  34. * @return array
  35. * @since 2020/11/11
  36. * @author wesmiler
  37. */
  38. public function getPositionList()
  39. {
  40. $list = $this->model->where([
  41. ['status', '=', 1],
  42. ['mark', '=', 1],
  43. ])->orderBy("sort", "asc")
  44. ->get()
  45. ->toArray();
  46. return message("操作成功", true, $list);
  47. }
  48. /**
  49. * 添加或编辑
  50. * @return array
  51. * @since 2020/11/11
  52. * @author wesmiler
  53. */
  54. public function edit()
  55. {
  56. $data = request()->all();
  57. $data['update_time'] = time();
  58. return parent::edit($data); // TODO: Change the autogenerated stub
  59. }
  60. }