<?php
 namespace Module\Feedback\Api\Controller; use Illuminate\Routing\Controller; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; class FeedbackController extends Controller { public function submit() { $input = InputPackage::buildFromInput(); $data = []; $data['contact'] = $input->getTrimString('contact'); $data['title'] = $input->getTrimString('title'); $data['content'] = $input->getTrimString('content'); if (empty($data['title'])) { return Response::generateError('反馈主题不能为空'); } if (empty($data['content'])) { return Response::generateError('反馈内容不能为空'); } ModelUtil::insert('feedback', $data); return Response::generateSuccess('提交成功'); } }