12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\common\model\Config;
- use app\hander\HelpHander;
- use think\App;
- use think\Db;
- class Complain extends Base
- {
- public function __construct(App $app = null) {
- parent::__construct($app);
- $this->model = new \app\common\model\Complain();
- }
- public function add(){
- $info = [
- 'orgId'=>$this->orgId,
- 'depId'=>input('depId/d',0),
- 'createUserId'=>$this->userId,
- 'hide'=>input('hide',0),
- '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 selectAllByOrgId(){
- $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');
- $ret=$this->model->detail($id);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('暂无数据');
- }
- }
- public function lists(){
- $type = input('type/d',0); // 0=全部 1=超时
- $page=input('page/d',1);
- $size=input('size/d',10);
- $ret=$this->model->alllists($page,$size,$type,$this->orgId);
- HelpHander::success($ret);
- }
- }
|