Authored by Rock Zhang

修复保存意见反馈接口的bug

... ... @@ -329,11 +329,12 @@ class UserData
* @param int $suggest_type 意见类型
* @return array 意见反馈接口返回的数据
*/
public static function savesuggestData($uid, $content, $suggest_type, $limit = 30)
public static function savesuggestData($uid, $content, $suggest_type)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['content'] = $content;
$param['suggest_type'] = $suggest_type;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/saveSuggest', $param);
... ...
... ... @@ -416,7 +416,7 @@ class HomeController extends AbstractAction
{
$uid = $this->getUid();
$content = $this->post('content', '');
$suggest_type = $this->get('suggest_type', 2);
$suggest_type = $this->post('suggest_type', 2);
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
$this->echoJson($result);
... ...
... ... @@ -472,8 +472,17 @@ class UserModel
*/
public static function saveSuggestData($uid, $content, $suggest_type)
{
$result = array('code' => 400, 'message' => '保存出错');
// 调用接口保存意见反馈数据
return UserData::savesuggestData($uid, $content, $suggest_type);
$save = UserData::savesuggestData($uid, $content, $suggest_type);
if (isset($save['code']) && $save['code'] == 200) {
$result['code'] = 200;
$result['message'] = '谢谢您的反馈';
}
return $result;
}
/**
... ...