Authored by Rock Zhang

Merge branch 'feature/wap/girlsday' into develop/wap

... ... @@ -12,6 +12,14 @@
</div>
{{/if}}
{{#if offShelveGoods}}
<div class="invalid-goods">
{{# offShelveGoods}}
{{> cart/good}}
{{/ offShelveGoods}}
</div>
{{/if}}
{{#if freebieOrAdvanceBuy}}
<ul class="freebie-and-advance-buy">
{{#if freebie}}
... ...
<?php
namespace Cuxiao;
use LibModels\Wap\Cuxiao\ActivityData;
/**
* Created by PhpStorm.
* User: DELL
* Date: 2016/2/25
* Time: 15:11
*
* @name XinshiliModel
* @package models/Cuxiao
* @author Gtskk(tttt6399998@126.com)
*/
class XinshiliModel
{
/**
* 获取领券活动结果
*
* @param int $uid 用户id
* @param int $actId 活动id
* @return array
*/
public static function getXinshiliCoupon($uid, $actId)
{
$result = array('code' => 201);
do {
if (empty($uid) || empty($actId)) {
break;
}
$result = ActivityData::getCouponAll($uid, $actId);
if (!$result) {
$result = array('code' => 201);
break;
}
if (intval($result['code']) === 200) {
self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
}
} while (false);
return $result;
}
/**
* 发送站内信
*
* @param int $uid 用户ID
* @param string $title 站内信标题
* @param string $content 站内信内容
*/
private static function sendMessage($uid, $title, $content)
{
try {
ActivityData::message($uid, $title, $content);
} catch (Exception $e) {
// do nothing
}
}
}
\ No newline at end of file
... ...
<?php
use Action\HuodongAction;
use Cuxiao\XinshiliModel;
use Plugin\Helpers;
/**
* 元宵抽签活动
* 新势力领券活动
*/
class XinshiliController extends HuodongAction
{
// const STATIC_FILE = 'http://localhost:2222/1.0.1';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili/1.0.1';
// const STATIC_FILE = 'http://localhost:2222/1.0.2';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili/1.0.2';
/**
* 检测登录状态
*
* @return int
*/
private function getLoggedUid()
{
if ($this->_isApp) {
$uid = $this->get('uid');
} else {
$uid = $this->getUid();
}
return $uid;
}
/**
* 元宵抽签
* 判断是否登陆
*/
private function checkLogin()
{
$playUrl = Helpers::url('/cuxiao/xinshili/index');
$uid = $this->getLoggedUid();
if (!$uid) {
if (!$this->_isApp) {
$this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
} else {
$playUrlEncode = strtr($playUrl, array('/' => '\\/'));
$this->go($playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}');
}
}
}
/**
* 领券活动页面控制器
*/
public function indexAction()
{
$this->checkLogin();
//获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
$myCouponUrl = Helpers::url('/home/coupons', null, 'default') . '?openby:yohobuy={"action":"go.coupon"}';
$this->_view->display('index', array(
'staticTitle' => '新势力',
'staticTitle' => 'YOHO!BUY有货【春潮新势力】',
'staticFile' => self::STATIC_FILE,
'staticJS' => array(
'home.js'
),
'couponUrl' => '', // 个人中心优惠券地址
'couponUrl' => $myCouponUrl, // 个人中心优惠券地址
'banner' => array(
'img' => '',
'url' => ''
'url' => 'http://feature.yoho.cn/0302/0302APPHOME/index.html?openby:yohobuy={"action":"go.h5","params":{"title":"YOHO!BUY有货【春潮新势力】","url":"http://feature.yoho.cn/0302/0302APPHOME/index.html?","share":"\/operations\/api\/v5\/webshare\/getShare","shareparam":{"share_id":"386"},"param":{"share_id":"386"}}'
),
'weixinUrl' => '', // 微信关注地址
'appUrl' => '', // APP 下载地址
'shareTitle' => '新势力',
'shareDesc' => '新势力领券',
'weixinUrl' => 'http://mp.weixin.qq.com/s?__biz=MjM5ODI5MDA4MA==&mid=201849402&idx=1&sn=c0089812f9769d82e0075f69d771f6e1#rd', // 微信关注地址
'appUrl' => 'http://www.yohoshow.com/about/index/yohobuyqr', // APP 下载地址
'shareTitle' => 'YOHO!BUY有货【春潮新势力】火力全开!350元优惠券限时派送中',
'shareDesc' => 'Wake up!Boys & Girls!一起来YOHO!玩潮流!',
'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
'shareLink' => Helpers::url('/cuxiao/yuanxiao/index')
'shareLink' => Helpers::url('/cuxiao/xinshili/index')
));
}
/**
* 领券接口
*/
public function sendCouponAction()
{
$result = array('code' => 201);
do {
if (!$this->isAjax()) {
break;
}
$activityId = $this->getActivityId();
$uid = $this->getLoggedUid();
$result = XinshiliModel::getXinshiliCoupon($uid, $activityId);
} while (false);
$this->echoJson($result);
}
/**
* 根据环境来获取活动ID
*
* @return int
*/
private function getActivityId()
{
// 设置环境变量
switch (APPLICATION_ENV) {
case 'production': // 生产
return 506;
case 'preview': // 预览
case 'testing': // 测试
case 'develop': // 开发
default:
return 488;
}
}
}
... ...
[memcached]
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
... ... @@ -78,6 +78,8 @@ class Bootstrap extends Bootstrap_Abstract
case 'm': // 老版(到频道选择)
case 'buy': // 测试环境的域名, 以后可去掉
case 'login': // 登录
case 'm20160224': // AWS TEST
case 'login20160224': // AWS TEST
break;
case 'new': // 原新版(到男生首页)
$controller = 'Boys';
... ...
... ... @@ -773,7 +773,7 @@ class CartModel
do {
// 数据为空时返回空的标志
if (empty($data['goods_list']) && empty($data['sold_out_goods_list'])) {
if (empty($data['goods_list']) && empty($data['sold_out_goods_list']) && empty($data['off_shelves_goods_list'])) {
break;
}
... ... @@ -800,6 +800,12 @@ class CartModel
$result['notValidGoods'] = $notValidGoods;
}
// 下架的商品列表
$offShelveGoods = Helpers::formatCartGoods($data['off_shelves_goods_list'], $isAdvanceCart, false);
if (!empty($offShelveGoods)) {
$result['offShelveGoods'] = $offShelveGoods;
}
// 赠品和加价购商品
if (count($data['gift_list']) || count($data['price_gift'])) {
$result['freebieOrAdvanceBuy'] = true;
... ...
... ... @@ -195,7 +195,7 @@ class DetailModel
// 商品的尺码列表
$colorStorageGroup[ $value['productSkc'] ] = array();
if (isset($value['goodsSizeBoList'])) {
if (isset($value['goodsSizeBoList']) && !empty($value['goodsSizeBoList'])) {
$sizeName = '';
foreach ($value['goodsSizeBoList'] as $size) {
$sizeList[ $value['productSkc'] ][] = array(
... ...
[memcached]
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
$application = new Application(APPLICATION_PATH . '/configs/application.production.ini');
$application->bootstrap()->run();
... ...
... ... @@ -2,10 +2,10 @@
use Yaf\Application;
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('SITE_MAIN', 'http://m20160224.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('SUB_DOMAIN', '.m20160224.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
... ...
5m7GaQanwdmT2Bw7/iBKqZlYr+yKphtGeMh7y7Oro+4=
... ...
... ... @@ -78,6 +78,8 @@ class Bootstrap extends Bootstrap_Abstract
case 'new': // 原新版
case 'dev': // 开发环境
case 'web':
case 'www20160224': // AWS TEST
case 'new20160224': // AWS TEST
break;
case 'search': // 搜索
$module = 'Product';
... ...
[memcached]
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
master.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
slave.hosts=172.31.22.1:12112,172.31.20.56:12112,172.31.31.146:12112
session.hosts=172.31.22.1:12111,172.31.20.56:12111,172.31.31.146:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://www.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://www.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
$application = new Application(APPLICATION_PATH . '/configs/application.production.ini');
$application->bootstrap()->run();
\ No newline at end of file
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://www.yohobuy.com'); // 网站主域名
define('SITE_MAIN', 'http://www20160224.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://www.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
... ...