Authored by hf

code review by fei.hong: do add couponxinshili huodong

Showing 30 changed files with 1438 additions and 0 deletions
  1 +<?php
  2 +
  3 +/**
  4 + * 所有Controller控制器的基类
  5 + *
  6 + * @name HuodongAction
  7 + * @package library
  8 + * @copyright yoho.inc
  9 + * @version 1.0 (2015-11-27 14:40:21)
  10 + * @author fei.hong <fei.hong@yoho.cn>
  11 + */
  12 +
  13 +namespace Action;
  14 +
  15 +use Yaf\Controller_Abstract;
  16 +use Yaf\Dispatcher;
  17 +use Yaf\Application;
  18 +use Plugin\Cache;
  19 +use Hood\Session;
  20 +use WebPlugin\Mobile;
  21 +
  22 +class HuodongWebAction extends Controller_Abstract
  23 +{
  24 +
  25 + /**
  26 + * HTTP请求对象
  27 + *
  28 + * @var object
  29 + */
  30 + protected $_request;
  31 +
  32 + /**
  33 + * 用户相关信息
  34 + */
  35 + protected $_uid = 0;
  36 + protected $_uname = '';
  37 +
  38 + /**
  39 + * 存放模板数据
  40 + *
  41 + * @var array
  42 + */
  43 + protected $_data;
  44 +
  45 + /**
  46 + * 是否是APP访问
  47 + *
  48 + * @var bool
  49 + */
  50 + protected $_isApp;
  51 +
  52 + /**
  53 + * 初始化
  54 + */
  55 + public function init()
  56 + {
  57 + if (!$this->isAjax() && Mobile::isMobile()) {
  58 + echo 'ddd'; exit;
  59 + header("HTTP/1.1 301 Moved Permanently");
  60 + header('Location:http://huodong.m.yohobuy.com'.$_SERVER['REQUEST_URI']);
  61 + exit();
  62 + }
  63 +
  64 + $this->_request = $this->getRequest();
  65 +
  66 + $config = Application::app()->getConfig()->get('application');
  67 + if (isset($config->js->url)) {
  68 + $this->_view->assign('jsUrl', $config->js->url);
  69 + }
  70 + if (isset($config->css->url)) {
  71 + $this->_view->assign('cssUrl', $config->css->url);
  72 + }
  73 + if (isset($config->css->url)) {
  74 + $this->_view->assign('imgUrl', $config->img->url);
  75 + }
  76 +
  77 + $this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid'));
  78 + }
  79 +
  80 + /**
  81 + * 封装一下获取get参数
  82 + *
  83 + * @param String $key
  84 + * @param mixed $default
  85 + * @return mixed
  86 + */
  87 + protected function get($key = null, $default = null)
  88 + {
  89 + if (null === $key) {
  90 + return $_GET;
  91 + }
  92 + return $this->_request->getQuery($key, $default);
  93 + }
  94 +
  95 + /**
  96 + * 封装一下获取post参数
  97 + *
  98 + * @param String $key
  99 + * @param mixed $default
  100 + * @return mixed
  101 + */
  102 + protected function post($key = null, $default = null)
  103 + {
  104 + if (null === $key) {
  105 + return $_POST;
  106 + }
  107 + return $this->_request->getPost($key, $default);
  108 + }
  109 +
  110 + /**
  111 + * 封装一下获取YAF内部的参数
  112 + *
  113 + * @param String $key
  114 + * @param mixed $default
  115 + * @return mixed
  116 + */
  117 + protected function param($key, $default = null)
  118 + {
  119 + return $this->_request->getParam($key, $default);
  120 + }
  121 +
  122 + /**
  123 + * 封装一下获取服务器的参数
  124 + *
  125 + * @param String $key
  126 + * @param mixed $default
  127 + * @return mixed
  128 + */
  129 + protected function server($key, $default = null)
  130 + {
  131 + return $this->_request->getServer($key, $default);
  132 + }
  133 +
  134 + /**
  135 + * 关闭模板自动渲染
  136 + *
  137 + * @return void
  138 + */
  139 + protected function disableView()
  140 + {
  141 + Dispatcher::getInstance()->autoRender(false);
  142 + }
  143 +
  144 + /**
  145 + * 输出JSON数据到浏览器
  146 + *
  147 + * @return void
  148 + */
  149 + protected function echoJson($json)
  150 + {
  151 + headers_sent() || header('Content-Type: application/json; charset=utf-8;');
  152 +
  153 + if (is_array($json)) {
  154 + $json = json_encode($json);
  155 + }
  156 +
  157 + echo $json;
  158 + }
  159 +
  160 + /**
  161 + * 返回JSON数据
  162 + *
  163 + * @param int $code 状态编码
  164 + * @param string $message 提示信息
  165 + * @param mixed $data 数据内容
  166 + * @return json
  167 + */
  168 + protected function returnJson($code, $message, $data)
  169 + {
  170 + return json_encode(array(
  171 + 'code' => $code,
  172 + 'message' => $message,
  173 + 'data' => $data,
  174 + ));
  175 + }
  176 +
  177 + /**
  178 + * 判断是不是AJAX请求
  179 + *
  180 + * @return bool
  181 + */
  182 + protected function isAjax()
  183 + {
  184 + return $this->_request->isXmlHttpRequest();
  185 + }
  186 +
  187 + /**
  188 + * 跳转到错误页面
  189 + */
  190 + protected function error()
  191 + {
  192 + headers_sent() || header('Location: /error.html');
  193 +
  194 + exit();
  195 + }
  196 +
  197 + /**
  198 + * 跳转到指定的URL
  199 + *
  200 + * @param string $url 链接地址
  201 + * @return void
  202 + */
  203 + protected function go($url)
  204 + {
  205 + headers_sent() || header('Location: ' . $url);
  206 +
  207 + exit();
  208 + }
  209 +
  210 + /**
  211 + * 设置Cookie
  212 + *
  213 + * @param string $name cookie的名字
  214 + * @param string $value cookie的值
  215 + * @param integer $expire cookie过期时间
  216 + * @param integer $path cookie可用的路径
  217 + * @param string $domain cookie可用域名
  218 + */
  219 + protected function setCookie($name, $value, $expire = 0, $path = '/', $domain = '.yohobuy.com')
  220 + {
  221 + setcookie($name, $value, $expire, $path, $domain);
  222 + }
  223 +
  224 + /**
  225 + * 返回Cookie变量
  226 + *
  227 + * @param string $name cookie名称
  228 + * @param string $default 未获取到返回的默认值
  229 + * @return string 获取到的cookie值
  230 + */
  231 + protected function getCookie($name, $default = '')
  232 + {
  233 + return $this->_request->getCookie($name, $default);
  234 + }
  235 +
  236 + /**
  237 + * 设置缓存
  238 + *
  239 + * @param string $key 键名
  240 + * @param mixed $value 需要缓存的数据
  241 + * @param int $expire 缓存有效期(单位秒, 0表示永久)
  242 + * @return void
  243 + */
  244 + protected function setCache($key, $value, $expire)
  245 + {
  246 + Cache::set($key, $value, $expire);
  247 + }
  248 +
  249 + /**
  250 + * 获取缓存
  251 + *
  252 + * @param string $key 键名
  253 + * @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存
  254 + * @return mixed
  255 + */
  256 + protected function getCache($key, $isMaster = true)
  257 + {
  258 + if ($isMaster) {
  259 + return Cache::get($key, 'master');
  260 + } else {
  261 + return Cache::get($key, 'slave');
  262 + }
  263 + }
  264 +
  265 + /**
  266 + * 设置Session
  267 + *
  268 + * @param string $name 名称
  269 + * @param mixed $value 值
  270 + * @return void
  271 + */
  272 + public function setSession($name, $value)
  273 + {
  274 + Session::start('yohobuy_session', null, 'yohobuy.com')->__set($name, $value);
  275 + }
  276 +
  277 + /**
  278 + * 获取Session
  279 + *
  280 + * @param string $name 名称
  281 + */
  282 + public function getSession($name)
  283 + {
  284 + return Session::start('yohobuy_session', null, 'yohobuy.com')->__get($name);
  285 + }
  286 +
  287 + /**
  288 + * 获取当前登录的用户ID
  289 + *
  290 + * @return int
  291 + * @todo
  292 + */
  293 + protected function getUid()
  294 + {
  295 + if (!$this->_uid) {
  296 + $cookie = $this->getCookie('_UID');
  297 + if (!empty($cookie)) {
  298 + $cookieList = explode('::', $cookie);
  299 + if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
  300 + $this->_uid = $cookieList[1];
  301 + $this->_uname = $cookieList[0];
  302 + }
  303 + }
  304 + }
  305 + return $this->_uid;
  306 + }
  307 +
  308 + /**
  309 + * 获取客户端唯一标识
  310 + *
  311 + * @return string
  312 + */
  313 + protected function getUdid()
  314 + {
  315 + $udid = '';
  316 +
  317 + $realIP = $this->_request->getServer('HTTP_X_REAL_IP');
  318 + if ($realIP) {
  319 + $udid = md5($realIP);
  320 + } else {
  321 + $realIP = $this->_request->getServer('REMOTE_ADDR', '');
  322 + $udid = md5($realIP);
  323 + }
  324 +
  325 + return $udid;
  326 + }
  327 +
  328 + /*
  329 + * 设置网站SEO的标题
  330 + *
  331 + * @param string $title 标题
  332 + * @param string $sign 连接的字符串
  333 + * @param bool $showMore 是否显示更多内容
  334 + * @return void
  335 + */
  336 + protected function setTitle($title, $showMore = true, $sign = ' | ')
  337 + {
  338 + $this->_view->assign('title_more', $showMore);
  339 + $this->_view->assign('title', $title . $sign);
  340 + }
  341 +
  342 + /**
  343 + * 设置网站SEO的关键词
  344 + *
  345 + * @param string $keywords 关键词,多个之间用","逗号分隔
  346 + * @return void
  347 + */
  348 + protected function setKeywords($keywords)
  349 + {
  350 + $this->_view->assign('keywords', rtrim($keywords, ',') . ',');
  351 + }
  352 +
  353 + /**
  354 + * 设置网站SEO的描述内容
  355 + *
  356 + * @param string $description 描述内容
  357 + * @param string $sign 连接的字符串
  358 + * @param bool $showMore 是否显示更多内容
  359 + * @return void
  360 + */
  361 + protected function setDescription($description, $showMore = true, $sign = ' ')
  362 + {
  363 + $this->_view->assign('description_more', $showMore);
  364 + $this->_view->assign('description', $description . $sign);
  365 + }
  366 +
  367 + /**
  368 + * 设置最后修改时间
  369 + *
  370 + * @param string $modifiedTime 修改时间戳
  371 + * @param type $notModifiedExit 是否在没有修改时返回304状态
  372 + * @return void
  373 + */
  374 + public static function setLastModified($modifiedTime, $notModifiedExit = true)
  375 + {
  376 + $modifiedTime = date('D, d M Y H:i:s ', $modifiedTime) . 'GMT';
  377 + if ($notModifiedExit && isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $modifiedTime == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
  378 + header('HTTP/1.1 304 Not Modified');
  379 + exit();
  380 + }
  381 + header('Last-Modified: ' . $modifiedTime);
  382 + }
  383 +
  384 + /**
  385 + * 设置浏览器的缓存
  386 + *
  387 + * @param int $seconds 单位是秒
  388 + * @return void
  389 + */
  390 + public static function setExpires($seconds = 180)
  391 + {
  392 + $time = date('D, d M Y H:i:s ', time() + $seconds) . 'GMT';
  393 +
  394 + header('Expires: ' . $time);
  395 + }
  396 +
  397 +}
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5 + <meta charset="utf-8">
  6 + <title>{{staticTitle}}</title>
  7 + <link rel="stylesheet" href="{{staticFile}}/css/style.css">
  8 +</head>
  9 +<body>
  10 + <div class="main-wrap home">
  11 + <div class="header"></div>
  12 + <div class="coupon">
  13 + </div>
  14 + <a class="go" href="{{couponUrl}}">
  15 + 去看看 <span class="arrow"></span>
  16 + </a>
  17 + <div class="share">
  18 + </div>
  19 + <a class="banner" href="{{banner.url}}">
  20 + <img src="{{banner.img}}">
  21 + </a>
  22 + <div class="footer">
  23 + </div>
  24 + </div>
  25 + <div class="tip hide fail">
  26 + <div class="title">
  27 + 领取失败<br>
  28 + 请刷新重新领取
  29 + </div>
  30 + <div class="desc">
  31 + 如多次领取失败,请联系客服人员<br>
  32 + 带来不便敬请谅解
  33 + </div>
  34 + <a class="button" href="">
  35 + 刷新
  36 + </a>
  37 + </div>
  38 + <div class="tip hide geted">
  39 + <div class="title">
  40 + 你已领取过优惠券
  41 + </div>
  42 + <div class="sub-title">
  43 + 快去分享给更多<br>
  44 + 喜爱<span class="title">潮流</span>的小伙伴吧!
  45 + </div>
  46 + <a class="button close" href="">
  47 + 返回
  48 + </a>
  49 + </div>
  50 +<script type="text/javascript" src="{{staticFile}}/js/libs.js"></script>
  51 +{{# staticJS}}
  52 +<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
  53 +{{/ staticJS}}
  54 +</body>
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5 + <meta charset="utf-8">
  6 + <title>{{staticTitle}}</title>
  7 + <link rel="stylesheet" href="{{staticFile}}/css/style.css">
  8 +</head>
  9 +<body>
  10 + <div class="main-wrap home">
  11 + <div class="header"></div>
  12 + <div class="coupon">
  13 + </div>
  14 + <a class="go" href="{{couponUrl}}">
  15 + 去看看 <span class="arrow"></span>
  16 + </a>
  17 + <div class="share">
  18 + </div>
  19 + <a class="banner" href="{{banner.url}}">
  20 + <img src="{{banner.img}}">
  21 + </a>
  22 + <div class="footer">
  23 + </div>
  24 + </div>
  25 + <div class="tip hide fail">
  26 + <div class="title">
  27 + 领取失败<br>
  28 + 请刷新重新领取
  29 + </div>
  30 + <div class="desc">
  31 + 如多次领取失败,请联系客服人员<br>
  32 + 带来不便敬请谅解
  33 + </div>
  34 + <a class="button" href="">
  35 + 刷新
  36 + </a>
  37 + </div>
  38 + <div class="tip hide geted">
  39 + <div class="title">
  40 + 你已领取过优惠券
  41 + </div>
  42 + <div class="sub-title">
  43 + 快去分享给更多<br>
  44 + 喜爱<span class="title">潮流</span>的小伙伴吧!
  45 + </div>
  46 + <a class="button close" href="">
  47 + 返回
  48 + </a>
  49 + </div>
  50 +<script type="text/javascript" src="{{staticFile}}/js/libs.js"></script>
  51 +{{# staticJS}}
  52 +<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
  53 +{{/ staticJS}}
  54 +</body>
  1 +<!-- Google Tag Manager -->
  2 +<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  3 +<script>
  4 + var _hmt = _hmt || [];
  5 + function async_load(){
  6 + (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  7 + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  8 + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  9 + '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  10 + })(window,document,'script','dataLayer','GTM-W958MG');
  11 + (function() {
  12 + var hm = document.createElement("script");
  13 + hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
  14 + hm.async = 1;
  15 + var s = document.getElementsByTagName("script")[0];
  16 + s.parentNode.insertBefore(hm, s);
  17 + })();
  18 + (function() {
  19 + var hm = document.createElement("script");
  20 + hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
  21 + hm.async = 1;
  22 + var s = document.getElementsByTagName("script")[0];
  23 + s.parentNode.insertBefore(hm, s);
  24 + })();
  25 + (function() {
  26 + var hm = document.createElement("script");
  27 + hm.src = "//hm.baidu.com/hm.js?e5b83a487a4458aa5abca43f5779b764";
  28 + var s = document.getElementsByTagName("script")[0];
  29 + s.parentNode.insertBefore(hm, s);
  30 + })();
  31 + }
  32 + window.addEventListener('load', async_load, false);
  33 +</script>
  1 +<?php
  2 +
  3 +/**
  4 + * 启动运行
  5 + *
  6 + * @name Bootstrap
  7 + * @author fei.hong
  8 + * @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用,
  9 + * @see http://www.php.net/manual/en/class.yaf-bootstrap-abstract.php
  10 + * 这些方法, 都接受一个参数:Yaf_Dispatcher $dispatcher
  11 + * 调用的次序, 和申明的次序相同
  12 + */
  13 +use Yaf\Bootstrap_Abstract;
  14 +use Yaf\Dispatcher;
  15 +use Yaf\Application;
  16 +use Yaf\Registry;
  17 +use Yaf\Loader;
  18 +use Yaf\Config;
  19 +use WebPlugin\TemplateLayout;
  20 +
  21 +class Bootstrap extends Bootstrap_Abstract
  22 +{
  23 +
  24 + private $_config;
  25 +
  26 + /**
  27 + * 初始化配置
  28 + * @param Yaf_Dispatcher $dispatcher
  29 + */
  30 + public function _initConfig(Dispatcher $dispatcher)
  31 + {
  32 + define('REQUEST_METHOD', strtoupper($dispatcher->getRequest()->getMethod()));
  33 + $this->_config = Application::app()->getConfig();
  34 + Registry::set('appConfig', $this->_config);
  35 + }
  36 +
  37 + /**
  38 + * 初始化应用
  39 + * @param Yaf_Dispatcher $dispatcher
  40 + */
  41 + public function _initApplication(Dispatcher $dispatcher)
  42 + {
  43 + defined('APPLICATION_SYSTEM_CONFIG') || define('APPLICATION_SYSTEM_CONFIG', $this->_config->application->servers->config);
  44 + if (APPLICATION_ENV !== 'production') {
  45 + error_reporting(E_ALL);
  46 + ini_set('display_startup_errors', 1);
  47 + ini_set('display_errors', 1);
  48 + }
  49 + Loader::getInstance()->registerLocalNameSpace(explode(',', $this->_config->application->namespaces));
  50 + }
  51 +
  52 +// /**
  53 +// * 初始化插件
  54 +// * @param Yaf_Dispatcher $dispatcher
  55 +// */
  56 +// public function _initPlugin(Dispatcher $dispatcher)
  57 +// {
  58 +//
  59 +// }
  60 +
  61 + /**
  62 + * 初始化路由
  63 + * @param Yaf_Dispatcher $dispatcher
  64 + */
  65 + public function _initRoute(Dispatcher $dispatcher)
  66 + {
  67 + /* 根据对应模块的配置,添加相应的路由规则 */
  68 + $iniFile = APPLICATION_PATH . '/configs/routes.index.ini';
  69 + if (file_exists($iniFile)) {
  70 + $config = new Config\Ini($iniFile);
  71 + if (isset($config->routes)) {
  72 + $dispatcher->getRouter()->addConfig($config->routes);
  73 + }
  74 + }
  75 + }
  76 +
  77 + /**
  78 + * 初始化Layout
  79 + * @param Yaf_Dispatcher $dispatcher
  80 + */
  81 + public function _initLayout(Dispatcher $dispatcher)
  82 + {
  83 + // 关闭自动渲染模板
  84 + $dispatcher->autoRender(false);
  85 +
  86 + // 判断到不是AJAX请求时, 使用自定义的模板渲染 (Mustache or Handlebars)
  87 + //if (!$dispatcher->getRequest()->isXmlHttpRequest()) {
  88 + $layout = new TemplateLayout();
  89 + $layout->setScriptPath($this->_config->application->template->path);
  90 + $dispatcher->setView($layout);
  91 + //}
  92 + }
  93 +
  94 +// /**
  95 +// * 初始化第三方包
  96 +// * @param Dispatcher $dispatcher
  97 +// */
  98 +// public function _initPackage(Dispatcher $dispatcher)
  99 +// {
  100 +// if ($this->_config->composer->autoload == 1) {
  101 +// require $this->_config->composer->path . '/vendor/autoload.php';
  102 +// }
  103 +// }
  104 +}
  1 +<?php
  2 +
  3 +/**
  4 + * 错误错误控制器
  5 + *
  6 + * @name ErrorController
  7 + * @desc 错误控制器, 在发生未捕获的异常时刻被调用
  8 + * @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
  9 + */
  10 +use Action\AbstractAction;
  11 +
  12 +class ErrorController extends AbstractAction
  13 +{
  14 +
  15 + public function indexAction()
  16 + {
  17 + header('HTTP/1.1 404 Not Found');
  18 + header('Status: 404 Not Found');
  19 + exit();
  20 + }
  21 +
  22 + public function errorAction($exception)
  23 + {
  24 + header('HTTP/1.1 404 Not Found');
  25 + header('Status: 404 Not Found');
  26 +
  27 + exit();
  28 + }
  29 +
  30 +}
  1 +<?php
  2 +
  3 +use Action\AbstractAction;
  4 +
  5 +/**
  6 + * 跳转
  7 + */
  8 +class GoController extends AbstractAction
  9 +{
  10 +
  11 + /**
  12 + * 跳转PC或WAP
  13 + */
  14 + public function indexAction()
  15 + {
  16 + $pc = $this->get('pc', 'http://www.yohobuy.com');
  17 + $wap = $this->get('wap', 'http://m.yohobuy.com');
  18 +
  19 + $pc = rawurldecode($pc);
  20 + $wap = rawurldecode($wap);
  21 +
  22 + // 苹果设备
  23 + if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
  24 + $this->go($wap);
  25 + }
  26 + // 苹果IPAD
  27 + elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
  28 + $this->go($pc);
  29 + }
  30 + // 安卓设备
  31 + elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'Android')) {
  32 + $this->go($wap);
  33 + }
  34 + // 其它
  35 + else {
  36 + $this->go($pc);
  37 + }
  38 + }
  39 +
  40 +}
  1 +<?php
  2 +
  3 +use Action\AbstractAction;
  4 +use Plugin\Helpers;
  5 +
  6 +/**
  7 + * 默认
  8 + */
  9 +class IndexController extends AbstractAction
  10 +{
  11 +
  12 + /**
  13 + * 首页
  14 + */
  15 + public function indexAction()
  16 + {
  17 + exit();
  18 + }
  19 +
  20 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: Administrator
  5 + * Date: 2016/3/2
  6 + * Time: 10:53
  7 + */
  8 +namespace Cuxiao;
  9 +use LibModels\Wap\Cuxiao\ActivityData;
  10 +
  11 +
  12 +class GirldayModel
  13 +{
  14 + /**
  15 + * 获取领券活动结果
  16 + *
  17 + * @param int $uid 用户id
  18 + * @param int $actId 活动id
  19 + * @return array
  20 + */
  21 + public static function getGirldayCoupon($uid, $actId)
  22 + {
  23 + $result = array('code' => 201);
  24 +
  25 + do {
  26 + if (empty($uid) || empty($actId)) {
  27 + break;
  28 + }
  29 +
  30 + $result = ActivityData::getCouponAll($uid, $actId);
  31 + if (!$result) {
  32 + $result = array('code' => 201);
  33 + break;
  34 + }
  35 +
  36 + if (intval($result['code']) === 200) {
  37 + self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
  38 + }
  39 + } while (false);
  40 +
  41 + return $result;
  42 + }
  43 +
  44 + /**
  45 + * 发送站内信
  46 + *
  47 + * @param int $uid 用户ID
  48 + * @param string $title 站内信标题
  49 + * @param string $content 站内信内容
  50 + */
  51 + private static function sendMessage($uid, $title, $content)
  52 + {
  53 + try {
  54 + ActivityData::message($uid, $title, $content);
  55 + } catch (Exception $e) {
  56 + // do nothing
  57 + }
  58 + }
  59 +}
  1 +<?php
  2 +
  3 +namespace Cuxiao;
  4 +use LibModels\Wap\Cuxiao\ActivityData;
  5 +
  6 +/**
  7 + * Created by PhpStorm.
  8 + * User: DELL
  9 + * Date: 2016/2/25
  10 + * Time: 15:29
  11 + *
  12 + * @name XinshiliModel
  13 + * @package models/Cuxiao
  14 + * @author Gtskk(tttt6399998@126.com)
  15 + */
  16 +
  17 +
  18 +class XinshiliModel
  19 +{
  20 + /**
  21 + * 获取领券活动结果
  22 + *
  23 + * @param int $uid 用户id
  24 + * @param int $actId 活动id
  25 + * @return array
  26 + */
  27 + public static function getXinshiliCoupon($uid, $actId)
  28 + {
  29 + $result = array('code' => 201);
  30 +
  31 + do {
  32 + if (empty($uid) || empty($actId)) {
  33 + break;
  34 + }
  35 +
  36 + $result = ActivityData::getCouponAll($uid, $actId);
  37 + if (!$result) {
  38 + $result = array('code' => 201);
  39 + break;
  40 + }
  41 +
  42 + if (intval($result['code']) === 200) {
  43 + self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
  44 + }
  45 + } while (false);
  46 +
  47 + return $result;
  48 + }
  49 +
  50 + /**
  51 + * 发送站内信
  52 + *
  53 + * @param int $uid 用户ID
  54 + * @param string $title 站内信标题
  55 + * @param string $content 站内信内容
  56 + */
  57 + private static function sendMessage($uid, $title, $content)
  58 + {
  59 + try {
  60 + ActivityData::message($uid, $title, $content);
  61 + } catch (Exception $e) {
  62 + // do nothing
  63 + }
  64 + }
  65 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: Administrator
  5 + * Date: 2016/3/2
  6 + * Time: 10:48
  7 + */
  8 +use Action\HuodongAction;
  9 +use Cuxiao\GirldayModel;
  10 +use WebPlugin\Helpers;
  11 +/**
  12 + * 女生节活动领券-第二波
  13 + * @author Administrator
  14 + */
  15 +class GirldayController extends HuodongAction
  16 +{
  17 + // const STATIC_FILE = 'http://localhost:2222/1.0.0';
  18 + const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili-2-web/1.0.0';
  19 + /**
  20 + * 检测登录状态
  21 + *
  22 + * @return int
  23 + */
  24 + private function getLoggedUid()
  25 + {
  26 + if ($this->_isApp) {
  27 + $uid = $this->get('uid');
  28 + } else {
  29 + $uid = $this->getUid();
  30 + }
  31 + return $uid;
  32 + }
  33 +
  34 + /**
  35 + * 判断是否登录
  36 + */
  37 + private function checkLogin()
  38 + {
  39 + $url = Helpers::url('/cuxiao/girlday/index');
  40 + $uid = $this->getLoggedUid();
  41 + if (!$uid) {
  42 + $this->go(Helpers::url('/signin.html', array('refer' => $url), 'default'));
  43 + }
  44 + }
  45 +
  46 +
  47 + /**
  48 + * 根据环境来获取活动ID
  49 + *
  50 + * @return int
  51 + */
  52 + private function getActivityId()
  53 + {
  54 + // 设置环境变量
  55 + switch (APPLICATION_ENV) {
  56 + case 'production': // 生产
  57 + return 528;
  58 + case 'preview': // 预览
  59 + case 'testing': // 测试
  60 + case 'develop': // 开发
  61 + default:
  62 + return 90;
  63 + }
  64 + }
  65 +
  66 +
  67 + /**
  68 + * 领券接口
  69 + */
  70 + public function sendCouponAction()
  71 + {
  72 + $result = array('code' => 201);
  73 +
  74 + do {
  75 + if (!$this->isAjax()) {
  76 + break;
  77 + }
  78 +
  79 + $activityId = $this->getActivityId();
  80 + $uid = $this->getLoggedUid();
  81 + $result = GirldayModel::getGirldayCoupon($uid, $activityId);
  82 + } while (false);
  83 +
  84 + $this->echoJson($result);
  85 + }
  86 +
  87 + public function indexAction()
  88 + {
  89 +
  90 + $this->checkLogin();
  91 + //获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
  92 + $myCouponUrl = Helpers::url('/home/coupons', null, 'default');
  93 +
  94 + $this->_view->display('index', array(
  95 + 'staticTitle' => 'YOHO!BUY有货【春潮新势力】', // 标题
  96 + 'staticFile' => self::STATIC_FILE,
  97 + 'staticJS' => array(
  98 + 'home.js'
  99 + ),
  100 + 'couponUrl' => $myCouponUrl, // 个人中心优惠券地址
  101 + 'banner' => array(
  102 + 'img' => '',
  103 + 'url' => 'http://www.yohobuy.com/special_14548_0310PCHOME.html',
  104 + ),
  105 + 'selectUrl' => 'http://www.yohobuy.com/home/coupons',
  106 + ));
  107 + }
  108 +}
  1 +<?php
  2 +
  3 +use Action\HuodongWebAction;
  4 +use Cuxiao\XinshiliModel;
  5 +use WebPlugin\Helpers;
  6 +
  7 +/**
  8 + * 新势力领券活动
  9 + */
  10 +class XinshiliController extends HuodongWebAction
  11 +{
  12 + // const STATIC_FILE = 'http://localhost:2222/1.0.6';
  13 + const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili-web/1.0.6';
  14 +
  15 +
  16 + /**
  17 + * 检测登录状态
  18 + *
  19 + * @return int
  20 + */
  21 + private function getLoggedUid()
  22 + {
  23 + if ($this->_isApp) {
  24 + $uid = $this->get('uid');
  25 + } else {
  26 + $uid = $this->getUid();
  27 + }
  28 +
  29 + return $uid;
  30 + }
  31 +
  32 + /**
  33 + * 判断是否登录
  34 + */
  35 + private function checkLogin()
  36 + {
  37 + $playUrl = Helpers::url('/cuxiao/xinshili/index');
  38 +
  39 + $uid = $this->getLoggedUid();
  40 + if (!$uid) {
  41 + $this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
  42 + }
  43 + }
  44 +
  45 + /**
  46 + * 领券活动页面控制器
  47 + */
  48 + public function indexAction()
  49 + {
  50 + $this->checkLogin();
  51 +
  52 + //获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
  53 + $myCouponUrl = Helpers::url('/home/coupons', null, 'default');
  54 +
  55 + $this->_view->display('index', array(
  56 + 'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
  57 + 'staticFile' => self::STATIC_FILE,
  58 + 'staticJS' => array(
  59 + 'home.js'
  60 + ),
  61 + 'couponUrl' => $myCouponUrl, // 个人中心优惠券地址
  62 + 'banner' => array(
  63 + 'img' => 'http://img02.yohoboys.com/staticimg/2016/03/04/09/021a94b08418c4416785d37a47088aac58.jpg',
  64 + 'url' => 'http://www.yohobuy.com/special_14444_0302PCHOME.html'
  65 + )
  66 + ));
  67 + }
  68 +
  69 + /**
  70 + * 领券接口
  71 + */
  72 + public function sendCouponAction()
  73 + {
  74 + $result = array('code' => 201);
  75 +
  76 + do {
  77 + if (!$this->isAjax()) {
  78 + break;
  79 + }
  80 +
  81 + $activityId = $this->getActivityId();
  82 + $uid = $this->getLoggedUid();
  83 + $result = XinshiliModel::getXinshiliCoupon($uid, $activityId);
  84 + } while (false);
  85 +
  86 + $this->echoJson($result);
  87 + }
  88 +
  89 + /**
  90 + * 根据环境来获取活动ID
  91 + *
  92 + * @return int
  93 + */
  94 + private function getActivityId()
  95 + {
  96 + // 设置环境变量
  97 + switch (APPLICATION_ENV) {
  98 + case 'production': // 生产
  99 + return 506;
  100 + case 'preview': // 预览
  101 + case 'testing': // 测试
  102 + case 'develop': // 开发
  103 + default:
  104 + return 506;
  105 + }
  106 + }
  107 +}
  1 +[common]
  2 +;;默认项目
  3 +application.directory = APPLICATION_PATH "/application"
  4 +;;website library
  5 +application.library = ROOT_PATH "/library"
  6 +;;模块配置
  7 +application.modules = "Index,Cuxiao"
  8 +;;加载
  9 +application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
  10 +;;view文件的扩展名
  11 +application.view.ext = "phtml"
  12 +;;默认layouts
  13 +application.layout.path = APPLICATION_PATH "/application/layouts"
  14 +;;layouts 默认文件
  15 +application.layout.default = "default"
  16 +;;默认Controller
  17 +application.dispatcher.defaultController = "index"
  18 +;;默认Action
  19 +application.dispatcher.defaultAction = "index"
  20 +
  21 +;;初始化命名空间
  22 +application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
  23 +
  24 +;;使用composer
  25 +composer.autoload = 0
  26 +composer.path = APPLICATION_PATH "/library/Package"
  27 +
  28 +yaf.use_namespace = 1
  29 +
  30 +;;调试模式
  31 +[developer : common]
  32 +application.debug = True
  33 +application.servers.config = APPLICATION_PATH "/configs/core"
  34 +
  35 +;出错的时候是否抛出异常
  36 +application.dispatcher.throwException = True
  37 +
  38 +;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
  39 +;控制权会交给ErrorController的errorAction 方法,
  40 +;可以通过$request->getException()获得此异常对象 False
  41 +application.dispatcher.catchException = True
  42 +
  43 +;模板预编译目录,该目录需要有读写权限
  44 +application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
  45 +application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
  46 +application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
  47 +application.template.ext = ".phtml"
  48 +
  49 +;静态HTML页面的存放目录, 该目录需要有读写权限
  50 +application.assets.path = ROOT_PATH "/assets/web"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
  54 +
  55 +; 网站SEO信息
  56 +application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
  57 +application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
  58 +application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
  59 +
  60 +; 网站静态资源
  61 +application.js.url = "http://static.dev.yohobuy.com/huodong"
  62 +application.css.url = "http://static.dev.yohobuy.com/huodong"
  63 +application.img.url = "http://static.dev.yohobuy.com/huodong"
  1 +[common]
  2 +;;默认项目
  3 +application.directory = APPLICATION_PATH "/application"
  4 +;;website library
  5 +application.library = ROOT_PATH "/library"
  6 +;;默认模块
  7 +application.modules = "Index,Cuxiao"
  8 +;;加载
  9 +application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
  10 +;;view文件的扩展名
  11 +application.view.ext = "phtml"
  12 +;;默认layouts
  13 +application.layout.path = APPLICATION_PATH "/application/layouts"
  14 +;;layouts 默认文件
  15 +application.layout.default = "default"
  16 +;;默认Controller
  17 +application.dispatcher.defaultController = "index"
  18 +;;默认Action
  19 +application.dispatcher.defaultAction = "index"
  20 +
  21 +;;初始化命名空间
  22 +application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
  23 +
  24 +;;使用composer
  25 +composer.autoload = 0
  26 +composer.path = APPLICATION_PATH "/library/Package"
  27 +
  28 +yaf.use_namespace = 1
  29 +
  30 +;;调试模式
  31 +[preview : common]
  32 +application.debug = False
  33 +application.servers.config = APPLICATION_PATH "/configs/core"
  34 +
  35 +;出错的时候是否抛出异常
  36 +application.dispatcher.throwException = False
  37 +
  38 +;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
  39 +;控制权会交给ErrorController的errorAction 方法,
  40 +;可以通过$request->getException()获得此异常对象
  41 +application.dispatcher.catchException = False
  42 +
  43 +;模板预编译目录,该目录需要有读写权限
  44 +application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
  45 +application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
  46 +application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
  47 +application.template.ext = ".phtml"
  48 +
  49 +;静态HTML页面的存放目录, 该目录需要有读写权限
  50 +application.assets.path = ROOT_PATH "/assets/web"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
  54 +
  55 +; 网站SEO信息
  56 +application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
  57 +application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
  58 +application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
  59 +
  60 +; 网站静态资源
  61 +application.js.url = "http://buy.static.test.yoho.cn/huodong"
  62 +application.css.url = "http://buy.static.test.yoho.cn/huodong"
  63 +application.img.url = "http://buy.static.test.yoho.cn/huodong"
  1 +[common]
  2 +;;默认项目
  3 +application.directory = APPLICATION_PATH "/application"
  4 +;;website library
  5 +application.library = ROOT_PATH "/library"
  6 +;;默认模块
  7 +application.modules = "Index,Cuxiao"
  8 +;;加载
  9 +application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
  10 +;;view文件的扩展名
  11 +application.view.ext = "phtml"
  12 +;;默认layouts
  13 +application.layout.path = APPLICATION_PATH "/application/layouts"
  14 +;;layouts 默认文件
  15 +application.layout.default = "default"
  16 +;;默认Controller
  17 +application.dispatcher.defaultController = "index"
  18 +;;默认Action
  19 +application.dispatcher.defaultAction = "index"
  20 +
  21 +;;初始化命名空间
  22 +application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
  23 +
  24 +;;使用composer
  25 +composer.autoload = 0
  26 +composer.path = APPLICATION_PATH "/library/Package"
  27 +
  28 +yaf.use_namespace = 1
  29 +
  30 +;;调试模式
  31 +[production : common]
  32 +application.debug = False
  33 +application.servers.config = APPLICATION_PATH "/configs/core"
  34 +
  35 +;出错的时候是否抛出异常
  36 +application.dispatcher.throwException = False
  37 +
  38 +;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
  39 +;控制权会交给ErrorController的errorAction 方法,
  40 +;可以通过$request->getException()获得此异常对象
  41 +application.dispatcher.catchException = False
  42 +
  43 +;模板预编译目录,该目录需要有读写权限
  44 +application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
  45 +application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
  46 +application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
  47 +application.template.ext = ".phtml"
  48 +
  49 +;静态HTML页面的存放目录, 该目录需要有读写权限
  50 +application.assets.path = ROOT_PATH "/assets/web"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
  54 +
  55 +; 网站SEO信息
  56 +application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
  57 +application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
  58 +application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
  59 +
  60 +; 网站静态资源
  61 +application.js.url = "http://cdn.yoho.cn/huodong"
  62 +application.css.url = "http://cdn.yoho.cn/huodong"
  63 +application.img.url = "http://cdn.yoho.cn/huodong"
  1 +[common]
  2 +;;默认项目
  3 +application.directory = APPLICATION_PATH "/application"
  4 +;;website library
  5 +application.library = ROOT_PATH "/library"
  6 +;;默认模块
  7 +application.modules = "Index,Cuxiao"
  8 +;;加载
  9 +application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
  10 +;;view文件的扩展名
  11 +application.view.ext = "phtml"
  12 +;;默认layouts
  13 +application.layout.path = APPLICATION_PATH "/application/layouts"
  14 +;;layouts 默认文件
  15 +application.layout.default = "default"
  16 +;;默认Controller
  17 +application.dispatcher.defaultController = "index"
  18 +;;默认Action
  19 +application.dispatcher.defaultAction = "index"
  20 +
  21 +;;初始化命名空间
  22 +application.namespaces = "Action,Api,Configs,LibModels,Plugin,WebPlugin"
  23 +
  24 +;;使用composer
  25 +composer.autoload = 0
  26 +composer.path = APPLICATION_PATH "/library/Package"
  27 +
  28 +yaf.use_namespace = 1
  29 +
  30 +;;调试模式
  31 +[testing : common]
  32 +application.debug = True
  33 +application.servers.config = APPLICATION_PATH "/configs/core"
  34 +
  35 +;出错的时候是否抛出异常
  36 +application.dispatcher.throwException = True
  37 +
  38 +;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
  39 +;控制权会交给ErrorController的errorAction 方法,
  40 +;可以通过$request->getException()获得此异常对象 False
  41 +application.dispatcher.catchException = True
  42 +
  43 +;模板预编译目录,该目录需要有读写权限
  44 +application.template.compile = ROOT_PATH "/compile/huodong.yohobuy.com"
  45 +application.template.path = ROOT_PATH "/template/huodong.yohobuy.com/actions"
  46 +application.template.partials = ROOT_PATH "/template/huodong.yohobuy.com/partials"
  47 +application.template.ext = ".phtml"
  48 +
  49 +;静态HTML页面的存放目录, 该目录需要有读写权限
  50 +application.assets.path = ROOT_PATH "/assets/web"
  51 +
  52 +; 应用的版本号
  53 +application.version = "0.0.1"
  54 +
  55 +; 网站SEO信息
  56 +application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停"
  57 +application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
  58 +application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
  59 +
  60 +; 网站静态资源
  61 +application.js.url = "http://static.buy.test.yoho.cn/huodong"
  62 +application.css.url = "http://static.buy.test.yoho.cn/huodong"
  63 +application.img.url = "http://static.buy.test.yoho.cn/huodong"
  1 +[memcached]
  2 +master.hosts = 127.0.0.1:11212,127.0.0.1:11213
  3 +slave.hosts = 127.0.0.1:11212,127.0.0.1:11213
  4 +session.hosts = 127.0.0.1:11212,127.0.0.1:11213
  5 +
  6 +[redis]
  7 +servers.hosts = 192.168.1.168:6379
  1 +[memcached]
  2 +master.hosts=127.0.0.1:11212,127.0.0.1:11213
  3 +slave.hosts=127.0.0.1:11212,127.0.0.1:11213
  4 +session.hosts=127.0.0.1:11212,127.0.0.1:11213
  5 +
  6 +[redis]
  7 +servers.hosts = 127.0.0.1:6379
  1 +[memcached]
  2 +master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
  3 +slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
  4 +session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
  5 +
  6 +[redis]
  7 +servers.hosts=127.0.0.1:6379
  1 +[memcached]
  2 +master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
  3 +slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
  4 +session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
  5 +
  6 +[redis]
  7 +servers.hosts=127.0.0.1:6379
  1 +[memcached]
  2 +master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
  3 +slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
  4 +session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
  5 +
  6 +[redis]
  7 +servers.hosts=127.0.0.1:6379
  1 +[memcached]
  2 +master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
  3 +slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
  4 +session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
  5 +
  6 +[redis]
  7 +servers.hosts=127.0.0.1:6379
  1 +[memcached]
  2 +master.hosts=127.0.0.1:11212,127.0.0.1:11213
  3 +slave.hosts=127.0.0.1:11212,127.0.0.1:11213
  4 +session.hosts=127.0.0.1:11212,127.0.0.1:11213
  5 +
  6 +[redis]
  7 +servers.hosts = 127.0.0.1:6379
  1 +<?xml version="1.0"?>
  2 +<cross-domain-policy>
  3 + <allow-access-from domain="*.yohobuy.com" />
  4 +</cross-domain-policy>
No preview for this file type
  1 +<?php
  2 +
  3 +use Yaf\Application;
  4 +
  5 +define('SITE_MAIN', 'http://huodong.pc.yohobuy.com'); // 网站主域名
  6 +define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
  7 +define('COOKIE_DOMAIN', '.pc.yohobuy.com'); // COOKIE作用域
  8 +define('SUB_DOMAIN', '.pc.yohobuy.com'); // 子域名后缀
  9 +define('USE_CACHE', false); // 缓存的开关
  10 +define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
  11 +define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
  12 +defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
  13 +
  14 +$application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
  15 +$application->bootstrap()->run();
  1 +<?php
  2 +
  3 +use Yaf\Application;
  4 +
  5 +define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
  6 +define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
  7 +define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
  8 +define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
  9 +define('USE_CACHE', true); // 缓存的开关
  10 +define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
  11 +define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
  12 +defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview');
  13 +
  14 +$application = new Application(APPLICATION_PATH . '/configs/application.preview.ini');
  15 +$application->bootstrap()->run();
  1 +<?php
  2 +
  3 +use Yaf\Application;
  4 +
  5 +define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
  6 +define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
  7 +define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
  8 +define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
  9 +define('USE_CACHE', true); // 缓存的开关
  10 +define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
  11 +define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
  12 +defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing');
  13 +
  14 +$application = new Application(APPLICATION_PATH . '/configs/application.testing.ini');
  15 +$application->bootstrap()->run();
  1 +<?php
  2 +
  3 +use Yaf\Application;
  4 +
  5 +define('SITE_MAIN', 'http://huodong.yohobuy.com'); // 网站主域名
  6 +define('OLD_MAIN', 'http://huodong.yohobuy.com'); // 网站旧域名
  7 +define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
  8 +define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
  9 +define('USE_CACHE', true); // 缓存的开关
  10 +define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
  11 +define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
  12 +defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
  13 +
  14 +$application = new Application(APPLICATION_PATH . '/configs/application.production.ini');
  15 +$application->bootstrap()->run();
  1 +User-agent: *
  2 +Disallow: