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
bf28104b
Commit
bf28104b
authored
Oct 08, 2018
by
chenchuanwen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into master_dev
parents
2a9c0d56
81131c49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+11
-0
CouponService.php
application/models/Business/Coupon/CouponService.php
+9
-5
OrderService.php
application/models/Business/Order/OrderService.php
+3
-3
StoreService.php
application/models/Business/Store/StoreService.php
+1
-1
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
bf28104b
...
...
@@ -45,6 +45,8 @@ class OrderConfirmUtil {
private
$pushMessageOrders
=
array
();
private
$couponCacheFlag
=
false
;
public
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
$storeCartData
=
$this
->
checkPostData
(
$data
,
$memberId
,
$currentAddress
);
//return $storeCartData;
...
...
@@ -423,6 +425,7 @@ class OrderConfirmUtil {
if
(
$storeCarts
[
'giftCoupon'
]){
$giftCoupons
[]
=
$storeCarts
[
'giftCoupon'
];
}
$this
->
couponCacheFlag
=
true
;
}
$resultAddress
=
$addressDao
->
updateOrderAddress
(
$this
->
address
[
'address_id'
],
$this
->
memberId
);
if
(
!
$resultAddress
){
...
...
@@ -538,10 +541,18 @@ class OrderConfirmUtil {
if
(
$this
->
cartCacheDeleteFlag
){
$this
->
delCartCache
();
}
if
(
$this
->
couponCacheFlag
){
$this
->
delCouponCahce
();
}
$this
->
deleteCacheInfo
();
$this
->
pushSaleGoods
();
}
public
function
delCouponCahce
(){
$memberCouponDao
=
\DAO\Coupon\MemberCouponModel
::
getInstance
();
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$this
->
memberId
));
}
public
function
delCartCache
(){
$cartRedis
=
\Redis\Db7\CartRedisModel
::
getInstance
();
$memberCartKey
=
\Our\NameConst
::
memberCartStorePrefix
.
$this
->
memberId
;
...
...
application/models/Business/Coupon/CouponService.php
View file @
bf28104b
...
...
@@ -247,14 +247,18 @@ class CouponServiceModel extends \Business\AbstractModel{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
couponNoUsedTicketNum
);
}
$memberCouponDao
=
\DAO\Coupon\MemberCouponModel
::
getInstance
(
$dbName
);
if
(
$coupon
[
'is_overlay'
]){
//允许领用多张的优惠券是否存在已经领取的未使用有效优惠券
$whereSql
=
'
coupon_state ='
.
\Our\ApiConst
::
couponUnused
.
' and
member_id ='
.
$memberId
.
' and coupon_id='
.
$coupon
[
'id'
]
.
' and out_time > '
.
time
();
/*
if($coupon['is_overlay']){//允许领用多张的优惠券是否存在已经领取的未使用有效优惠券
$whereSql = ' member_id ='.$memberId.' and coupon_id='.$coupon['id'].' and out_time > '.time();
//$memberCoupons = \Our\RedisHelper::cachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(), array(&$memberCouponDao, 'getList'),array($whereSql),\Our\ApiConst::oneHour,array($where['couponId']));
$memberCoupons = $memberCouponDao->getList($whereSql);
if($memberCoupons&&count($memberCoupons)>=$coupon['get_ticket_num']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::alreadyGetTheCoupon);
}
}else{//不允许领用多张的优惠券
$memberCoupons
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(
array
(
'coupon_id'
=>
$where
[
'couponId'
],
'member_id'
=>
$memberId
)),
\Our\ApiConst
::
oneHour
,
array
(
$memberId
));
}
if
(
$memberCoupons
&&
count
(
$memberCoupons
)
>
0
){
}*/
$memberCoupons
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(
array
(
'coupon_id'
=>
$where
[
'couponId'
],
'member_id'
=>
$memberId
)),
\Our\ApiConst
::
oneHour
,
array
(
$memberId
));
if
(
$memberCoupons
&&
count
(
$memberCoupons
)
>=
$coupon
[
'get_ticket_num'
]){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
alreadyGetTheCoupon
);
}
return
true
;
...
...
application/models/Business/Order/OrderService.php
View file @
bf28104b
...
...
@@ -1008,10 +1008,10 @@ class OrderServiceModel extends \Business\AbstractModel
$orderAmount
=
intval
(
$coupon
[
'order_amount'
]);
if
(
$coupon
[
'type'
]
==
\Our\ApiConst
::
noLimitCoupon
)
{
//无门槛优惠券
$temp
[
'type'
]
=
\Our\ApiConst
::
noLimitCouponType
;
$temp
[
'title'
]
=
$coupon
[
'cash_money'
]
;
$temp
[
'title'
]
=
intval
(
$coupon
[
'cash_money'
])
;
$temp
[
'subTitle'
]
=
\Our\DescribeConst
::
noLimitCoupon
;
}
else
if
(
$coupon
[
'coupon_type'
]
==
\Our\ApiConst
::
fullMinusCouponType
)
{
//满额减免券
$temp
[
'title'
]
=
$coupon
[
'cash_money'
]
;
$temp
[
'title'
]
=
intval
(
$coupon
[
'cash_money'
])
;
$temp
[
'subTitle'
]
=
\Our\Common
::
format
(
\Our\DescribeConst
::
couponFullAvailable
,
$orderAmount
);
}
else
if
(
$coupon
[
'coupon_type'
]
==
\Our\ApiConst
::
discountCouponType
)
{
$temp
[
'title'
]
=
$coupon
[
'discount'
];
...
...
@@ -1025,7 +1025,7 @@ class OrderServiceModel extends \Business\AbstractModel
}
$temp
[
'storeId'
]
=
$coupon
[
'store_id'
];
if
(
$temp
[
'storeId'
])
{
$storeInfo
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$storeDao
,
'getInfoById'
),
array
(
$temp
[
'storeId'
],
'store_name'
),
\Our\ApiConst
::
oneHour
);
$storeInfo
=
$storeDao
->
get
(
$temp
[
'storeId'
],
false
);
if
(
!
$storeInfo
)
{
continue
;
}
...
...
application/models/Business/Store/StoreService.php
View file @
bf28104b
...
...
@@ -595,7 +595,7 @@ class StoreServiceModel extends \Business\AbstractModel{
}
}
if
(
$exitStore
&&
$purchasedStore
&&
$exitStore
[
'storeId'
]
==
$purchasedStore
[
'storeId'
]){
$returnStores
[
'stores'
][]
=
$
purchased
Store
;
$returnStores
[
'stores'
][]
=
$
exit
Store
;
}
else
{
if
(
isset
(
$exitStore
)
&&
$exitStore
){
$returnStores
[
'stores'
][]
=
$exitStore
;
...
...
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