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