SalaryYear.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class SalaryYear extends Base
  7. {
  8. public function save(){
  9. model('SalaryYear')->add();
  10. HelpHander::success([],'操作成功');
  11. }
  12. // 详情
  13. public function detail(){
  14. $id = input('id/d',0);
  15. $ret = model('SalaryYear')->info($id);
  16. HelpHander::success($ret);
  17. }
  18. // 列表
  19. public function ulist(){
  20. $page = input('page/d',1);
  21. $size = input('size/d',10);
  22. $name = input('name','','trim');
  23. $year = input('year','','trim');
  24. $ret = model('SalaryYear')->lists($page,$size,$name,$year,$this->userId);
  25. HelpHander::success($ret);
  26. }
  27. // 列表
  28. public function list(){
  29. $page = input('page/d',1);
  30. $size = input('size/d',10);
  31. $name = input('name','','trim');
  32. $year = input('year','','trim');
  33. $ret = model('SalaryYear')->lists2($page,$size,$name,$year);
  34. HelpHander::success($ret);
  35. }
  36. // 删除
  37. public function del(){
  38. $id = input('id/d',0);
  39. model('SalaryYear')->del($id);
  40. HelpHander::success([],'操作成功');
  41. }
  42. // 导出
  43. public function export(){
  44. $name = input('name','','trim');
  45. $year = input('year','','trim');
  46. $ret = model('SalaryYear')->export($name,$year);
  47. HelpHander::success($ret);
  48. }
  49. }