FeedbackController.class.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Admin\Controller;
  3. use Common\Controller\AdminController;
  4. class FeedbackController extends AdminController {
  5. public function __construct(){
  6. parent::__construct();
  7. }
  8. public function index(){
  9. $fbStatus = I('fb_status');
  10. if (empty($fbStatus)){
  11. $count = M('Feedback')->where(array('is_delete'=>1,'fb_source'=>1))->count();
  12. }else{
  13. $count = M('Feedback')->where(array('is_delete'=>1,'fb_source'=>1,'fb_status'=>$fbStatus,))->count();
  14. }
  15. //分页
  16. $Page = new \Think\Page($count);
  17. $show = $Page->show();
  18. if (empty($fbStatus)){
  19. $fbList = D('Feedback')->getFbList(array('fb_source'=>1),$Page->firstRow, $Page->listRows);
  20. }else{
  21. $fbList = D('Feedback')->getFbList(array('fb_source'=>1,'fb_status'=>$fbStatus,),$Page->firstRow, $Page->listRows);
  22. }
  23. $this->assign('page',$show);
  24. $this->assign('list',$fbList);
  25. $this->assign('fbStatus',$fbStatus);
  26. $this->display();
  27. }
  28. public function sys(){
  29. $page = I('get.p','1');
  30. session('page',$page);
  31. $count = M('Feedback')->where(array('is_delete'=>1,'fb_source'=>2))->count();
  32. //分页
  33. $Page = new \Think\Page($count);
  34. $show = $Page->show();
  35. $fbList = D('Feedback')->getFbSysList(array('fb_source'=>2),$Page->firstRow, $Page->listRows);
  36. $this->assign('page',$show);
  37. $this->assign('list',$fbList);
  38. $this->display();
  39. }
  40. public function status(){
  41. $fbId = I('fb_id','');
  42. if (empty($fbId)){
  43. $this->error("反馈ID错误",'/admin/feedback/index');
  44. }
  45. M('Feedback')->where(array('fb_id'=>$fbId))->save(array('fb_status'=>2));
  46. $this->success('反馈状态修改成功','/admin/feedback/index');
  47. }
  48. }