Merge branch 'feature/customerServiceSwitch'
Showing
13 changed files
with
59 additions
and
10 deletions
compile/www.yohobuy.com/5.3.1/test.php
0 → 100644
@@ -71,8 +71,16 @@ class AbstractAction extends Controller_Abstract | @@ -71,8 +71,16 @@ class AbstractAction extends Controller_Abstract | ||
71 | $this->_useSession = false; | 71 | $this->_useSession = false; |
72 | break; | 72 | break; |
73 | } | 73 | } |
74 | + | ||
75 | + //读取客服开关配置 | ||
76 | + $customerServiceSwitch = $this->getCustomerServiceSwitch(); | ||
77 | + $this->_view->assign('customerServiceSwitch', $customerServiceSwitch); | ||
74 | } | 78 | } |
75 | 79 | ||
80 | + //客服配置 | ||
81 | + protected function getCustomerServiceSwitch() { | ||
82 | + return $this->_useSession && empty($this->getCache('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client'; | ||
83 | + } | ||
76 | /** | 84 | /** |
77 | * 封装一下获取get参数 | 85 | * 封装一下获取get参数 |
78 | * | 86 | * |
@@ -289,6 +297,22 @@ class AbstractAction extends Controller_Abstract | @@ -289,6 +297,22 @@ class AbstractAction extends Controller_Abstract | ||
289 | } | 297 | } |
290 | 298 | ||
291 | /** | 299 | /** |
300 | + * 直接查询缓存,不对key做任何处理<php与node cache对接> | ||
301 | + * | ||
302 | + * @param string $key 键名 | ||
303 | + * @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存 | ||
304 | + * @return mixed | ||
305 | + */ | ||
306 | + protected function getCacheBy($key, $isMaster = true) | ||
307 | + { | ||
308 | + if ($isMaster) { | ||
309 | + return Cache::getBy($key, 'master'); | ||
310 | + } else { | ||
311 | + return Cache::getBy($key, 'slave'); | ||
312 | + } | ||
313 | + } | ||
314 | + | ||
315 | + /** | ||
292 | * 设置Session | 316 | * 设置Session |
293 | * | 317 | * |
294 | * @param string $name 名称 | 318 | * @param string $name 名称 |
@@ -83,12 +83,21 @@ class WebAction extends Controller_Abstract | @@ -83,12 +83,21 @@ class WebAction extends Controller_Abstract | ||
83 | break; | 83 | break; |
84 | } | 84 | } |
85 | 85 | ||
86 | + //读取客服开关配置 | ||
87 | + $customerServiceSwitch = $this->getCustomerServiceSwitch(); | ||
88 | + $this->_view->assign('customerServiceSwitch', $customerServiceSwitch); | ||
89 | + | ||
86 | //自动登录 | 90 | //自动登录 |
87 | if (!$isAjax) { | 91 | if (!$isAjax) { |
88 | $this->autoLogin(); | 92 | $this->autoLogin(); |
89 | } | 93 | } |
90 | } | 94 | } |
91 | 95 | ||
96 | + //客服配置 | ||
97 | + protected function getCustomerServiceSwitch() { | ||
98 | + return $this->_useSession && empty($this->getCache('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client'; | ||
99 | + } | ||
100 | + | ||
92 | /** | 101 | /** |
93 | * 自动登录 | 102 | * 自动登录 |
94 | */ | 103 | */ |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | <div class="return-prompt"> | 14 | <div class="return-prompt"> |
15 | 换货须知:<br> | 15 | 换货须知:<br> |
16 | <p>自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下(包括产品吊牌和外包装),YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。<span>特别提醒:非质量问题的退换货,来回运费由您承担。寄回商品时需垫付运费,到付件无法签收。</span>换货后VIP积分累计时间重新计算,以您收到换货订单后15个工作日累加,如有疑问,请联系 <a | 16 | <p>自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下(包括产品吊牌和外包装),YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。<span>特别提醒:非质量问题的退换货,来回运费由您承担。寄回商品时需垫付运费,到付件无法签收。</span>换货后VIP积分累计时间重新计算,以您收到换货订单后15个工作日累加,如有疑问,请联系 <a |
17 | - href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=" target="_blank"><i class="icon-onlineservice"></i> 在线客服</a></p> | 17 | + href="{{@root.customerServiceSwitch}}" target="_blank"><i class="icon-onlineservice"></i> 在线客服</a></p> |
18 | {{# tips}} | 18 | {{# tips}} |
19 | {{> home/return-tips}} | 19 | {{> home/return-tips}} |
20 | {{/ tips}} | 20 | {{/ tips}} |
@@ -148,7 +148,7 @@ | @@ -148,7 +148,7 @@ | ||
148 | <div class="return-prompt"> | 148 | <div class="return-prompt"> |
149 | 退货须知:<br> | 149 | 退货须知:<br> |
150 | <p>自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下(包括产品吊牌和外包装),YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。如您退货之后无法满足购买时参加的活动条件,请您将赠品同时申请退货。<span>特别提醒:非质量问题的退换货,来回运费由您承担,寄回商品时需垫付运费,到付件无法签收,如有疑问,请联系 <a | 150 | <p>自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下(包括产品吊牌和外包装),YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。如您退货之后无法满足购买时参加的活动条件,请您将赠品同时申请退货。<span>特别提醒:非质量问题的退换货,来回运费由您承担,寄回商品时需垫付运费,到付件无法签收,如有疑问,请联系 <a |
151 | - href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=" target="_blank"><i class="icon-onlineservice"></i> 在线客服</a> </span></p> | 151 | + href="{{@root.customerServiceSwitch}}" target="_blank"><i class="icon-onlineservice"></i> 在线客服</a> </span></p> |
152 | {{# tips}} | 152 | {{# tips}} |
153 | {{> home/returns-tips}} | 153 | {{> home/returns-tips}} |
154 | {{/ tips}} | 154 | {{/ tips}} |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | <input type="submit" class="search-btn"> | 22 | <input type="submit" class="search-btn"> |
23 | </label> | 23 | </label> |
24 | <span>或者</span> | 24 | <span>或者</span> |
25 | - <a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409" target="_blank" class="yoho-im-btn"></a> | 25 | + <a href="{{@root.customerServiceSwitch}}" target="_blank" class="yoho-im-btn"></a> |
26 | </form> | 26 | </form> |
27 | </div> | 27 | </div> |
28 | <h2>所有问题一览</h2> | 28 | <h2>所有问题一览</h2> |
@@ -189,7 +189,7 @@ | @@ -189,7 +189,7 @@ | ||
189 | </div> | 189 | </div> |
190 | <div class="left"> | 190 | <div class="left"> |
191 | <span class="iconfont rgbf"></span> | 191 | <span class="iconfont rgbf"></span> |
192 | - <a href="http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409" target="_blank"> | 192 | + <a href="{{@root.customerServiceSwitch}}" target="_blank"> |
193 | <span class="red">便捷</span> | 193 | <span class="red">便捷</span> |
194 | <span class="rgbf">在线客服</span> | 194 | <span class="rgbf">在线客服</span> |
195 | </a> | 195 | </a> |
@@ -250,6 +250,18 @@ class ToolsController extends WebAction | @@ -250,6 +250,18 @@ class ToolsController extends WebAction | ||
250 | echo 'skn不正确'; | 250 | echo 'skn不正确'; |
251 | } | 251 | } |
252 | } | 252 | } |
253 | + | ||
254 | + public function secretSwitchAction() | ||
255 | + { | ||
256 | + $val = intval($this->get('enabled', -1)); | ||
257 | + echo $val; | ||
258 | + if ($val === -1) { | ||
259 | + return false; | ||
260 | + } | ||
261 | + Cache::set('customerServiceSwitch', $val === 1, 0); | ||
262 | + | ||
263 | + var_dump(Cache::get('customerServiceSwitch')); | ||
264 | + } | ||
253 | } | 265 | } |
254 | 266 | ||
255 | ?> | 267 | ?> |
@@ -9,6 +9,7 @@ use Configs\ChannelConfig; | @@ -9,6 +9,7 @@ use Configs\ChannelConfig; | ||
9 | use WebPlugin\Helpers; | 9 | use WebPlugin\Helpers; |
10 | use WebPlugin\Images; | 10 | use WebPlugin\Images; |
11 | use LibModels\Web\Home\MessageData; | 11 | use LibModels\Web\Home\MessageData; |
12 | +use WebPlugin\Cache; | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * 个人中心-用户相关业务逻辑处理 | 15 | * 个人中心-用户相关业务逻辑处理 |
@@ -43,6 +44,9 @@ class UserModel | @@ -43,6 +44,9 @@ class UserModel | ||
43 | return $retNav; | 44 | return $retNav; |
44 | } | 45 | } |
45 | 46 | ||
47 | + public static function getCustomerServiceSwitch() { | ||
48 | + return USE_CACHE && empty(Cache::get('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client'; | ||
49 | + } | ||
46 | /** | 50 | /** |
47 | * 个人中心-左侧导航 | 51 | * 个人中心-左侧导航 |
48 | * @param string $activeName 当前选中导航的名称 | 52 | * @param string $activeName 当前选中导航的名称 |
@@ -106,7 +110,7 @@ class UserModel | @@ -106,7 +110,7 @@ class UserModel | ||
106 | ), | 110 | ), |
107 | array( | 111 | array( |
108 | 'name' => '在线客服', | 112 | 'name' => '在线客服', |
109 | - 'href' => 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=', | 113 | + 'href' => self::getCustomerServiceSwitch(), |
110 | 'isBlank'=>true | 114 | 'isBlank'=>true |
111 | ) | 115 | ) |
112 | ) | 116 | ) |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "5.3.0" | 53 | +application.version = "5.3.1" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "5.3.0" | 53 | +application.version = "5.3.1" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "5.3.0" | 53 | +application.version = "5.3.1" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "5.3.0" | 53 | +application.version = "5.3.1" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
-
Please register or login to post a comment