Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
aa6e814099ba14133adf639edfe5423f17b732ed
2 parents
801b4daa
8e6b6387
Merge branch 'feature/yoho-coin-new' of
http://git.dev.yoho.cn/web/yohobuy
into …
…feature/yoho-coin-new
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
68 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 @
aa6e814
...
...
@@ -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 @
aa6e814
...
...
@@ -827,73 +827,13 @@ class HomeController extends AbstractAction
{
$this
->
setTitle
(
'YOHO币'
);
$this
->
setNavHeader
(
'YOHO币'
,
true
,
false
);
$uid
=
$this
->
getUid
();
$currency
=
array
(
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋运动鞋运动鞋运动鞋运动鞋运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
),
array
(
'title'
=>
'购买商品 Nike XXXXXX 运动鞋'
,
'time'
=>
'2015.11.23 12:45:33'
,
'count'
=>
'+943'
)
);
$page
=
$this
->
get
(
'page'
,
1
);
$size
=
$this
->
get
(
'size'
,
10
);
//$data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
$data
=
UserModel
::
getYohoCoinLists
(
3965746
,
$page
,
$size
);
$this
->
_view
->
display
(
'currency-detail'
,
array
(
'currency'
=>
$currency
,
'currency'
=>
$data
[
'list'
],
'money'
=>
$data
[
'money'
],
'pageFooter'
=>
true
,
'money'
=>
100
,
'currencyDetailPage'
=>
true
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
aa6e814
...
...
@@ -354,6 +354,35 @@ 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'
];
$data
[
'money'
]
=
$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'
];
}
$data
[
'list'
]
=
$result
;
return
$data
;
}
/**
* 处理优惠券数据
*
* @param int $uid 用户ID
...
...
Please
register
or
login
to post a comment