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
周少峰
9 years ago
Commit
a9dd275342f447de85caf9206c8b4e3d70c721de
1 parent
efd1573f
modify yohocoin
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 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 @
a9dd275
...
...
@@ -194,9 +194,10 @@ class UserData
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @param string $type 请求类型 get,post
* @return array YOHO币接口返回的数据
*/
public
static
function
yohoCoinData
(
$uid
,
$page
=
1
,
$limit
=
10
)
public
static
function
yohoCoinData
(
$uid
,
$page
=
1
,
$limit
=
10
,
$type
=
'get'
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.yohocoin.lists'
;
...
...
@@ -205,7 +206,7 @@ class UserData
$param
[
'limit'
]
=
$limit
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
return
Yohobuy
::
$type
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
a9dd275
...
...
@@ -827,8 +827,11 @@ class HomeController extends AbstractAction
{
$this
->
setTitle
(
'YOHO币'
);
$this
->
setNavHeader
(
'YOHO币'
,
true
,
false
);
$uid
=
$this
->
getUid
();
$page
=
$this
->
get
(
'page'
,
1
);
$size
=
$this
->
get
(
'size'
,
10
);
//$currency = UserModel::getYohoCoinLists($this->_uid,$page,$size);
$currency
=
UserModel
::
getYohoCoinLists
(
3965746
,
$page
,
$size
);
print_r
(
$currency
);
exit
;
$currency
=
array
(
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
a9dd275
...
...
@@ -354,6 +354,34 @@ class UserModel
}
/**
* 处理YOHO币变化履历数据
*
* @param int $uid 用户ID
* @param int $page 当前页
* @param int $limit 一页记录数
* @return array|mixed 处理之后的YOHO币数据
*/
public
static
function
getYohoCoinLists
(
$uid
,
$page
,
$limit
)
{
$result
=
array
();
// 调用接口获取YOHO币
$yohoCoin
=
UserData
::
yohoCoinData
(
$uid
,
$page
,
$limit
,
'post'
);
// 处理YOHO币数据
$coinList
=
$yohoCoin
[
'data'
][
'coinlist'
];
$result
[
'many'
]
=
$yohoCoin
[
'data'
][
'total'
];
foreach
(
$coinList
as
$key
=>
$val
){
$result
[
$key
][
'title'
]
=
$val
[
'message'
];
$result
[
$key
][
'time'
]
=
$val
[
'date'
];
if
(
$val
[
'num'
]
>
0
){
$val
[
'num'
]
=
'+'
.
$val
[
'num'
];
}
$result
[
$key
][
'count'
]
=
$val
[
'num'
];
}
return
$result
;
}
/**
* 处理优惠券数据
*
* @param int $uid 用户ID
...
...
Please
register
or
login
to post a comment