FileRecord.php 1.0 KB

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