Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
8a80e14bd457608cb44b7002f680f1381fa99913
1 parent
e58b5899
添加帮助中心有关接口
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
16 deletions
library/LibModels/Wap/Home/UserData.php
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
library/LibModels/Wap/Home/UserData.php
View file @
8a80e14
...
...
@@ -431,4 +431,35 @@ class UserData
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'operations/api/v1/help/getCategory'
,
$param
);
}
/**
* 帮助中心列表接口
*
* @return array 接口返回的数据
*/
public
static
function
helpListData
()
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.help.li'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 帮助详情接口
*
* @param string $code 具体一条帮助的code
* @return array 接口返回的数据
*/
public
static
function
helpDetailData
(
$code
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.help.detail'
;
$param
[
'return_type'
]
=
'html'
;
$param
[
'code'
]
=
$code
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
true
,
true
);
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
8a80e14
...
...
@@ -36,9 +36,12 @@ class HomeController extends AbstractAction
$excludeActions
=
array
(
'index'
,
'onlineservice'
,
'onlineservicedetail'
,
'suggest'
,
'suggestsub'
,
'suggestimgupload'
,
'help'
,
'helpdetail'
,
);
if
(
!
$this
->
_uid
&&
!
in_array
(
$action
,
$excludeActions
)
&&
!
$this
->
isAjax
())
{
$this
->
go
(
Helpers
::
url
(
'/signin.html'
));
...
...
@@ -789,25 +792,31 @@ class HomeController extends AbstractAction
/**
* 帮助列表页
*/
p
rivate
function
IH
elpAction
()
p
ublic
function
Ih
elpAction
()
{
$this
->
setTitle
(
'帮助中心'
);
$this
->
setNavHeader
(
'帮助中心'
);
$data
=
array
(
'iHelp'
=>
array
(
array
(
'name'
=>
'新用户注册'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'交款须知'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'服务条款'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'网站订购流程'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'会员登录'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'网站订单修改'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'YOHO币'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'常见问题'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'支付方式'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'发票制度说明'
,
'url'
=>
'http://m.dev.yohobuy.com/'
),
array
(
'name'
=>
'配送时间'
,
'url'
=>
'http://m.dev.yohobuy.com/'
)
)
);
$data
=
UserModel
::
getHelpListData
();
$this
->
_view
->
display
(
'i-help'
,
$data
);
}
/**
* 帮助详情页
*/
public
function
helpdetailAction
()
{
$code
=
$this
->
get
(
'code'
,
null
);
if
(
empty
(
$code
))
{
$this
->
error
();
}
$this
->
setTitle
(
'帮助中心'
);
$this
->
setNavHeader
(
'帮助中心'
);
$data
=
array
(
'content'
=>
UserModel
::
getHelpDetailData
(
$code
));
$this
->
_view
->
display
(
'i-help'
,
$data
);
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
8a80e14
...
...
@@ -725,4 +725,42 @@ class UserModel
return
$result
;
}
/**
* 处理帮助中心列表数据
*
* @return array|mixed 处理之后的返回
*/
public
static
function
getHelpListData
()
{
$result
=
array
();
$helpListData
=
UserData
::
helpListData
();
if
(
isset
(
$helpListData
[
'data'
])
&&
!
empty
(
$helpListData
[
'data'
]))
{
$help
=
$helpListData
[
'data'
];
$one
=
array
();
foreach
(
$help
as
$val
)
{
$one
=
array
();
$one
[
'name'
]
=
$val
[
'caption'
];
$one
[
'url'
]
=
Helpers
::
url
(
'/home/helpdetail/'
,
array
(
'code'
=>
$val
[
'code'
]));
$result
[
'iHelp'
][]
=
$one
;
}
}
return
$result
;
}
/**
* 处理帮助详情数据
*
* @param string $code 具体一条帮助的code
* @return array|mixed 处理之后的返回
*/
public
static
function
getHelpDetailData
(
$code
)
{
return
UserData
::
helpDetailData
(
$code
);
}
}
...
...
Please
register
or
login
to post a comment