企微短剧业务系统

SystemController.php 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Http\Controllers\Api\Admin;
  3. use App\Http\Controllers\Controller;
  4. use App\Log;
  5. use App\Service\SystemService;
  6. use Illuminate\Http\Request;
  7. class SystemController extends Controller
  8. {
  9. # 获取反馈类型列表
  10. public function opinionFeedbackTypeList(Request $request) {
  11. $data = config('wxad.complain');
  12. return self::returnValue($data);
  13. }
  14. # 用户反馈
  15. public function userOpinionFeedbackAction(Request $request) {
  16. Log::logInfo('用户反馈数据测试', $request->all(), '0220');
  17. $validator = \Validator::make($request->all(),[
  18. 'corpid' => 'required',
  19. 'user_id' => 'required',
  20. 'external_userid' => 'required',
  21. 'type' => 'required',
  22. 'content' => 'required',
  23. 'attachments' => 'array'
  24. ]);
  25. if ($validator->fails()) {
  26. return self::returnValue($validator->getMessageBag(), 1102);
  27. }
  28. $corpid = $request->input('corpid');
  29. $userId = $request->input('user_id');
  30. $externalUserid = $request->input('external_userid');
  31. $type = $request->input('type');
  32. $content = $request->input('content');
  33. $attachments = $request->input('attachments');
  34. list($res, $code) = SystemService::userOpinionFeedbackAction($corpid, $userId, $externalUserid, $type, $content
  35. , $attachments);
  36. return self::returnValue($res, $code);
  37. }
  38. # 反馈列表
  39. public function userOpinionFeedbackList(Request $request) {
  40. $validator = \Validator::make($request->all(),[
  41. 'user_id' => 'array',
  42. ]);
  43. if ($validator->fails()) {
  44. return self::returnValue($validator->getMessageBag(), 1102);
  45. }
  46. $userId = $request->input('user_id');
  47. $page = $request->input('page', 1);
  48. $pageSize = $request->input('page_size', 20);
  49. $sysGroupId=$request->input('sys_group_id');
  50. list($list, $count) = SystemService::userOpinionFeedbackList($sysGroupId, $userId, $page, $pageSize);
  51. return self::returnPageValue($list, $count, $pageSize, $page);
  52. }
  53. }