Authored by whb

suggestfacebook

... ... @@ -32,7 +32,7 @@ class IndexData
* @param string $client_type
* @return array
*/
public static function getResourceData($content_code, $client_type = 'web')
public static function getResourceData($content_code, $client_type = 'web')
{
// 构建必传参数
$params = Yohobuy::param();
... ... @@ -68,4 +68,33 @@ class IndexData
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈
*
* @param int $feedback_id
* @param int $question_id
* @param string $answer
* @param int $solution
* @return array
*/
public static function suggestFeedback($feedback_id, $question_id, $answer, $solution)
{
//TODO 走老接口
$param = Yohobuy::param();
$param['page'] = 1;
$param['open_key'] = '12345';
$param['method'] = 'open.feedback.submit';
$param['feedback_id'] = $feedback_id;
$param['question_id'] = $question_id;
$param['answer'] = $answer;
$param['solution'] = $solution;
unset($param['app_version']);
unset($param['client_type']);
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -139,4 +139,24 @@ class CommonController extends WebAction
return $this->helpJsonCallbackResult($callback, 403, '订阅失败', '');
}
}
/**
* 意见反馈
*
* @return jsonp
*/
public function suggestfeedbackAction()
{
$callback = $this->get('callback', '');
$feedback_id = intval($this->get('feedback_id', 0));
$question_id = intval($this->get('question_id', 0));
$answer = trim($this->get('answer'));
$solution = intval($this->get('solution', 0));
if(!empty($feedback_id) || !empty($question_id) || !empty($answer) || !empty($solution)) {
$data = IndexData::suggestFeedback($feedback_id, $question_id, $answer, $solution);
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
} else {
return $this->helpJsonCallbackResult($callback, 403, '意见反馈失败', '');
}
}
}
\ No newline at end of file
... ...