Authored by yangyang

修改ajax请求图片

@@ -1248,7 +1248,7 @@ class HelperSearch @@ -1248,7 +1248,7 @@ class HelperSearch
1248 $result[$key]['isVedio'] = true; 1248 $result[$key]['isVedio'] = true;
1249 $result[$key]['src'] = $vo; 1249 $result[$key]['src'] = $vo;
1250 }else{ 1250 }else{
1251 - $result[$key]['href'] = $href[1][$key]; 1251 + $result[$key]['href'] = isset($href[1][$key]) ? $href[1][$key] : '';
1252 $result[$key]['src'] = $vo; 1252 $result[$key]['src'] = $vo;
1253 } 1253 }
1254 } 1254 }
@@ -95,17 +95,16 @@ class ListController extends WebAction @@ -95,17 +95,16 @@ class ListController extends WebAction
95 */ 95 */
96 public function getProductPicAction() 96 public function getProductPicAction()
97 { 97 {
98 - $res = array(  
99 - 'code' => 400  
100 - ); 98 + $res = array();
  99 + $callback = $this->post('callback');
101 if (!$this->isAjax()) { 100 if (!$this->isAjax()) {
102 - $this ->echoJson($res); 101 + $this->helpJsonCallbackResult($callback, 400, 'Not a Ajax request');
103 return; 102 return;
104 } 103 }
105 $productSkn = $this->post('skn'); 104 $productSkn = $this->post('skn');
106 $uid = $this->getUid(); 105 $uid = $this->getUid();
107 if (!$productSkn) { 106 if (!$productSkn) {
108 - $this ->echoJson($res); 107 + $this->helpJsonCallbackResult($callback, 412, '商品skn为空');
109 return ; 108 return ;
110 } 109 }
111 $rowNum = $this->post('rowNum'); 110 $rowNum = $this->post('rowNum');
@@ -131,7 +130,7 @@ class ListController extends WebAction @@ -131,7 +130,7 @@ class ListController extends WebAction
131 } 130 }
132 $options['isFavorite'] = $isFavorite; 131 $options['isFavorite'] = $isFavorite;
133 $res = SearchModel::getProductPic($productSkn, $options); 132 $res = SearchModel::getProductPic($productSkn, $options);
134 - $this ->echoJson($res); 133 + $this->helpJsonCallbackResult($callback, 200, 'success', $res);
135 } 134 }
136 135
137 /** 136 /**