Commit b64146ab authored by liuyuzhen's avatar liuyuzhen

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz

parents 7ee0e11e 178e1d77
......@@ -921,7 +921,7 @@ class OrderConfirmUtil {
if($tempOrder['coupon_id']>\Our\ApiConst::zero){
$couponIds[$tempOrder['order_id']] = $tempOrder['coupon_id'];
}
$orderModel->deleteOrderCache($tempOrder['buyer_id'],$tempOrder['order_id']);
$orderModel->deleteOrderCache($tempOrder['buyer_id'],$tempOrder['order_id'],$tempOrder['store_id'],true,true);
\Our\RedisHelper::memberTotalFromStateToState($tempOrder['buyer_id'],ApiConst::orderStateWaitPay,ApiConst::orderStateWaitConfirm);
}
//送券、送礼品
......
......@@ -61,7 +61,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$maxPrice = intval($param['maxPrice']);
$goodsSort = intval($param['goodsSort']);
$attrValue = $param['attrValue'];
list($where,$order,$attrStr) = $this->getParam($attrValue,$minPrice,$maxPrice,$goodsSort);
list($where,$order,$attrStr,$saleSort) = $this->getParam($attrValue,$minPrice,$maxPrice,$goodsSort);
$keyword && $where[] = "goods_name like '%{$keyword}%'";
$commonDAO = \DAO\GoodsCommonModel::getInstance();
$couponDao = \DAO\Coupon\CouponModel::getInstance();
......@@ -80,11 +80,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$where[] = 'goods_commonid in('.trim($ids,',').')';
}
}
$saleSort ? $ttl = \Our\ApiConst::oneHour : \Our\ApiConst::oneDaySecond;
if($activities){
$activities = array_keys($activities);
$field = 'han_goods_common.goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_price,goods_marketprice AS goodsMarketPrice,goods_image AS goodsImage,IFNULL(discount_price,goods_price) AS goodsPrice';
if($storeId > 0){
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$activities,$limit,$order,$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$activities,$limit,$order,$attrStr),$ttl,array($storeId));
}else{
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$activities,$limit,$order,$attrStr),\Our\ApiConst::oneMinute,array(\Our\ApiConst::zero));
}
......@@ -94,7 +95,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$field = 'han_goods_common.'.$field;
}
if($storeId > 0 ){
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getGoodsList'),array($where,$field,$limit,$order,$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getGoodsList'),array($where,$field,$limit,$order,$attrStr),$ttl,array($storeId));
}else{
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getGoodsList'),array($where,$field,$limit,$order,$attrStr),\Our\ApiConst::oneMinute,array(\Our\ApiConst::zero));
}
......@@ -183,14 +184,17 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}elseif ($maxPrice){
$where[] = "goods_price <= {$maxPrice}";
}
$saleSort = false;
$order = [];
switch ($goodsSort){
case 1:
$order[] = ['sale_num','DESC'];
$order[] = ['eval_score','DESC'];
$saleSort = true;
break;
case 2:
$order[] = ['sale_num','DESC'];
$saleSort = true;
break;
case 3:
$order[] = ['goods_selltime','DESC'];
......@@ -206,7 +210,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$order[] = ['eval_score','DESC'];
break;
}
return array($where,$order,$attrStr);
return array($where,$order,$attrStr,$saleSort);
}
/**
* 获取商品列表
......@@ -244,20 +248,21 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$thirdClassId && $where[] = "gc_id_3 = {$thirdClassId}";
$storeThirdClassId && $where[] = "goods_class_t_id = {$storeThirdClassId}";
$keyword && $where[] = "goods_name like '%{$keyword}%'";
list($_where,$order,$attrStr) = $this->getParam($attrValue,$minPrice,$maxPrice,$goodsSort);
list($_where,$order,$attrStr,$saleSort) = $this->getParam($attrValue,$minPrice,$maxPrice,$goodsSort);
$where = array_merge($where,$_where);
$commonDAO = \DAO\GoodsCommonModel::getInstance();
$saleSort ? $ttl = \Our\ApiConst::oneHour : \Our\ApiConst::oneDaySecond;
if(!$activities){
$field = 'goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_price as goodsPrice,goods_marketprice AS goodsMarketPrice,goods_image AS goodsImage,goods_commend AS isRecoment,goods_new AS isNew,goods_hot AS isHot';
if($attrStr){
$field = 'han_goods_common.'.$field;
}
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getGoodsList'),array($where,$field,$limit,$order,$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getGoodsList'),array($where,$field,$limit,$order,$attrStr),$ttl,array($storeId));
}else{
$activities = array_keys($activities);
$field = 'han_goods_common.goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_price,goods_marketprice AS goodsMarketPrice,goods_image AS goodsImage,goods_commend AS isRecoment,goods_new AS isNew,goods_hot AS isHot,IFNULL(discount_price,han_goods_common.goods_price) AS goodsPrice';
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$activities,$limit,$order,$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$activities,$limit,$order,$attrStr),$ttl,array($storeId));
}
$goods = [];
if(is_array($list) && !empty($list)){
......
......@@ -293,7 +293,7 @@ class OrderServiceModel extends \Business\AbstractModel
$orderGoodsDao->update($where,$orderGoodsUpdateData);
}
if ($memberId) {
$orderDao->deleteOrderCache($memberId, $orderId, $order['store_id']);
$orderDao->deleteOrderCache($memberId, $orderId, $order['store_id'],true);
// $memberDao->fromOrderStateToOrderState($memberId,$order['order_state'],ApiConst::orderStateCancel);
}
}
......@@ -315,7 +315,7 @@ class OrderServiceModel extends \Business\AbstractModel
if ($isAllowConfirm) {
$res = $orderDao->updateStatusByOrderId($orderId, ApiConst::orderStateComplete, TRUE);
if ($res) {
$orderDao->deleteOrderCache($memberId, $orderId, $order['store_id']);
$orderDao->deleteOrderCache($memberId, $orderId, $order['store_id'],true);
return true;
} else {
ErrorModel::throwException(CodeConfigModel::receiveError);
......@@ -520,7 +520,7 @@ class OrderServiceModel extends \Business\AbstractModel
if(!$update || !$res){
echo '订单:'.$order['orderId'].'没取消成功!';
}
$orderDao->deleteOrderCache($order['buyerId'],(string)$order['orderId'],$order['storeId']);
$orderDao->deleteOrderCache($order['buyerId'],(string)$order['orderId'],$order['storeId'],true);
}
$orderIds = array_column($orders, 'orderId');
//更新商品库存
......@@ -571,7 +571,7 @@ class OrderServiceModel extends \Business\AbstractModel
$this->changeOrderStateCancelUnconditional($order);
}
}
$orderDao->deleteOrderCache($order['buyerId'],(string)$order['orderId'],$order['storeId']);
$orderDao->deleteOrderCache($order['buyerId'],(string)$order['orderId'],$order['storeId'],true);
}
$orderIds = array_column($orders, 'orderId');
......@@ -623,13 +623,13 @@ class OrderServiceModel extends \Business\AbstractModel
if ($order['shippingType'] == ApiConst::bySeller) {
if (isset($qmDeliverymanLogsOrderIds[$order['orderId']])) {
array_push($sellerOrderIds, $order['orderId']);
$orderDao->deleteOrderCache($order['buyerId'], $order['orderId'], $order['storeId']);
$orderDao->deleteOrderCache($order['buyerId'], $order['orderId'], $order['storeId'],true);
}
} else {
$limitTime = TIMESTAMP - ApiConst::orderWaitRecieveThreeDays;
if ($order['acceptTime'] < $limitTime) {
array_push($expressOrderIds, $order['orderId']);
$orderDao->deleteOrderCache($order['buyerId'], $order['orderId'], $order['storeId']);
$orderDao->deleteOrderCache($order['buyerId'], $order['orderId'], $order['storeId'],true);
}
}
\Our\RedisHelper::memberTotalFromStateToState($order['buyerId'], $order['orderState'], ApiConst::orderStateComplete);
......@@ -841,7 +841,7 @@ class OrderServiceModel extends \Business\AbstractModel
$push = Push::getInstance();
$push->reacheRemind($order['buyerId'], $order['orderId'], $order['orderSn']);
}
$orderDao->deleteOrderCache($memberid, $qmDeliveryManLog['orderId'], $order['storeId']);
$orderDao->deleteOrderCache($memberid, $qmDeliveryManLog['orderId'], $order['storeId'],true);
$qmDeliverymanLogDao->deleteOrderCache($deliverymanId, $id);
return $updateResult;
} else {
......
......@@ -398,7 +398,7 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArrayUnLine=Common::convertUnderline($refundArray);
$state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods);
if ($state) {
$orderDao->deleteOrderCache($memberId,$refund['orderId']);
$orderDao->deleteOrderCache($memberId,$refund['orderId'],$refund['storeId'],true);
$refundReturnDao->deleteRefundCache($memberId);
$refundStateName=$refundReturnDao->getRefundTextStatus($refundArrayUnLine);
$orderGoodsDao->update(array('rec_id'=>$orderGoods['recId']),array('refund_state_name'=>$refundStateName,'refund_id'=>$state));
......
......@@ -237,7 +237,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
} else {
$update_data['order_state'] = ApiConst::orderStateWaitSend;
$result = $orderDao->update($where, $update_data);
$orderDao->deleteOrderCache($order['buyer_id'], $orderId,$order['store_id']);
$orderDao->deleteOrderCache($order['buyer_id'], $orderId,$order['store_id'],true);
\Our\RedisHelper::memberTotalFromStateToState($order['buyer_id'], $order['order_state'], ApiConst::orderStateWaitSend);
return $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment