Showing
1 changed file
with
6 additions
and
3 deletions
@@ -72,12 +72,15 @@ class PassportModel | @@ -72,12 +72,15 @@ class PassportModel | ||
72 | $resource = IndexData::getResourceData($code); | 72 | $resource = IndexData::getResourceData($code); |
73 | if(isset($resource['data'][0])) | 73 | if(isset($resource['data'][0])) |
74 | { | 74 | { |
75 | - $val = current($resource['data'][0]['data']); | 75 | + if($resource['data'][0]['template_name'] == 'single_image') { |
76 | + $val = current($resource['data'][0]['data']); | ||
77 | + } else if($resource['data'][0]['template_name'] == 'single_name_image') { | ||
78 | + $val = $resource['data'][0]['data']; | ||
79 | + } | ||
76 | $ret['img'] = Images::getImageUrl($val['src'], 252, 190); | 80 | $ret['img'] = Images::getImageUrl($val['src'], 252, 190); |
77 | $ret['url'] = $val['url']; | 81 | $ret['url'] = $val['url']; |
78 | } | 82 | } |
79 | - else | ||
80 | - { | 83 | + else { |
81 | $ret['img'] = 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190'; | 84 | $ret['img'] = 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190'; |
82 | $ret['url'] = ''; | 85 | $ret['url'] = ''; |
83 | } | 86 | } |
-
Please register or login to post a comment