userId) ->where('deleted_at', 0) ->orderByDesc('id') ->get() ->toArray(); } public function create(array $params): array { $content = trim((string) ($params['content'] ?? '')); if ($content === '') { $this->utils->errorThrow('请填写反馈内容'); } $now = time(); $id = (int) FeedbackModel::insertGetId([ 'user_id' => $this->userId, 'content' => mb_substr($content, 0, 500), 'images' => is_array($params['images'] ?? null) ? implode(',', $params['images']) : (string) ($params['images'] ?? ''), 'status' => FeedbackModel::STATUS_PENDING, 'created_at' => $now, 'updated_at' => $now, ]); return FeedbackModel::where('id', $id)->first()->toArray(); } }