You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.6 KiB
95 lines
2.6 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace addon\zhjw\app\adminapi\controller\feedback;
|
|
|
|
use core\base\BaseAdminController;
|
|
use addon\zhjw\app\service\admin\feedback\FeedbackService;
|
|
|
|
|
|
/**
|
|
* 意见反馈控制器
|
|
* Class Feedback
|
|
* @package addon\zhjw\app\adminapi\controller\feedback
|
|
*/
|
|
class Feedback extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取意见反馈列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["students_id",""]
|
|
]);
|
|
return success((new FeedbackService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 意见反馈详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new FeedbackService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加意见反馈
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["students_id",0],
|
|
["content",""],
|
|
["images",""],
|
|
["mailbox",""],
|
|
|
|
]);
|
|
$this->validate($data, 'addon\zhjw\app\validate\feedback\Feedback.add');
|
|
$id = (new FeedbackService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 意见反馈编辑
|
|
* @param $id 意见反馈id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["students_id",0],
|
|
["content",""],
|
|
["images",""],
|
|
["mailbox",""],
|
|
|
|
]);
|
|
$this->validate($data, 'addon\zhjw\app\validate\feedback\Feedback.edit');
|
|
(new FeedbackService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 意见反馈删除
|
|
* @param $id 意见反馈id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new FeedbackService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function getStudentsAll(){
|
|
return success(( new FeedbackService())->getStudentsAll());
|
|
}
|
|
|
|
}
|
|
|