Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
215bedb5
Commit
215bedb5
authored
Sep 22, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into master_dev
parents
46a4b12c
b5bb2af4
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
112 additions
and
39 deletions
+112
-39
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+16
-0
ArrayConst.php
application/library/Our/ArrayConst.php
+5
-0
AdvService.php
application/models/Business/Common/AdvService.php
+3
-3
CouponService.php
application/models/Business/Coupon/CouponService.php
+2
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+4
-4
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+1
-1
OrderService.php
application/models/Business/Order/OrderService.php
+15
-7
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+1
-2
AddressService.php
application/models/Business/User/AddressService.php
+3
-0
MemberCenterService.php
application/models/Business/User/MemberCenterService.php
+2
-2
Coupon.php
application/models/DAO/Coupon/Coupon.php
+26
-18
DeliveryFormula.php
application/models/DAO/DeliveryFormula.php
+1
-0
Order.php
application/models/DAO/Order/Order.php
+14
-0
OrderGoods.php
application/models/DAO/Order/OrderGoods.php
+16
-0
RefundReturn.php
application/models/DAO/Order/RefundReturn.php
+1
-1
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
215bedb5
...
...
@@ -41,6 +41,8 @@ class OrderConfirmUtil {
private
$storeMemos
=
array
();
private
$cartCacheDeleteFlag
=
false
;
public
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
$storeCartData
=
$this
->
checkPostData
(
$data
,
$memberId
,
$currentAddress
);
//return $storeCartData;
...
...
@@ -89,6 +91,7 @@ class OrderConfirmUtil {
$this
->
storeIds
=
array_keys
(
$cartList
[
'list'
]);
$this
->
storeMemos
[
$this
->
postData
[
'storeId'
]]
=
isset
(
$this
->
postData
[
'storeMemo'
])
?
$this
->
postData
[
'storeMemo'
]
:
\Our\NameConst
::
emptyString
;
}
else
{
$this
->
cartCacheDeleteFlag
=
true
;
foreach
(
$this
->
postData
as
$temp
){
$this
->
checkOneStoreData
(
$temp
);
if
(
!
$temp
[
'cartIds'
]){
...
...
@@ -513,10 +516,23 @@ class OrderConfirmUtil {
}
public
function
opCacheInfo
(){
if
(
$this
->
cartCacheDeleteFlag
){
$this
->
delCartCache
();
}
$this
->
deleteCacheInfo
();
$this
->
pushSaleGoods
();
}
public
function
delCartCache
(){
$cartRedis
=
\Redis\Db7\CartRedisModel
::
getInstance
();
$memberCartKey
=
\Our\NameConst
::
memberCartStorePrefix
.
$this
->
memberId
;
$cartRedis
->
tableDel
(
$memberCartKey
);
foreach
(
$this
->
storeIds
as
$tempStoreId
){
$memberStoreCartsKey
=
\Our\NameConst
::
memberStoreCartsPrefix
.
$this
->
memberId
.
\Our\NameConst
::
underline
.
$tempStoreId
;
$cartRedis
->
tableDel
(
$memberStoreCartsKey
);
}
}
public
function
pushSaleGoods
(){
if
(
$this
->
saleGoodsIds
){
$saleGoodsDao
=
\DAO\SaleGoodsModel
::
getInstance
();
...
...
application/library/Our/ArrayConst.php
100755 → 100644
View file @
215bedb5
...
...
@@ -118,6 +118,11 @@ class ArrayConst
'href'
=>
''
,
'price'
=>
0
);
const
orderCloseAndCancel
=
array
(
0
,
-
1
);
//确认收货按钮0为未操作过,1为操作过,
const
reachRemindButtons
=
array
(
array
(
...
...
application/models/Business/Common/AdvService.php
View file @
215bedb5
...
...
@@ -157,8 +157,8 @@ class AdvServiceModel extends \Business\AbstractModel{
$advMobileSql
=
\Our\Common
::
format
(
$advMobileSql
,
$where
[
'storeId'
],
$position
,
\Our\ApiConst
::
one
,
\Our\ApiConst
::
one
);
$advMobileField
=
'href,src,end_time,start_time'
;
$advMobileList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db9\AdvMobileRedisModel
::
getInstance
(),
array
(
&
$advMobileDao
,
'getList'
),
array
(
$advMobileSql
,
$advMobileField
,
array
(
'adv_id'
=>
\Our\NameConst
::
desc
)),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]));
$advs
=
array
();
if
(
$advMobileList
){
$advs
=
array
();
foreach
(
$advMobileList
as
$adv
){
if
(
$adv
[
'start_time'
]
<=
TIMESTAMP
&&
$adv
[
'end_time'
]
>
TIMESTAMP
){
$temp
=
array
();
...
...
@@ -167,7 +167,7 @@ class AdvServiceModel extends \Business\AbstractModel{
$advs
[]
=
$temp
;
}
}
}
else
{
}
/*
else{
$storeAdvPositionDao = \DAO\Adv\StoreAdvPositionModel::getInstance();
$storeAdvPosition = \Our\RedisHelper::cachedFunction(\Redis\Db9\StoreAdvPositionRedisModel::getInstance(),array(&$storeAdvPositionDao, 'find'),array(array('ap_id'=>$position)),\Our\ApiConst::oneHour,array($position));
if($storeAdvPosition&&$storeAdvPosition['default_content']){
...
...
@@ -176,7 +176,7 @@ class AdvServiceModel extends \Business\AbstractModel{
}else{
$advs = array();
}
}
}
*/
return
$advs
;
}
...
...
application/models/Business/Coupon/CouponService.php
View file @
215bedb5
...
...
@@ -270,7 +270,8 @@ class CouponServiceModel extends \Business\AbstractModel{
public
function
getStorePromotionCouponTitles
(
$where
){
$this
->
validCouponStore
(
$where
);
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponTitles
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$couponDao
,
'getStorePromotionCouponList'
),
array
(
$where
[
'storeId'
]),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]));
$couponTitles
=
$couponDao
->
getStorePromotionCouponList
(
$where
[
'storeId'
]);
//\Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$couponDao, 'getStorePromotionCouponList'),array($where['storeId']),\Our\ApiConst::oneHour,array($where['storeId']));
return
$couponTitles
?
$couponTitles
:
array
();
}
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
215bedb5
...
...
@@ -237,7 +237,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$firstClassId
=
intval
(
$param
[
'firstClassId'
]);
$secondClassId
=
intval
(
$param
[
'secondClassId'
]);
$thirdClassId
=
intval
(
$param
[
'thirdClassId'
]);
$keyword
=
trim
(
$param
[
'keyword'
]);
$keyword
=
(
string
)
trim
(
$param
[
'keyword'
]);
$minPrice
=
intval
(
$param
[
'minPrice'
]);
$maxPrice
=
intval
(
$param
[
'maxPrice'
]);
$goodsSort
=
intval
(
$param
[
'goodsSort'
]);
...
...
@@ -247,7 +247,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$secondClassId
&&
$where
[]
=
"gc_id_2 =
{
$secondClassId
}
"
;
$thirdClassId
&&
$where
[]
=
"gc_id_3 =
{
$thirdClassId
}
"
;
$storeThirdClassId
&&
$where
[]
=
"goods_class_t_id =
{
$storeThirdClassId
}
"
;
$keyword
&&
$where
[]
=
"goods_name like '%
{
$keyword
}
%'"
;
$keyword
!==
''
&&
$where
[]
=
"goods_name like '%
{
$keyword
}
%'"
;
list
(
$_where
,
$order
,
$attrStr
,
$saleSort
)
=
$this
->
getParam
(
$attrValue
,
$minPrice
,
$maxPrice
,
$goodsSort
);
$where
=
array_merge
(
$where
,
$_where
);
...
...
@@ -803,7 +803,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$thirdClassId
=
(
int
)(
$param
[
'thirdClassId'
]);
$storeThirdClassId
=
(
int
)(
$param
[
'storeThirdClassId'
]);
$couponId
=
(
int
)
$param
[
'couponId'
];
$keyword
=
trim
(
$param
[
'keyword'
]);
$keyword
=
(
string
)
trim
(
$param
[
'keyword'
]);
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponId
&&
$coupon
=
$couponDao
->
findById
(
$couponId
);
...
...
@@ -832,7 +832,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$productData
=
[];
$attributeRedis
=
\Redis\Db4\GoodsAttributeRedisModel
::
getInstance
();
$attrbuteDAO
=
\DAO\GoodsAttributeModel
::
getInstance
();
if
(
!
empty
(
$keyword
)
){
if
(
$keyword
!==
''
){
// if($where){
// $where = implode(' AND ',$where);
// }
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
215bedb5
...
...
@@ -604,7 +604,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
/*foreach($blIds as $val){
$group[]['blId']=$val;
}*/
$pBundlingList
=
$this
->
getPBundlingListByBlIds
(
$blIds
,
$dbName
,
true
);
$pBundlingList
=
$this
->
getPBundlingListByBlIds
(
$blIds
,
$dbName
,
array
(),
true
);
}
$goodsCommonIds
=
$cartListData
[
'goodsCommonIds'
];
$goodsIds
=
$cartListData
[
'goodsIds'
];
...
...
application/models/Business/Order/OrderService.php
View file @
215bedb5
...
...
@@ -104,7 +104,7 @@ class OrderServiceModel extends \Business\AbstractModel
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$refundReturnDao
=
\DAO\Order\RefundReturnModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
//
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
if
(
$keyWord
!==
false
)
{
$where
=
$this
->
getOrderIndexWhere
(
$memberId
,
$keyWord
,
$pageIndex
,
$pageSize
);
if
(
$where
===
false
){
...
...
@@ -128,7 +128,7 @@ class OrderServiceModel extends \Business\AbstractModel
}
//获得订单列表
$orders
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$this
->
orderField
,
$pageIndex
,
$pageSize
,
$order
=
array
(
'
add_tim
e'
=>
'desc'
)),
\Our\ApiConst
::
oneDaySecond
,
array
(
$memberId
));
$orders
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderDao
,
'getList'
),
array
(
$where
,
$this
->
orderField
,
$pageIndex
,
$pageSize
,
$order
=
array
(
'
gmt_updat
e'
=>
'desc'
)),
\Our\ApiConst
::
oneDaySecond
,
array
(
$memberId
));
if
(
!
empty
(
$orders
[
'list'
]))
{
$orderIds
=
array_column
(
$orders
[
'list'
],
'orderId'
);
//获得订单商品列表
...
...
@@ -561,6 +561,13 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
!
$update
||
!
$res
){
echo
'订单:'
.
$order
[
'orderId'
]
.
'没取消成功!'
;
}
//$orderGoodsUpdateData['refund_state_name']='退款成功';
$orderGoodsUpdateData
[
'is_refund'
]
=
1
;
$whereOrderGoods
[
'order_id'
]
=
$order
[
'orderId'
];
$orderGoodsUpdateRes
=
$orderGoodsDao
->
update
(
$whereOrderGoods
,
$orderGoodsUpdateData
);
if
(
!
$orderGoodsUpdateRes
){
echo
'订单:'
.
$order
[
'order_id'
]
.
'is_refund'
.
'没更新成功'
;
}
$orderDao
->
deleteOrderCache
(
$order
[
'buyerId'
],(
string
)
$order
[
'orderId'
],
$order
[
'storeId'
],
true
);
}
$orderIds
=
array_column
(
$orders
,
'orderId'
);
...
...
@@ -730,7 +737,7 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
empty
(
$diliverymanIds
))
{
ErrorModel
::
throwException
(
CodeConfigModel
::
commonError
);
}
$qmDeliveryLogList
=
$qmDeliveryLogDao
->
getListByDeliverymanIdAndTypeCache
(
$diliverymanIds
,
$type
,
$pageIndex
,
$pageSize
,
$memberId
);
$qmDeliveryLogList
=
$qmDeliveryLogDao
->
getListByDeliverymanIdAndTypeCache
(
$diliverymanIds
,
$type
,
$pageIndex
,
$pageSize
,
array
(
'get_time'
=>
'desc'
),
$memberId
);
$orderIds
=
array_column
(
$qmDeliveryLogList
[
'list'
],
'orderId'
);
// echo json_encode($orderIds);exit;
// $where['delete_state'] = ApiConst::undeleteOrder;
...
...
@@ -765,7 +772,7 @@ class OrderServiceModel extends \Business\AbstractModel
$delivery
[
'mobPhone'
]
=
$delivery
[
'mobPhone'
]
?
$delivery
[
'mobPhone'
]
:
''
;
$delivery
[
'finishTime'
]
=
$delivery
[
'finishTime'
]
?
$delivery
[
'finishTime'
]
:
ApiConst
::
zero
;
$delivery
[
'orderGoods'
]
=
!
empty
(
$goodsDao
->
convert
(
$orderMerge
[
$value
[
'orderId'
]][
'orderGoods'
]))
?
$goodsDao
->
convert
(
$orderMerge
[
$value
[
'orderId'
]][
'orderGoods'
])
:
array
();
$delivery
[
'street'
]
=
$delivery
[
'reciverInfo'
][
'address'
]
.
$delivery
[
'reciverInfo'
][
'street'
]
;
$delivery
[
'street'
]
=
$delivery
[
'reciverInfo'
][
'address'
];
$delivery
[
'lng'
]
=
$delivery
[
'reciverInfo'
][
'lng'
]
?
$delivery
[
'reciverInfo'
][
'lng'
]
:
0.0
;
$delivery
[
'lat'
]
=
$delivery
[
'reciverInfo'
][
'lat'
]
?
$delivery
[
'reciverInfo'
][
'lat'
]
:
0.0
;
$delivery
[
'subAddress'
]
=
isset
(
$delivery
[
'reciverInfo'
][
'sub_address'
])
?
$delivery
[
'reciverInfo'
][
'sub_address'
]
:
''
;
...
...
@@ -833,6 +840,7 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
$delivery
[
'deliveryState'
]
==
ApiConst
::
deliveryStateWait
||
$delivery
[
'deliveryState'
]
==
ApiConst
::
deliveryStateWaitTen
){
$delivery
[
'deliveryState'
]
=
ApiConst
::
deliveryStateWait
;
}
// $reciverInfo['sub_address']
$returnData
=
array
(
'orderId'
=>
$this
->
order
[
'orderId'
],
'storeName'
=>
$this
->
order
[
'storeName'
],
...
...
@@ -845,10 +853,10 @@ class OrderServiceModel extends \Business\AbstractModel
'getTime'
=>
$delivery
[
'getTime'
],
'reciverName'
=>
$this
->
orderCommon
[
'reciverName'
],
'mobPhone'
=>
$reciverInfo
[
'mob_phone'
],
'street'
=>
$reciverInfo
[
'
street
'
],
'street'
=>
$reciverInfo
[
'
address
'
],
'lng'
=>
isset
(
$reciverInfo
[
'lng'
])
?
$reciverInfo
[
'lng'
]
:
ApiConst
::
zero
,
'lat'
=>
isset
(
$reciverInfo
[
'lat'
])
?
$reciverInfo
[
'lat'
]
:
ApiConst
::
zero
,
'subAddress'
=>
isset
(
$reciverInfo
[
'sub_address'
])
?
$reciverInfo
[
'sub_address'
]
:
''
,
'subAddress'
=>
isset
(
$reciverInfo
[
'sub_address'
])
?
$reciverInfo
[
'sub_address'
]
:
''
,
'orderGoods'
=>
$orderGoods
,
'shippingFee'
=>
$this
->
order
[
'shippingFee'
],
...
...
@@ -871,7 +879,7 @@ class OrderServiceModel extends \Business\AbstractModel
$push
=
Push
::
getInstance
();
$push
->
reacheRemind
(
$order
[
'buyerId'
],
$order
[
'orderId'
],
$order
[
'orderSn'
]);
}
$orderDao
->
deleteOrderCache
(
$memberid
,
$qmDeliveryManLog
[
'orderId'
],
$order
[
'storeId'
],
true
);
$orderDao
->
deleteOrderCache
(
$memberid
,
$qmDeliveryManLog
[
'orderId'
],
$order
[
'storeId'
],
true
,
true
,
true
,
$memberid
);
$qmDeliverymanLogDao
->
deleteOrderCache
(
$memberid
,
$id
);
return
$updateResult
;
}
else
{
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
215bedb5
...
...
@@ -491,7 +491,6 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$this
->
taskIndex
=
PageConst
::
taskPageBegin
;
$this
->
taskSize
=
PageConst
::
taskPageSize
;
do
{
$addDatas
=
array
();
$storeMemberStatisticData
=
$orderGoodDao
->
getMemberStoreStaticsByCreateTime
(
$beginTime
,
$this
->
taskIndex
,
$this
->
taskSize
);
$storeMemberStatisticData
=
isset
(
$storeMemberStatisticData
[
'list'
])
?
$storeMemberStatisticData
[
'list'
]
:
false
;
if
(
$storeMemberStatisticData
){
...
...
@@ -506,7 +505,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
if
(
!
empty
(
$ordersCount
)
&&
!
empty
(
$refundLists
)){
foreach
(
$ordersCount
as
&
$order
){
foreach
(
$refundLists
as
$refund
){
if
(
$order
[
'buyerId'
]
==
$refund
[
'buyerId'
]
and
$order
[
'storeId'
]
==
$refund
[
'storeId'
]){
if
(
$order
[
'buyerId'
]
==
$refund
[
'buyerId'
]
&&
$order
[
'storeId'
]
==
$refund
[
'storeId'
]){
$order
[
'orderTotal'
]
=
$order
[
'orderTotal'
]
-
$refund
[
'refundTotal'
];
}
}
...
...
application/models/Business/User/AddressService.php
View file @
215bedb5
...
...
@@ -553,6 +553,9 @@ class AddressServiceModel extends \Business\AbstractModel {
if
(
!
(
$address
[
'citycode'
])){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyCityCodeForSave
);
}
if
(
intval
(
$address
[
'citycode'
])
<=
0
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongCityCode
);
}
if
(
!
(
$address
[
'lng'
]
&&
$address
[
'lat'
])){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
chooseAddressFormMap
);
}
...
...
application/models/Business/User/MemberCenterService.php
View file @
215bedb5
...
...
@@ -281,10 +281,10 @@ class MemberCenterServiceModel extends \Business\AbstractModel
//删除缓存
if
(
is_array
(
$ids
)
&&
count
(
$ids
)
<=
20
){
foreach
(
$ids
as
$v
){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db4\FavoritesRedisModel
::
getInstance
(),
array
(
&
$favoritesInstance
,
'getOne'
),
array
(
'*'
,
array
(
'
goods_commonid'
=>
$v
,
'member_id'
=>
$memberId
)),
array
(
$memberId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db4\FavoritesRedisModel
::
getInstance
(),
array
(
&
$favoritesInstance
,
'getOne'
),
array
(
'*'
,
array
(
'
member_id'
=>
$memberId
,
'goods_commonid'
=>
$v
)),
array
(
$memberId
));
}
}
elseif
(
!
is_array
(
$ids
)){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db4\FavoritesRedisModel
::
getInstance
(),
array
(
&
$favoritesInstance
,
'getOne'
),
array
(
'*'
,
array
(
'
goods_commonid'
=>
$ids
,
'member_id'
=>
$memberId
)),
array
(
$memberId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db4\FavoritesRedisModel
::
getInstance
(),
array
(
&
$favoritesInstance
,
'getOne'
),
array
(
'*'
,
array
(
'
member_id'
=>
$memberId
,
'goods_commonid'
=>
$ids
)),
array
(
$memberId
));
}
else
{
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db4\FavoritesRedisModel
::
getInstance
(),
array
(
&
$favoritesInstance
,
'getOne'
),
array
(),
array
(
$memberId
));
}
...
...
application/models/DAO/Coupon/Coupon.php
View file @
215bedb5
...
...
@@ -152,9 +152,9 @@ class CouponModel extends \DAO\AbstractModel {
$field
=
$this
->
availStoreIndexField
;
$where
=
' and store_id ='
.
$storeId
.
' and type<>1'
;
$this
->
setDb
(
$this
->
dbName
);
$coupons
=
$this
->
getOnlineCouponList
(
$where
,
$field
);
//
$coupons = $this->getOnlineCouponList($where,$field);
//$coupons = \Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$this, 'getOnlineCouponList'),array($where,$field),\Our\ApiConst::oneHour
);
$coupons
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getOnlineCouponList'
),
array
(
$where
,
$field
),
\Our\ApiConst
::
oneHour
,
array
(
$storeId
)
);
//$coupons = $this->getOnlineCouponList($where,$field);
if
(
!
$coupons
){
...
...
@@ -169,6 +169,9 @@ class CouponModel extends \DAO\AbstractModel {
$storeCouponGoodsClassDao
=
\DAO\GoodsClass\StoreCouponGoodsClassModel
::
getInstance
();
$result
=
array
();
foreach
(
$coupons
as
$coupon
){
if
(
!
(
$coupon
[
'start_time'
]
<=
TIMESTAMP
&&
$coupon
[
'end_time'
]
>
TIMESTAMP
)){
continue
;
}
if
(
$coupon
[
'type'
]
==
\Our\ApiConst
::
goodsClassCoupon
){
//指定品类优惠券,需要判断该优惠券对应分类店铺是否在经营
if
(
$storeClassIds
){
$gcIds
=
$storeCouponGoodsClassDao
->
getGoodsClassIdsByCouponId
(
$coupon
[
'id'
]);
...
...
@@ -489,6 +492,27 @@ class CouponModel extends \DAO\AbstractModel {
}
}
/**
* 删除店铺优惠券缓存
* @param $storeId 店铺ID
* @param bool $couponId 指定优惠券ID
* @throws \Our\Exception
*/
public
function
deleteCouponCache
(
$storeId
,
$couponId
=
false
){
$couponService
=
\Business\Coupon\CouponServiceModel
::
getInstance
();
$memberCouponDao
=
\DAO\Coupon\MemberCouponModel
::
getInstance
();
if
(
$couponId
){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$couponId
));
}
//\Our\RedisHelper::delCachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$this, 'getStorePromotionCouponList'),array(),array($storeId));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$couponService
,
'getStoreCouponsById'
),
array
(),
array
(
$storeId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getOnlineCouponList'
),
array
(),
array
(
$storeId
));
return
true
;
}
public
function
getDb
()
{
return
$this
->
db
;
...
...
@@ -512,22 +536,6 @@ class CouponModel extends \DAO\AbstractModel {
}
/**
* 删除店铺优惠券缓存
* @param $storeId 店铺ID
* @param bool $couponId 指定优惠券ID
* @throws \Our\Exception
*/
public
function
deleteCouponCache
(
$storeId
,
$couponId
=
false
){
$couponService
=
\Business\Coupon\CouponServiceModel
::
getInstance
();
$memberCouponDao
=
\DAO\Coupon\MemberCouponModel
::
getInstance
();
if
(
$couponId
){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$couponId
));
}
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStorePromotionCouponList'
),
array
(),
array
(
$storeId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$couponService
,
'getStoreCouponsById'
),
array
(),
array
(
$storeId
));
return
true
;
}
}
application/models/DAO/DeliveryFormula.php
View file @
215bedb5
...
...
@@ -149,6 +149,7 @@ class DeliveryFormulaModel extends \DAO\AbstractModel {
break
;
}
}
$expriseStartTime
+=
$deliveryIntval
*
\Our\ApiConst
::
oneMinute
;
if
(
$expriseStartTime
<
$todayEndTime
){
$expriseData
=
$this
->
getTomorrowFormulaList
(
$expriseStartTime
,
$todayEndTime
,
$deliveryIntval
*
\Our\ApiConst
::
oneMinute
,
$minFee
,
$myCurrentStartTime
);
if
(
$expriseData
){
...
...
application/models/DAO/Order/Order.php
View file @
215bedb5
...
...
@@ -386,6 +386,20 @@ class OrderModel extends \DAO\AbstractModel
}
}
public
function
getFieldByWhere
(
$where
,
$filed
){
$this
->
setDb
(
$this
->
dbName
);
if
(
is_array
(
$where
)){
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
}
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$filed
)
->
where
(
$where
)
->
fetchAll
();
if
(
$res
){
$fie
=
array_column
(
$res
,
$filed
);
return
$fie
;
}
else
{
return
[];
}
}
public
function
getSumAmountCountByMemberAndStoreId
(
$storeIds
,
$memberIds
)
{
$this
->
setDb
(
$this
->
dbName
);
...
...
application/models/DAO/Order/OrderGoods.php
View file @
215bedb5
...
...
@@ -2,6 +2,7 @@
namespace
DAO\Order
;
use
Our\ApiConst
;
use
Our\ArrayConst
;
use
Our\Common
;
use
Our\DbNameConst
;
use
Our\ImageConst
;
...
...
@@ -65,8 +66,15 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
public
function
getOrderGoodsCountByStoreId
(
$storeId
){
$this
->
setDb
(
$this
->
dbName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$where
[
'store_id'
]
=
$storeId
;
$where
[
'is_refund'
]
=
array
(
'neq'
,
ApiConst
::
refundSuccess
);
$whereOrder
[
'store_id'
]
=
array
(
'eq'
,
$storeId
);
$whereOrder
[
'order_state'
]
=
array
(
'in'
,
ArrayConst
::
orderCloseAndCancel
);
$orderIds
=
$orderDao
->
getFieldByWhere
(
$whereOrder
,
'order_id'
);
if
(
$orderIds
){
$where
[
'order_id'
]
=
array
(
'notin'
,
$orderIds
);
}
if
(
is_array
(
$where
)){
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
}
...
...
@@ -235,9 +243,17 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
public
function
getMemberStoreOrderGoodsCount
(
$storeIds
,
$memberIds
){
$this
->
setDb
(
$this
->
dbName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$whereOrder
[
'store_id'
]
=
array
(
'in'
,
$storeIds
);
$whereOrder
[
'buyer_id'
]
=
array
(
'in'
,
$memberIds
);
$whereOrder
[
'order_state'
]
=
array
(
'in'
,
ArrayConst
::
orderCloseAndCancel
);
$orderIds
=
$orderDao
->
getFieldByWhere
(
$whereOrder
,
'order_id'
);
$where
[
'store_id'
]
=
array
(
'in'
,
$storeIds
);
$where
[
'buyer_id'
]
=
array
(
'in'
,
$memberIds
);
$where
[
'is_refund'
]
=
array
(
'neq'
,
ApiConst
::
refundSuccess
);
if
(
$orderIds
){
$where
[
'order_id'
]
=
array
(
'notin'
,
$orderIds
);
}
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
$res
=
$this
->
db
->
from
(
$this
->
_tableName
)
->
select
(
$this
->
sumGoodsNum
)
->
where
(
$where
)
->
group
(
"buyer_id"
)
->
group
(
"store_id"
)
->
fetchAll
();
return
$res
;
...
...
application/models/DAO/Order/RefundReturn.php
View file @
215bedb5
...
...
@@ -435,7 +435,7 @@ class RefundReturnModel extends \DAO\AbstractModel {
public
function
getMemberStoreStaticsByGmtUpdate
(
$gmtUpdate
,
$pageIndex
,
$pageSize
){
$this
->
setDb
(
$this
->
dbName
);
$where
=
\Our\Common
::
format
(
' gmt_update>={0} and gmt_update<{1} and refund_state={2}'
,
$gmtUpdate
,
TIMESTAMP
,
ApiConst
::
refundStateComplete
);
$where
=
\Our\Common
::
format
(
' gmt_update>={0} and gmt_update<{1} and refund_state={2}'
,
$gmtUpdate
,
TIMESTAMP
,
ApiConst
::
refundStateComplete
);
$res
=
$this
->
lists
(
$where
,
array
(
'gmt_update'
=>
'asc'
),
$this
->
sumField
,
$pageIndex
,
$pageSize
);
return
$res
[
'list'
]
?
$res
:
false
;
}
...
...
application/models/Error/CodeConfig.php
View file @
215bedb5
...
...
@@ -367,6 +367,7 @@ class CodeConfigModel {
const
emptyDistrictId
=
140020
;
const
emptyAddressAndName
=
140021
;
const
wrongAddressTagType
=
140022
;
const
wrongCityCode
=
140023
;
//消息,推送等
const
removeMessage
=
150001
;
...
...
@@ -599,6 +600,7 @@ class CodeConfigModel {
self
::
emptyDistrictId
=>
'找不到对应区'
,
self
::
emptyAddressAndName
=>
'地址和具体街道不能为空'
,
self
::
wrongAddressTagType
=>
'地址标签传输错误'
,
self
::
wrongCityCode
=>
'城市码格式错误'
,
self
::
emptyLatLng
=>
'经纬度不能为空'
,
self
::
emptyCityCode
=>
'高德地图城市编码不能为空'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment