Feedback.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Feedback extends AdminControl
  17. {
  18. public function initialize()
  19. {
  20. parent::initialize(); // TODO: Change the autogenerated stub
  21. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/feedback.lang.php');
  22. }
  23. /**
  24. * 意见反馈
  25. */
  26. public function flist(){
  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. $feedback_model = model('feedback');
  39. $feedback_id = input('param.feedback_id');
  40. $feedback_id_array = ds_delete_param($feedback_id);
  41. $condition = array(array('fb_id' ,'in', $feedback_id_array));
  42. $result = $feedback_model->delFeedback($condition);
  43. if ($result){
  44. ds_json_encode(10000, lang('ds_common_op_succ'));
  45. }else {
  46. ds_json_encode(10001, lang('ds_common_op_fail'));
  47. }
  48. }
  49. protected function getAdminItemList() {
  50. $menu = array(
  51. array(
  52. 'text' => lang('ds_feedback'), 'name' => 'index', 'url' => ''
  53. ),
  54. );
  55. return $menu;
  56. }
  57. }