Authored by 郭成尧

Merge branch 'feature/balanceSwitch' into gray

... ... @@ -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 名称
... ...
... ... @@ -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 名称
... ...
... ... @@ -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)) {
... ...
... ... @@ -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
... ...
... ... @@ -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
... ...