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
Rock Zhang
9 years ago
Commit
2d07ee0accd2c4d02287311062d8afbccb6f965d
1 parent
1bd7204b
添加地址管理修改,删除等接口
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
5 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 @
2d07ee0
...
...
@@ -285,6 +285,24 @@ class UserData
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public
static
function
deleteAddress
(
$uid
,
$id
)
{
$param
=
Yohobuy
::
param
();
$param
[
'id'
]
=
$id
;
$param
[
'method'
]
=
'app.address.del'
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
2d07ee0
...
...
@@ -122,7 +122,7 @@ class HomeController extends AbstractAction
$this
->
setNavHeader
(
'YOHO币'
,
true
,
false
);
// $uid = $this->getUid();
$uid
=
967016
;
$uid
=
8826435
;
$currency
=
\Index\UserModel
::
getYohoCoinData
(
$uid
);
$currency
[
'pageFooter'
]
=
true
;
...
...
@@ -154,7 +154,7 @@ class HomeController extends AbstractAction
$page
=
$this
->
get
(
'page'
,
0
);
$size
=
$this
->
get
(
'size'
,
10
);
$uid
=
967016
;
$uid
=
8826435
;
$messages
=
\Index\UserModel
::
getMessageData
(
$uid
,
$page
,
$size
);
print_r
(
$messages
);
...
...
@@ -169,7 +169,7 @@ class HomeController extends AbstractAction
$this
->
setNavHeader
(
'地址管理'
,
true
,
SITE_MAIN
);
// $uid = $this->getUid();
$uid
=
967016
;
$uid
=
8826435
;
$address
=
\Index\UserModel
::
getAddressData
(
$uid
);
$addressList
=
\Index\UserModel
::
getAddressListData
(
$uid
);
...
...
@@ -192,7 +192,7 @@ class HomeController extends AbstractAction
if
(
$this
->
isAjax
())
{
// $uid = $this->getUid();
$uid
=
967016
;
$uid
=
8826435
;
$address
=
$this
->
post
(
'address'
,
''
);
$area_code
=
$this
->
post
(
'area_code'
,
''
);
$consignee
=
$this
->
post
(
'consignee'
,
''
);
...
...
@@ -219,7 +219,7 @@ class HomeController extends AbstractAction
if
(
$this
->
isAjax
())
{
// $uid = $this->getUid();
$uid
=
967016
;
$uid
=
8826435
;
$id
=
$this
->
post
(
'id'
,
''
);
$result
=
\Index\UserModel
::
setDefaultAddress
(
$uid
,
$id
);
...
...
@@ -232,6 +232,27 @@ class HomeController extends AbstractAction
}
}
/**
* 删除地址
*/
public
function
addressDelAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
// $uid = $this->getUid();
$uid
=
8826435
;
$id
=
$this
->
post
(
'id'
,
''
);
$result
=
\Index\UserModel
::
deleteAddress
(
$uid
,
$id
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
$this
->
echoJson
(
$result
);
}
}
//在线客服
public
function
onlineServiceAction
()
{
// 设置网站标题
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
2d07ee0
...
...
@@ -59,7 +59,11 @@ class UserModel
foreach
(
$infoNumData
[
'data'
]
as
&
$val
)
{
empty
(
$val
)
&&
$val
=
0
;
}
$result
=
$infoNumData
[
'data'
];
// 默认没有返回用户地址的数据,添加这块儿数据
$result
[
'address_num'
]
=
count
(
self
::
getAddressData
(
$uid
));
}
return
$result
;
...
...
@@ -384,6 +388,27 @@ class UserModel
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public
static
function
deleteAddress
(
$uid
,
$id
)
{
$result
=
array
(
'code'
=>
400
,
'message'
=>
'错误'
);
// 调用接口删除地址
$address
=
UserData
::
deleteAddress
(
$uid
,
$id
);
// 处理返回结果
if
(
$address
&&
isset
(
$address
[
'code'
]))
{
$result
=
$address
;
}
return
$result
;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
...
...
Please
register
or
login
to post a comment