Authored by whb

suggestfacebook

@@ -32,7 +32,7 @@ class IndexData @@ -32,7 +32,7 @@ class IndexData
32 * @param string $client_type 32 * @param string $client_type
33 * @return array 33 * @return array
34 */ 34 */
35 - public static function getResourceData($content_code, $client_type = 'web') 35 + public static function getResourceData($content_code, $client_type = 'web')
36 { 36 {
37 // 构建必传参数 37 // 构建必传参数
38 $params = Yohobuy::param(); 38 $params = Yohobuy::param();
@@ -68,4 +68,33 @@ class IndexData @@ -68,4 +68,33 @@ class IndexData
68 unset($param['v']); 68 unset($param['v']);
69 return Yohobuy::get(Yohobuy::API_URL, $param); 69 return Yohobuy::get(Yohobuy::API_URL, $param);
70 } 70 }
  71 +
  72 + /**
  73 + * 意见反馈
  74 + *
  75 + * @param int $feedback_id
  76 + * @param int $question_id
  77 + * @param string $answer
  78 + * @param int $solution
  79 + * @return array
  80 + */
  81 + public static function suggestFeedback($feedback_id, $question_id, $answer, $solution)
  82 + {
  83 + //TODO 走老接口
  84 + $param = Yohobuy::param();
  85 + $param['page'] = 1;
  86 + $param['open_key'] = '12345';
  87 + $param['method'] = 'open.feedback.submit';
  88 + $param['feedback_id'] = $feedback_id;
  89 + $param['question_id'] = $question_id;
  90 + $param['answer'] = $answer;
  91 + $param['solution'] = $solution;
  92 + unset($param['app_version']);
  93 + unset($param['client_type']);
  94 + unset($param['os_version']);
  95 + unset($param['screen_size']);
  96 + unset($param['v']);
  97 + return Yohobuy::get(Yohobuy::API_URL, $param);
  98 + }
  99 +
71 } 100 }
@@ -139,4 +139,24 @@ class CommonController extends WebAction @@ -139,4 +139,24 @@ class CommonController extends WebAction
139 return $this->helpJsonCallbackResult($callback, 403, '订阅失败', ''); 139 return $this->helpJsonCallbackResult($callback, 403, '订阅失败', '');
140 } 140 }
141 } 141 }
  142 +
  143 + /**
  144 + * 意见反馈
  145 + *
  146 + * @return jsonp
  147 + */
  148 + public function suggestfeedbackAction()
  149 + {
  150 + $callback = $this->get('callback', '');
  151 + $feedback_id = intval($this->get('feedback_id', 0));
  152 + $question_id = intval($this->get('question_id', 0));
  153 + $answer = trim($this->get('answer'));
  154 + $solution = intval($this->get('solution', 0));
  155 + if(!empty($feedback_id) || !empty($question_id) || !empty($answer) || !empty($solution)) {
  156 + $data = IndexData::suggestFeedback($feedback_id, $question_id, $answer, $solution);
  157 + return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
  158 + } else {
  159 + return $this->helpJsonCallbackResult($callback, 403, '意见反馈失败', '');
  160 + }
  161 + }
142 } 162 }