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
htoooth
9 years ago
Commit
9b288ea02b8ece4a1877cc0d513ce8ed7cb7c010
1 parent
956e6bbb
头像63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
yohobuy/www.yohobuy.com/application/controllers/Common.php
yohobuy/www.yohobuy.com/application/controllers/Common.php
View file @
9b288ea
...
...
@@ -36,11 +36,11 @@ class CommonController extends WebAction
// 首页资源品牌,采用内存存储
$key
=
WebCacheConfig
::
KEY_WEB_INDEX_BRANDS_LIST_DATA
.
'_'
.
$type
;
// array('logoBrand'=>'','moreBrand'=>'')
$data
=
Cache
::
get
(
$key
,
'master'
);
if
(
empty
(
$data
))
{
//从slave取数据
$data
=
Cache
::
get
(
$key
,
'master'
);
if
(
empty
(
$data
))
{
//从slave取数据
$data
=
Cache
::
get
(
$key
,
'slave'
);
}
}
while
(
false
);
$this
->
echoJson
(
$data
);
...
...
@@ -68,8 +68,8 @@ class CommonController extends WebAction
HomeModel
::
COOKIE_NAME_LIFESTYLE
);
$channel
=
$this
->
post
(
'type'
,
''
);
$pageIndex
=
(
int
)
$this
->
post
(
'pageIndex'
,
0
);
$pageCount
=
(
int
)
$this
->
post
(
'pageCount'
,
8
);
$pageIndex
=
(
int
)
$this
->
post
(
'pageIndex'
,
0
);
$pageCount
=
(
int
)
$this
->
post
(
'pageCount'
,
8
);
if
(
!
in_array
(
$channel
,
$channels
))
{
break
;
}
...
...
@@ -94,7 +94,7 @@ class CommonController extends WebAction
'goods'
=>
$data
);
$data
=
array
();
}
while
(
false
);
$this
->
echoJson
(
$result
);
...
...
@@ -102,7 +102,7 @@ class CommonController extends WebAction
/**
* 获取资源位banner
*
*
* @return jsonp
*/
public
function
getbannerAction
()
...
...
@@ -111,7 +111,7 @@ class CommonController extends WebAction
$callback
=
$this
->
get
(
'callback'
,
''
);
$width
=
$this
->
get
(
'width'
,
''
);
$height
=
$this
->
get
(
'height'
,
''
);
$data
=
IndexData
::
getResourceData
(
$contentCode
);
if
(
empty
(
$data
[
'data'
]))
{
return
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'没有数据'
,
''
);
...
...
@@ -138,7 +138,7 @@ class CommonController extends WebAction
/**
* 获取邮件订阅
*
*
* @return jsonp
*/
public
function
emailsubscriberAction
()
...
...
@@ -155,13 +155,13 @@ class CommonController extends WebAction
if
(
isset
(
$data
[
'code'
])
&&
$data
[
'code'
]
===
200
)
{
return
$this
->
helpJsonCallbackResult
(
$callback
,
$data
[
'code'
],
$data
[
'message'
],
array
(
'result'
=>
1
));
}
}
while
(
false
);
}
while
(
false
);
return
$this
->
helpJsonCallbackResult
(
$callback
,
403
,
'订阅失败'
,
''
);
}
/**
* 意见反馈
*
*
* @return jsonp
*/
public
function
suggestfeedbackAction
()
...
...
@@ -267,7 +267,7 @@ class CommonController extends WebAction
//个人资料
$userInfo
[
'profileName'
]
=
$apiInfo
[
'profile'
][
'profile_name'
];
$userInfo
[
'headIco'
]
=
isset
(
$apiInfo
[
'profile'
][
'head_ico'
])
&&
!
empty
(
$apiInfo
[
'profile'
][
'head_ico'
])
?
Helpers
::
getImageUrl
(
$apiInfo
[
'profile'
][
'head_ico'
],
100
,
100
)
:
''
;
$userInfo
[
'headIco'
]
=
isset
(
$apiInfo
[
'profile'
][
'head_ico'
])
&&
!
empty
(
$apiInfo
[
'profile'
][
'head_ico'
])
?
Helpers
::
getImageUrl
(
$apiInfo
[
'profile'
][
'head_ico'
],
63
,
63
)
:
''
;
//VIP信息
$userInfo
[
'curLevel'
]
=
$apiInfo
[
'profile'
][
'vip_info'
][
'cur_level'
];
$userInfo
[
'curTitle'
]
=
$apiInfo
[
'profile'
][
'vip_info'
][
'title'
];
...
...
@@ -309,12 +309,12 @@ class CommonController extends WebAction
)));
}
}
while
(
false
);
}
while
(
false
);
if
(
empty
(
$userInfo
))
{
$this
->
helpJsonCallbackResult
(
$callback
,
403
,
'User info'
,
''
);
$this
->
helpJsonCallbackResult
(
$callback
,
403
,
'User info'
,
''
);
}
else
{
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'User info'
,
$userInfo
);
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'User info'
,
$userInfo
);
}
}
...
...
@@ -335,12 +335,12 @@ class CommonController extends WebAction
}
foreach
(
$productInfo
as
$val
)
{
$sknArray
=
explode
(
'-'
,
$val
);
$skn
[]
=
$sknArray
[
0
];
$skn
[]
=
$sknArray
[
0
];
}
$skn
=
array_slice
(
$skn
,
0
,
$limit
);
$skn
=
array_slice
(
$skn
,
0
,
$limit
);
$result
=
SearchModel
::
historyProduct
(
$skn
,
$limit
);
}
while
(
false
);
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'User info'
,
$result
);
}
while
(
false
);
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'User info'
,
$result
);
}
/**
...
...
@@ -353,7 +353,7 @@ class CommonController extends WebAction
$uid
=
$this
->
getUid
(
true
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
CartModel
::
shoppingCart
(
$uid
,
$shoppingKey
);
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'shoppingCart'
,
$result
);
$this
->
helpJsonCallbackResult
(
$callback
,
200
,
'shoppingCart'
,
$result
);
}
/**
...
...
@@ -374,13 +374,13 @@ class CommonController extends WebAction
$this
->
helpJsonCallbackResult
(
$callback
,
$result
[
'code'
],
$result
[
'message'
],
''
);
}
}
/**
* 选择支付时,时间间隔校验插入
*/
/**
* 选择支付时,时间间隔校验插入
*/
public
function
addPaymentIntervalAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
$data
=
array
(
'code'
=>
400
,
'message'
=>
''
,
'data'
=>
''
);
do
{
if
(
!
$this
->
isAjax
())
{
...
...
@@ -388,16 +388,16 @@ class CommonController extends WebAction
}
$uid
=
$this
->
getUid
(
TRUE
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
$payment
=
$this
->
get
(
'payment'
,
0
);
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
$payment
=
$this
->
get
(
'payment'
,
0
);
if
(
!
$uid
||
!
$orderCode
||
!
$payment
)
{
break
;
}
$res
=
CartData
::
savePrePayInfo
(
$uid
,
$orderCode
,
$payment
);
$data
=
array
(
'code'
=>
$res
[
'code'
],
'message'
=>
$res
[
'message'
],
'data'
=>
$res
[
'data'
]);
$data
=
array
(
'code'
=>
$res
[
'code'
],
'message'
=>
$res
[
'message'
],
'data'
=>
$res
[
'data'
]);
}
while
(
false
);
$this
->
echoJson
(
$data
);
...
...
Please
register
or
login
to post a comment