意见反馈

feature/main20240421
guojia 7 months ago
parent 61f550283c
commit 0d9998edba
  1. 15
      app/api/controller/Feedback.php
  2. 2
      app/api/controller/Square.php

@ -34,11 +34,7 @@ class Feedback extends Controller
*/
public function add(): Json
{
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$useInfo = UserService::getCurrentLoginUser(true);
$useInfo = UserService::getCurrentLoginUser(true)->toArray();
$content = $this->request->post('content');
if (!$content) {
@ -49,9 +45,11 @@ class Feedback extends Controller
return $this->renderError('分类不能为空');
}
$data = $this->postForm();
$data = $this->postData();
$data['merchant_id'] = $this->merchantId;
if ((new squareModel)->add($data)) {
$data['user_name'] = $useInfo['user_id'];
$data['real_name'] = $useInfo['nick_name'];
if ((new feedbackModel)->add($data)) {
return $this->renderSuccess('添加成功');
}
return $this->renderError('添加失败');
@ -62,9 +60,12 @@ class Feedback extends Controller
* 列表
*/
public function list(): Json {
$useInfo = UserService::getCurrentLoginUser(true)->toArray();
$model = new feedbackModel;
$params = $this->request->param();
$params['userName'] = $useInfo['user_id'];
$list = $model->getList($params)->toArray();
foreach ($list['data'] as $kr => $r) {

@ -70,7 +70,7 @@ class Square extends Controller
foreach ($list['data'] as $kr => $r) {
$model = new UserModel();
$user = $model->where(['user_id' => $r['user_name']])->get()->toArray();
$user = $model->where(['user_id' => $r['user_name']])->find()->toArray();
$res[$kr]['imgs'] = [];
$res[$kr]['avatar_url'] = [];
if ($r['imgs']) {

Loading…
Cancel
Save