Authored by Rock Zhang

修复地址有关接口,修复意见反馈有关bug

@@ -303,8 +303,8 @@ class UserData @@ -303,8 +303,8 @@ class UserData
303 { 303 {
304 $param = array(); 304 $param = array();
305 $param['address'] = $address; 305 $param['address'] = $address;
306 - $param['areaCode'] = $areaCode;  
307 - $param['addresseeName'] = $consignee; 306 + $param['area_code'] = $areaCode;
  307 + $param['addressee_name'] = $consignee;
308 $param['email'] = $email; 308 $param['email'] = $email;
309 309
310 if (!empty($id)) { // 修改 310 if (!empty($id)) { // 修改
@@ -244,14 +244,14 @@ class HomeController extends AbstractAction @@ -244,14 +244,14 @@ class HomeController extends AbstractAction
244 * 244 *
245 * 暂时使用老的,因后面APP、PC、WAP会进行一次改版 245 * 暂时使用老的,因后面APP、PC、WAP会进行一次改版
246 */ 246 */
247 - public function messageAction() { 247 + /*public function messageAction() {
248 $page = $this->get('page', 1); 248 $page = $this->get('page', 1);
249 $size = $this->get('size', 10); 249 $size = $this->get('size', 10);
250 250
251 $messages = UserModel::getMessageData($this->_uid, $page, $size); 251 $messages = UserModel::getMessageData($this->_uid, $page, $size);
252 252
253 print_r($messages); 253 print_r($messages);
254 - } 254 + }*/
255 255
256 /** 256 /**
257 * 地址管理 257 * 地址管理
@@ -357,7 +357,18 @@ class UserModel @@ -357,7 +357,18 @@ class UserModel
357 357
358 // 处理地址数据 358 // 处理地址数据
359 if ($address && !isset($address['code'])) { 359 if ($address && !isset($address['code'])) {
360 - $result = $address; 360 + $one = array();
  361 + foreach ($address as $val) {
  362 + $one = array();
  363 + $one['consignee'] = $val['addresseeName'];
  364 + $one['mobile'] = $val['mobile'];
  365 + $one['area'] = $val['area']['parent']['parent']['caption'] . $val['area']['parent']['caption'] . $val['area']['caption'];
  366 + $one['address'] = $val['address'];
  367 + $one['address_id'] = $val['id'];
  368 + $one['area_code'] = $val['areaCode'];
  369 +
  370 + $result[] = $one;
  371 + }
361 } 372 }
362 373
363 return $result; 374 return $result;
@@ -520,8 +531,9 @@ class UserModel @@ -520,8 +531,9 @@ class UserModel
520 $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240); 531 $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240);
521 $one['title'] = $val['filter_content']; 532 $one['title'] = $val['filter_content'];
522 $one['content'] = $val['reply_content']; 533 $one['content'] = $val['reply_content'];
523 - $one['good'] = (bool)($val['is_reliable']);  
524 - $one['bad'] = !$one['good']; 534 + $one['good'] = ($val['is_reliable'] == 1);
  535 + $one['bad'] = ($val['is_reliable'] == 2);
  536 + $one['none'] = ($val['is_reliable'] == 0);
525 537
526 $result[] = $one; 538 $result[] = $one;
527 } 539 }