Authored by 周少峰

Merge branch 'release/5.1'

... ... @@ -20,6 +20,7 @@ use Hood\Session;
use WebPlugin\Mobile;
use Api\Yohobuy;
use LibModels\Web\Passport\LoginData;
use LibModels\Web\Home\IndexData;
use WebPlugin\UdpLog;
use WebPlugin\Encryption;
... ... @@ -564,15 +565,24 @@ class WebAction extends Controller_Abstract
else {
$channel = \Index\HomeModel::getSwitchChannel();
}
$apiDomain = $this->getApiDomain();
$header = array(
'navbars' => \Index\HomeModel::getNavBars($channel),
'hotSearch' => '',
'gobytype' => 'gobuy' . $channel,
'searchcate' => 'searchcate' . $channel,
'header' => true,
'apiDomain' => $apiDomain,
'sysUserSession'=> '',
);
$terms = IndexData::getHotSearchData();
if(!empty($terms['data'])) {
$header['hotSearch'] = isset($terms['data']['hotTerms'][0]['content']) ? $terms['data']['defaultTerms'][0]['content'] : '';
}
//同步session
if(!empty($uid) && $sysUserSession < 20) {
$header['sysUserSession'] = Helpers::syncUserSession($uid);
... ...
... ... @@ -155,10 +155,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) !== false) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) !== false) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -180,7 +180,7 @@ class Yohobuy
$url = self::httpBuildQuery($url, $data);
} //echo $url;
UdpLog::debug('get shut api', $url);
// UdpLog::debug('get shut api', $url);
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
... ... @@ -212,10 +212,9 @@ class Yohobuy
}
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
//如果分流执行失败,则走原来的逻辑
if (USE_INTER_FACE_SHUNT && $httpCode !== 200) {
if (USE_INTER_FACE_SHUNT && curl_getinfo($ch,CURLINFO_HTTP_CODE) !== 200) {
curl_close($ch);
return self::_get($urlBack, $data, $cache, $returnJson, $timeout, $userAgent, $useGzip);
}
... ... @@ -279,7 +278,6 @@ class Yohobuy
UdpLog::debug('call api: ', $url);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ... @@ -319,10 +317,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) !== false) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) !== false) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -372,12 +370,8 @@ class Yohobuy
}
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
UdpLog::debug('post api', array('url' => $url, 'httpCode' => $httpCode));
//如果分流执行失败,则走原来的逻辑
if (USE_INTER_FACE_SHUNT && $httpCode !== 200) {
if (USE_INTER_FACE_SHUNT && curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) {
curl_close($ch);
return self::_post($urlBack, $data, $returnJson, $timeout, $header, $cookie);
}
... ... @@ -708,11 +702,9 @@ class Yohobuy
return false;
}
UdpLog::debug('read memcache');
$interfaceShunt = Cache::getBy('INTERFACE_SHUT_KEY', 'master');
UdpLog::debug('read memcahe: ', $interfaceShunt);
// UdpLog::debug('read memcahe: ', $interfaceShunt);
if (empty($interfaceShunt)) {
return false;
}
... ... @@ -761,7 +753,7 @@ class Yohobuy
}
$paseUrl = parse_url($url);
if (strpos($url, API_URL)) {
if (strpos($url, API_URL) !== false) {
if (empty($ips['api.yoho.cn'])) {
return false;
... ... @@ -775,7 +767,7 @@ class Yohobuy
$url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/';
} else if (strpos($url, SERVICE_URL)) {
} else if (strpos($url, SERVICE_URL) !== false) {
if (empty($ips['service.yoho.cn'])) {
return false;
... ...
... ... @@ -32,6 +32,23 @@ class IndexData
}
/**
* 获取热搜词数据
*
* @param int $status (default)
* @param string $fields (default)
* @return array
*/
public static function getHotSearchData()
{
$params = Yohobuy::param();
$params['client_type'] = 'web'; // 调用web手机网站的
$params['method'] = 'app.search.getTerms';
$params['private_key'] = Yohobuy::$privateKeyList['web'];
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(API_URL, $params, true);
}
/**
* 获取资源数据
*
* @param string $content_code
... ...
... ... @@ -135,8 +135,9 @@
<div class="search float-left {{searchcate}}" >
<form action="//search.yohobuy.com" method="get" id="searchForm">
<span class="searchspan">
<input type="hidden" id="defaultsearch">
<input class="searchinput" type="text" name="query" id="query_key" autocomplete="off" x-webkit-speech="" lang="zh-CN" x-webkit-grammar="builtin:translate" value="" onfocus="if(this.value==this.defaultValue){this.value='';this.style.color='#333'}" onblur="if(this.value==''){this.value=this.defaultValue;this.style.color='#999'}" maxlength="30"></span>
<input type="hidden" id="defaultsearch" value="">
<input class="searchinput" type="text" name="query" id="query_key" autocomplete="off" x-webkit-speech="" lang="zh-CN" x-webkit-grammar="builtin:translate" value="{{hotSearch}}" onfocus="if(this.value==this.defaultValue){this.value='';this.style.color='#333'}" onblur="if(this.value==''){this.value=this.defaultValue;this.style.color='#999'}" maxlength="30" style="color: #999;">
</span>
<a class="icon-search" href="javascript:submitSearch();"></a>
<ul class="search-list"></ul>
</form>
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -111,7 +111,7 @@ function getShoppingKey() {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', ('https:' == document.location.protocol ? 'https' : 'http') + '://' + 'cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas');
})(window, document, 'script', ('https:' == document.location.protocol ? 'https' : 'http') + '://' + 'cdn.yoho.cn/yas-jssdk/1.0.18/yas.js', '_yas');
(function() {
var uid = getUid();
... ... @@ -121,7 +121,7 @@ function getShoppingKey() {
window._ozuid = uid; //暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '1.0.17', 'yohobuy_web', uid, '', '');
window._yas(1 * new Date(), '1.0.18', 'yohobuy_web', uid, '', '');
}
}());
... ...
... ... @@ -803,6 +803,7 @@
float: left;
width: 240px;
height: 28px;
color: #999;
border: 1px solid #000;
box-sizing: border-box;
padding: 6px 0 5px 10px;
... ...
... ... @@ -36,7 +36,7 @@ class OrderModel
if($orderV['is_cancel'] == 'Y' || $orderV['status'] === 6) {
$orders[$orderK]['canDelete'] = true; //删除订单
}
$statusInfo = self::getOrderStatus($orderV['is_cancel'], $orderV['status'], $orderV['payment_type'], $orderV['payment_status']);
$statusInfo = self::getOrderStatus($orderV['is_cancel'], $orderV['status'], $orderV['payment_type'], $orderV['payment_status'], $orderV['status_str']);
//订单状态
if ($statusInfo['cancel']) {
$orders[$orderK]['cancel'] = $statusInfo['cancel'];
... ... @@ -83,7 +83,7 @@ class OrderModel
$orders[$orderK]['fregit'] = $orderV['shipping_cost']; //邮费
}
//操作
$orders[$orderK]['operation'] = self::getOperateInfo($orderV['attribute'], $orderV['is_cancel'], $orderV['status'], $orderV['payment_status'], $orderV['update_time'], $orderV['order_type'], $orderV['refund_status'], $orderV['payment_type'], $orderV['order_code'], $opRefundStatus);
$orders[$orderK]['operation'] = self::getOperateInfo($orderV['attribute'], $orderV['is_cancel'], $orderV['status'], $orderV['payment_status'], $orderV['update_time'], $orderV['order_type'], $orderV['refund_status'], $orderV['payment_type'], $orderV['order_code'], $opRefundStatus, $orderV['use_limit_code']);
if ($orderV['attribute'] * 1 === 3) {
//包含虚拟商品,订单列表不显示物流属性
... ... @@ -507,9 +507,10 @@ class OrderModel
* @param type $status
* @param type $payType
* @param type $payStatus
* @param type $statusStr
* @return string
*/
protected static function getOrderStatus($isCancel, $status, $payType, $payStatus)
protected static function getOrderStatus($isCancel, $status, $payType, $payStatus, $statusStr = '')
{
//初始化:未取消,待付款
$ret = array('cancel' => FALSE, 'keyName' => 'noPay', 'statusStr' => '待付款');
... ... @@ -556,6 +557,9 @@ class OrderModel
break;
}
}
if ($statusStr) {
$ret['statusStr'] = $statusStr;
}
return $ret;
}
... ... @@ -571,9 +575,10 @@ class OrderModel
* @param type $paymentType 付款类型
* @param type $orderCode 订单号
* @param type $opRefundStatus 退换操作是否灰化 true 灰化 false 可用
* @param type $useLimitCode 使用限购码 N(默认), Y
* @return string
*/
protected static function getOperateInfo($attribute, $isCancel, $status, $payStatus, $updateTime, $orderType, $refundStatus, $paymentType, $orderCode, $opRefundStatus)
protected static function getOperateInfo($attribute, $isCancel, $status, $payStatus, $updateTime, $orderType, $refundStatus, $paymentType, $orderCode, $opRefundStatus = false, $useLimitCode = 'N')
{
//查看订单
$orderDetailUrl = Helpers::url('/home/orders/detail', array('orderCode' => $orderCode));
... ... @@ -590,8 +595,8 @@ class OrderModel
$exchangeUrl = Helpers::url('/home/returns/exchangeRequest', array('orderCode' => $orderCode));
//申请退货
$refundUrl = Helpers::url('/home/returns/refundrequest', array('orderCode' => $orderCode));
//再次购买
if ( $isCancel == 'Y') {
//再次购买 use_limit_code
if ( $isCancel == 'Y' && $useLimitCode !== 'Y') {
$operation[] = array( 'name' => '再次购买', 'reBuy' => true);
}
//立即付款
... ... @@ -627,6 +632,10 @@ class OrderModel
$operation[] = array('href' => $refundUrl, 'name' => '申请退货', 'optDis' => $opRefundStatus);
}
// 预售商品提示app操作
if ($attribute == 9) {
$operation = array('name' => '定金预售商品只能在APP端操作');
}
return $operation;
}
... ...
... ... @@ -95,10 +95,10 @@ class UserModel
'name' => '我的评论',
'href' => Helpers::url('/home/comment')
),
array(
'name' => '我的投诉',
'href' => Helpers::url('/home/complaints')
),
// array(
// 'name' => '我的投诉',
// 'href' => Helpers::url('/home/complaints')
// ),
array(
'name' => '我的信息',
'count' => self::unredTotal($uid), //获取未读消息数量
... ...
... ... @@ -21,8 +21,8 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关
//define('API_OLD', 'http://test2.open.yohobuy.com/');
#dev环境
define('API_URL', 'http://api-test2.yohops.com:9999');
define('SERVICE_URL', 'http://service-test2.yohops.com:9999/');
define('API_URL', 'http://api-test3.yohops.com:9999');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/');
define('API_OLD', 'http://devservice.yoho.cn:58077/');
... ...
... ... @@ -14,8 +14,8 @@ define('EXHIBITION_TICKET', 51335912);//展览票skn
define('USE_INTER_FACE_SHUNT', false);//分流开关
define('API_URL', 'http://api-test2.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test2.yohops.com:9999/');
define('API_URL', 'http://api-test3.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');
define('API_OLD', 'http://test2.open.yohobuy.com/');
... ...