Feedback.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. *
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 控制器
  14. */
  15. class Feedback extends AdminControl
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize(); // TODO: Change the autogenerated stub
  20. Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/feedback.lang.php');
  21. }
  22. /**
  23. * 意见反馈
  24. */
  25. public function flist()
  26. {
  27. $feedback_model = model('feedback');
  28. $feedback_list = $feedback_model->getFeedbackList(array(), 10);
  29. View::assign('feedback_list', $feedback_list);
  30. View::assign('show_page', $feedback_model->page_info->render());
  31. $this->setAdminCurItem('index');
  32. return View::fetch('index');
  33. }
  34. /**
  35. * 删除
  36. */
  37. public function del()
  38. {
  39. $feedback_model = model('feedback');
  40. $feedback_id = input('param.feedback_id');
  41. $feedback_id_array = ds_delete_param($feedback_id);
  42. $condition = array(array('fb_id', 'in', $feedback_id_array));
  43. $result = $feedback_model->delFeedback($condition);
  44. if ($result) {
  45. ds_json_encode(10000, lang('ds_common_op_succ'));
  46. } else {
  47. ds_json_encode(10001, lang('ds_common_op_fail'));
  48. }
  49. }
  50. protected function getAdminItemList()
  51. {
  52. $menu = array(
  53. array(
  54. 'text' => lang('ds_feedback'), 'name' => 'index', 'url' => ''
  55. ),
  56. );
  57. return $menu;
  58. }
  59. }