123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace App\Http\Controllers\Api\Admin;
- use App\Http\Controllers\Controller;
- use App\Log;
- use App\Service\SystemService;
- use Illuminate\Http\Request;
- class SystemController extends Controller
- {
- # 获取反馈类型列表
- public function opinionFeedbackTypeList(Request $request) {
- $data = config('wxad.complain');
- return self::returnValue($data);
- }
- # 用户反馈
- public function userOpinionFeedbackAction(Request $request) {
- Log::logInfo('用户反馈数据测试', $request->all(), '0220');
- $validator = \Validator::make($request->all(),[
- 'corpid' => 'required',
- 'user_id' => 'required',
- 'external_userid' => 'required',
- 'type' => 'required',
- 'content' => 'required',
- 'attachments' => 'array'
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $corpid = $request->input('corpid');
- $userId = $request->input('user_id');
- $externalUserid = $request->input('external_userid');
- $type = $request->input('type');
- $content = $request->input('content');
- $attachments = $request->input('attachments');
- list($res, $code) = SystemService::userOpinionFeedbackAction($corpid, $userId, $externalUserid, $type, $content
- , $attachments);
- return self::returnValue($res, $code);
- }
- # 反馈列表
- public function userOpinionFeedbackList(Request $request) {
- $validator = \Validator::make($request->all(),[
- 'user_id' => 'array',
- ]);
- if ($validator->fails()) {
- return self::returnValue($validator->getMessageBag(), 1102);
- }
- $userId = $request->input('user_id');
- $page = $request->input('page', 1);
- $pageSize = $request->input('page_size', 20);
- $sysGroupId=$request->input('sys_group_id');
- list($list, $count) = SystemService::userOpinionFeedbackList($sysGroupId, $userId, $page, $pageSize);
- return self::returnPageValue($list, $count, $pageSize, $page);
- }
- }
|