Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
biao
9 years ago
Commit
ec7cffcf856b8e55089b2a0d6f81d4b287b0ed21
1 parent
78fd5a5f
fix guang related bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
View file @
ec7cffc
...
...
@@ -14,7 +14,7 @@ class InfoController extends AbstractAction
/**
* 详情页
*
*
* @param int id 内容ID
*/
public
function
indexAction
()
...
...
@@ -46,7 +46,7 @@ class InfoController extends AbstractAction
if
(
isset
(
$detail
[
'code'
])
&&
$detail
[
'code'
]
===
400
)
{
$this
->
error
();
}
if
(
empty
(
$detail
[
'getArticle'
]))
{
$this
->
_view
->
display
(
'index'
,
$data
);
return
;
...
...
@@ -180,9 +180,11 @@ class InfoController extends AbstractAction
// 相关品牌
if
(
!
empty
(
$detail
[
'getBrand'
]))
{
$data
[
'relatedBrand'
]
=
$detail
[
'getBrand'
];
foreach
(
$data
[
'relatedBrand'
]
as
&
$value
)
{
$value
[
'thumb'
]
=
strtr
(
$value
[
'thumb'
],
array
(
'http://'
=>
'//'
));
foreach
(
$data
[
'relatedBrand'
]
as
$key
=>
$value
)
{
$data
[
'relatedBrand'
][
$key
][
'thumb'
]
=
strtr
(
$value
[
'thumb'
],
array
(
'http://'
=>
'//'
));
}
}
// 相关标签
...
...
@@ -223,6 +225,7 @@ class InfoController extends AbstractAction
// 标识有微信分享
$data
[
'hasWxShare'
]
=
true
;
$this
->
_view
->
display
(
'index'
,
$data
);
$detail
=
array
();
...
...
@@ -231,7 +234,7 @@ class InfoController extends AbstractAction
/**
* APP里使用的收藏内容的接口
*
*
* @param id 资讯ID
* @param type "fav"表示收藏 或者 "cancel"表示取消收藏
* @return json
...
...
@@ -277,7 +280,7 @@ class InfoController extends AbstractAction
// 单张图
elseif
(
isset
(
$value
[
'singleImage'
]))
{
$build
[
'bigImage'
]
=
Helpers
::
getImageUrl
(
$value
[
'singleImage'
][
'data'
][
0
][
'src'
],
640
,
640
);
}
}
elseif
(
isset
(
$value
[
'smallPic'
][
'data'
]))
{
$imgs
=
$value
[
'smallPic'
][
'data'
];
$build
[
'smallImage'
]
=
array
(
...
...
@@ -356,6 +359,7 @@ class InfoController extends AbstractAction
$data
[
'relatedBrand'
]
=
$detail
[
'getBrand'
];
}
// 分享参数
if
(
isset
(
$detail
[
'getArticle'
][
'cover_image'
]))
{
$data
[
'shareLink'
]
=
Helpers
::
url
(
'/info/index'
,
array
(
'id'
=>
$id
),
'guang'
);
...
...
@@ -376,36 +380,36 @@ class InfoController extends AbstractAction
$detail
=
array
();
$data
=
array
();
}
/**
* 提供给YOHO资讯站调用的接口
*
*
* @param int id 逛内容ID
* @return json
*/
public
function
foryohoAction
()
{
$result
=
array
();
do
{
/* 判断参数是否有效 */
$id
=
$this
->
get
(
'id'
);
if
(
!
is_numeric
(
$id
))
{
break
;
}
$app
=
$this
->
get
(
'app'
);
$isApp
=
empty
(
$app
)
?
false
:
true
;
/* 判断是否有内容 */
$detail
=
DetailData
::
package
(
$id
,
$isApp
);
if
(
empty
(
$detail
[
'getArticleContent'
]))
{
break
;
}
/* 品牌信息 */
$result
[
'brand'
]
=
$detail
[
'getBrand'
];
$build
=
array
();
$good
=
array
();
$skns
=
array
();
...
...
@@ -421,7 +425,7 @@ class InfoController extends AbstractAction
// 单张图
elseif
(
isset
(
$value
[
'singleImage'
]))
{
$build
[
'bigImage'
]
=
Helpers
::
getImageUrl
(
$value
[
'singleImage'
][
'data'
][
0
][
'src'
],
640
,
640
);
}
}
elseif
(
isset
(
$value
[
'smallPic'
][
'data'
]))
{
$imgs
=
$value
[
'smallPic'
][
'data'
];
$build
[
'smallImage'
]
=
array
(
...
...
@@ -482,15 +486,15 @@ class InfoController extends AbstractAction
elseif
(
isset
(
$value
[
'link'
]))
{
$build
[
'moreLink'
]
=
$value
[
'link'
][
'data'
][
0
][
'url'
];
}
// 内容详情
if
(
array
()
!==
$build
)
{
$result
[
'content'
][]
=
$build
;
}
}
}
}
while
(
false
);
$this
->
echoJson
(
$result
);
}
...
...
Please
register
or
login
to post a comment