AttendanceClass.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 AttendanceClass extends Base
  7. {
  8. // 列表
  9. public function list(){
  10. $page = input('page/d',1);
  11. $size = input('size/d',10);
  12. $name = input('name','','trim');
  13. $ret = model('AttendanceClass')->lists($page,$size,$name,$this->orgId);
  14. HelpHander::success($ret);
  15. }
  16. // 新增
  17. public function save(){
  18. model('AttendanceClass')->add();
  19. HelpHander::success([],'操作成功');
  20. }
  21. // 编辑
  22. public function update(){
  23. model('AttendanceClass')->add();
  24. HelpHander::success([],'操作成功');
  25. }
  26. // 删除
  27. public function del(){
  28. $id = input('id/d',0);
  29. model('AttendanceClass')->del($id);
  30. HelpHander::success([],'操作成功');
  31. }
  32. // 详情
  33. public function detail(){
  34. $id = input('id/d',0);
  35. $ret = model('AttendanceClass')->info($id);
  36. HelpHander::success($ret);
  37. }
  38. public function all(){
  39. $ret = model('AttendanceClass')->all($this->orgId);
  40. HelpHander::success($ret);
  41. }
  42. }