1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- /**
- * FeedbackController.php UTF-8
- * web
- *
- * @date : 2018/7/18 11:50
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : chenbingling <cbl@huosdk.com>
- * @version : Beibao 1.0
- */
- namespace huo\controller\help;
- use huo\controller\common\Base;
- use huo\model\member\MemProblemModel;
- use huolib\status\CommonStatus;
- use huolib\status\GameStatus;
- use huolib\status\MemberStatus;
- class FeedbackController extends Base {
- /**
- * 添加意见反馈
- *
- * @param $mem_id
- * @param $app_id
- * @param $data
- *
- * @return array
- */
- public function addFeedback($mem_id, $app_id, $data) {
- if (empty($mem_id)) {
- return $this->huoError(MemberStatus::UID_INVALID, MemberStatus::getMsg(MemberStatus::UID_INVALID));
- }
- if (empty($app_id)) {
- return $this->huoError(GameStatus::GAME_ID_EMPTY, GameStatus::getMsg(GameStatus::GAME_ID_EMPTY));
- }
- if (empty($data)) {
- return $this->huoError(CommonStatus::INVALID_PARAMS, CommonStatus::getMsg(CommonStatus::INVALID_PARAMS));
- }
- $_data = [];
- $_data['mem_id'] = $mem_id;
- $_data['app_id'] = $app_id;
- $_data['details'] = $data['content'];
- $_data['contact'] = $data['linkman'];
- $_rs = (new MemProblemModel())->addFeedback($_data);
- if (false == $_rs) {
- return $this->huoError(CommonStatus::INNER_ERROR, CommonStatus::getMsg(CommonStatus::INNER_ERROR));
- }
- return $this->huoError(CommonStatus::NO_ERROR, CommonStatus::getMsg(CommonStatus::NO_ERROR));
- }
- }
|