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
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
9b532a316770bcfbd3c10ddb6ac52bdeab58f49a
2 parents
159f19ef
2c6cf784
Merge branch 'feature/balanceSwitch' into gray
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
3 deletions
library/Action/AbstractAction.php
library/Action/WebAction.php
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/configs/routes.index.ini
library/Action/AbstractAction.php
View file @
9b532a3
...
...
@@ -295,6 +295,26 @@ class AbstractAction extends Controller_Abstract
}
/**
* 直接查询缓存,不对key做任何处理
*
* @param string $key 键名
* @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存
* @return mixed
*/
protected
function
getCacheBy
(
$key
,
$isMaster
=
true
)
{
if
(
!
USE_CACHE
)
{
return
false
;
}
if
(
$isMaster
)
{
return
Cache
::
getBy
(
$key
,
'master'
);
}
else
{
return
Cache
::
getBy
(
$key
,
'slave'
);
}
}
/**
* 设置Session
*
* @param string $name 名称
...
...
library/Action/WebAction.php
View file @
9b532a3
...
...
@@ -339,6 +339,22 @@ class WebAction extends Controller_Abstract
}
/**
* 直接查询缓存,不对key做任何处理
*
* @param string $key 键名
* @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存
* @return mixed
*/
protected
function
getCacheBy
(
$key
,
$isMaster
=
true
)
{
if
(
$isMaster
)
{
return
Cache
::
getBy
(
$key
,
'master'
);
}
else
{
return
Cache
::
getBy
(
$key
,
'slave'
);
}
}
/**
* 设置Session
*
* @param string $name 名称
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
9b532a3
...
...
@@ -975,6 +975,17 @@ class HomeController extends AbstractAction
$this
->
error
();
}
// 如果新版开启,则跳到新版支付页
/*if ($this->getCacheBy('zookeeper:/wap/pay/newPay') === 'true') {
header('Location: ' . Helpers::url('/home/orders/paynew',
array(
'order_code' => $orderCode,
'refer' => $this->server('HTTP_REFERER', SITE_MAIN)
))
);
exit();
}*/
/* 判断订单信息是否存在 */
$orderDetail
=
OrderModel
::
orderDetail
(
$orderCode
,
$this
->
_uid
,
$this
->
_usession
);
if
(
empty
(
$orderDetail
))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
9b532a3
...
...
@@ -48,6 +48,17 @@ class IndexController extends AbstractAction
public
function
indexAction
()
{
// 如果新版开启,则跳到新版购物车
if
(
$this
->
getCacheBy
(
'zookeeper:/wap/pay/newCart'
)
===
'true'
)
{
header
(
'Location: '
.
Helpers
::
url
(
'/cart/index/new'
,
array
(
'refer'
=>
$this
->
server
(
'HTTP_REFERER'
,
SITE_MAIN
)
))
);
exit
();
}
$this
->
setTitle
(
'购物车'
);
//$this->setNavHeader('购物车', true, '');
// 显示底部TAB
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
9b532a3
...
...
@@ -189,8 +189,15 @@ routes.cart.route.action = Orderdetail
;routes.weixinapi.route.action = Weixinapi
; 支付中心 (微信中配置的目录)
routes.pay.type
=
"rewrite"
routes.pay.match
=
"/home/orders/pay$"
routes.pay.type
=
"regex"
routes.pay.match
=
"#^/home/orders/pay#"
routes.pay.route.module
=
Index
routes.pay.route.controller
=
Home
routes.pay.route.action
=
Pay
\ No newline at end of file
routes.pay.route.action
=
Pay
; 支付中心 (微信中配置的目录)
routes.newcart.type
=
"rewrite"
routes.newcart.match
=
"/cart/index/new/orderEnsure$"
routes.newcart.route.module
=
Cart
routes.newcart.route.controller
=
Index
routes.newcart.route.action
=
orderEnsure
\ No newline at end of file
...
...
Please
register
or
login
to post a comment