Authored by Rock Zhang

添加时候需要微信分享标志位

Code Review By Rock Zhang
... ... @@ -132,7 +132,7 @@ class YuanxiaoController extends HuodongAction
$this->_view->display('result', array(
'staticTitle' => '元宵抽签',
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
'needShare' => $this->checkNeedShare(), // 是否需要微信分享
'staticFile' => self::STATIC_FILE,
'result' => $result,
'shareUrl' => $shareUrl,
... ... @@ -187,6 +187,19 @@ class YuanxiaoController extends HuodongAction
}
/**
* 判断是否需要微信分享
* @return bool
*/
private function checkNeedShare()
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false || $this->_isApp) {
return true;
}
return false;
}
/**
* 加密字符串
*
* @param string $data 需要加密的字符串
... ...