Hiddendanger.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\App;
  6. class Hiddendanger extends Base
  7. {
  8. public function __construct(App $app = null) {
  9. parent::__construct($app);
  10. $this->model = new \app\common\model\Hiddendanger();
  11. }
  12. public function add(){
  13. $info = [
  14. 'orgId'=>$this->orgId,
  15. 'depId'=>input('depId/d',0),
  16. 'createUserId'=>$this->userId,
  17. 'content'=>input('content',''),
  18. 'images'=>input('images',''),
  19. 'voices'=>input('voices',''),
  20. 'videos'=>input('videos',''),
  21. ];
  22. $ret=$this->model->addSave($info);
  23. if($ret){
  24. HelpHander::success([],'添加成功');
  25. }else{
  26. HelpHander::error($this->model->getError());
  27. }
  28. }
  29. public function lists(){
  30. $page=input('page/d',1);
  31. $size=input('size/d',10);
  32. $ret=$this->model->lists($page,$size,$this->orgId,$this->userId);
  33. HelpHander::success($ret);
  34. }
  35. public function detail(){
  36. $id = input('id',0);
  37. $ret=$this->model->detail($id);
  38. if($ret){
  39. HelpHander::success($ret);
  40. }else{
  41. HelpHander::error('暂无数据');
  42. }
  43. }
  44. }