File.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 File extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('File')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 删除
  14. public function del(){
  15. $id = input('id/d',0);
  16. model('File')->del($id);
  17. HelpHander::success([],'操作成功');
  18. }
  19. // 详情
  20. public function detail(){
  21. $id = input('id/d',0);
  22. $ret = model('File')->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. $sn = input('sn','','trim');
  30. $source = input('source','','trim');
  31. $title = input('title','','trim');
  32. $enable = input('enable/d',-1);
  33. $swTime = input('swTime','','trim');
  34. $ret = model('File')->lists($page,$size,$sn,$source,$title,$enable,$swTime,$this->orgId);
  35. HelpHander::success($ret);
  36. }
  37. }