Shopfeedback.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Shopfeedback
  28. * @package app\admin\controller
  29. */
  30. class Shopfeedback extends Controller
  31. {
  32. /**
  33. * 用户反馈列表
  34. * @auth true
  35. * @menu true
  36. */
  37. public function index(){
  38. $this->title='商家反馈列表';
  39. $phone=input('phone');
  40. \app\data\model\ShopFeedback::mQuery()
  41. ->when($phone,function (Query $query) use ($phone) {
  42. $query->hasWhere('user',function (Query $query) use ($phone) {
  43. $query->whereLike('username',"%{$phone}%");
  44. });
  45. })
  46. ->like('content')
  47. ->where('is_del',1)
  48. ->with(['user'])
  49. ->order('id','desc')
  50. ->layTable();
  51. }
  52. protected function _index_page_filter(&$data)
  53. {
  54. foreach ($data as &$v){
  55. $v['imgs'] = array_filter(explode(',',$v['image']));
  56. }
  57. // dump($data);die;
  58. }
  59. /**
  60. * 回复
  61. * @auth true
  62. * @menu true
  63. */
  64. public function reply(){
  65. \app\data\model\ShopFeedback::mForm('form');
  66. }
  67. public function _form_filter($vo){
  68. if ($this->request->isGet()) {
  69. }elseif ($this->request->isPost()){
  70. \app\data\model\ShopFeedback::mk()->where('id',$vo['id'])->update(['status'=>2,'reply'=>$vo['content'],'reply_time'=>date('Y-m-d H:i:s')]);
  71. $this->success('回复成功');
  72. }
  73. }
  74. /**
  75. * 删除
  76. * @auth true
  77. * @menu true
  78. */
  79. public function del($id){
  80. \app\data\model\ShopFeedback::whereIn('id',$id)->save([
  81. 'is_del'=>0,
  82. ]);
  83. $this->success('删除成功');
  84. }
  85. }