Feedback.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: https://thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // | 免费声明 ( https://thinkadmin.top/disclaimer )
  11. // +----------------------------------------------------------------------
  12. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  13. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  14. // +----------------------------------------------------------------------
  15. namespace app\admin\controller;
  16. use app\data\model\DataFeedback;
  17. use app\data\model\DataPoolTalent;
  18. use app\data\model\DataTeachingKnowledge;
  19. use app\data\model\DataZhicheng;
  20. use Carbon\Carbon;
  21. use think\admin\Controller;
  22. use app\data\model\SystemUser;
  23. use think\Db;
  24. use think\db\Query;
  25. /**
  26. * 用户反馈列表
  27. * Class PoolTalent
  28. * @package app\admin\controller
  29. */
  30. class Feedback extends Controller
  31. {
  32. /**
  33. * 用户反馈列表
  34. * @auth true
  35. * @menu true
  36. */
  37. public function index(){
  38. $this->title='用户反馈列表';
  39. $phone=input('phone');
  40. DataFeedback::mQuery()
  41. ->when($phone,function (Query $query) use ($phone) {
  42. $query->hasWhere('user',function (Query $query) use ($phone) {
  43. $query->whereLike('phone',"%{$phone}%");
  44. });
  45. })
  46. ->like('content')
  47. ->with(['user','reply'])
  48. ->where('pid',0)
  49. ->where('is_del',1)
  50. ->order('id','desc')
  51. ->layTable();
  52. }
  53. protected function _index_page_filter(&$data)
  54. {
  55. }
  56. /**
  57. * 回复
  58. * @auth true
  59. * @menu true
  60. */
  61. public function reply(){
  62. DataFeedback::mForm('form');
  63. }
  64. public function _form_filter($vo){
  65. if ($this->request->isGet()) {
  66. }elseif ($this->request->isPost()){
  67. $data = [
  68. 'uuid'=>0,
  69. 'pid'=>$vo['id'],
  70. 'content'=>$vo['content'],
  71. ];
  72. DataFeedback::create($data);
  73. $this->success('回复成功');
  74. }
  75. }
  76. /**
  77. * 删除
  78. * @auth true
  79. * @menu true
  80. */
  81. public function del($id){
  82. DataFeedback::whereIn('id',$id)->save([
  83. 'is_del'=>0,
  84. ]);
  85. $this->success('删除成功');
  86. }
  87. }