123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- class Hiddendanger extends Base
- {
- public function __construct(App $app = null) {
- parent::__construct($app);
- $this->model = new \app\common\model\Hiddendanger();
- }
- public function add(){
- $info = [
- 'orgId'=>$this->orgId,
- 'depId'=>input('depId/d',0),
- 'createUserId'=>$this->userId,
- 'content'=>input('content',''),
- 'images'=>input('images',''),
- 'voices'=>input('voices',''),
- 'videos'=>input('videos',''),
- ];
- $ret=$this->model->addSave($info);
- if($ret){
- HelpHander::success([],'添加成功');
- }else{
- HelpHander::error($this->model->getError());
- }
- }
- public function lists(){
- $page=input('page/d',1);
- $size=input('size/d',10);
- $ret=$this->model->lists($page,$size,$this->orgId,$this->userId);
- HelpHander::success($ret);
- }
- public function detail(){
- $id = input('id',0);
- $ret=$this->model->detail($id);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('暂无数据');
- }
- }
- }
|