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
aa258842
Commit
aa258842
authored
Sep 20, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券和购物车组合销售商品提交问题
parent
0d297654
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
CouponService.php
application/models/Business/Coupon/CouponService.php
+2
-1
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+1
-1
Coupon.php
application/models/DAO/Coupon/Coupon.php
+7
-3
No files found.
application/models/Business/Coupon/CouponService.php
View file @
aa258842
...
@@ -270,7 +270,8 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -270,7 +270,8 @@ class CouponServiceModel extends \Business\AbstractModel{
public
function
getStorePromotionCouponTitles
(
$where
){
public
function
getStorePromotionCouponTitles
(
$where
){
$this
->
validCouponStore
(
$where
);
$this
->
validCouponStore
(
$where
);
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$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
();
return
$couponTitles
?
$couponTitles
:
array
();
}
}
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
aa258842
...
@@ -604,7 +604,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
...
@@ -604,7 +604,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
/*foreach($blIds as $val){
/*foreach($blIds as $val){
$group[]['blId']=$val;
$group[]['blId']=$val;
}*/
}*/
$pBundlingList
=
$this
->
getPBundlingListByBlIds
(
$blIds
,
$dbName
,
true
);
$pBundlingList
=
$this
->
getPBundlingListByBlIds
(
$blIds
,
$dbName
,
array
(),
true
);
}
}
$goodsCommonIds
=
$cartListData
[
'goodsCommonIds'
];
$goodsCommonIds
=
$cartListData
[
'goodsCommonIds'
];
$goodsIds
=
$cartListData
[
'goodsIds'
];
$goodsIds
=
$cartListData
[
'goodsIds'
];
...
...
application/models/DAO/Coupon/Coupon.php
View file @
aa258842
...
@@ -152,9 +152,9 @@ class CouponModel extends \DAO\AbstractModel {
...
@@ -152,9 +152,9 @@ class CouponModel extends \DAO\AbstractModel {
$field
=
$this
->
availStoreIndexField
;
$field
=
$this
->
availStoreIndexField
;
$where
=
' and store_id ='
.
$storeId
.
' and type<>1'
;
$where
=
' and store_id ='
.
$storeId
.
' and type<>1'
;
$this
->
setDb
(
$this
->
dbName
);
$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);
//$coupons = $this->getOnlineCouponList($where,$field);
if
(
!
$coupons
){
if
(
!
$coupons
){
...
@@ -169,6 +169,9 @@ class CouponModel extends \DAO\AbstractModel {
...
@@ -169,6 +169,9 @@ class CouponModel extends \DAO\AbstractModel {
$storeCouponGoodsClassDao
=
\DAO\GoodsClass\StoreCouponGoodsClassModel
::
getInstance
();
$storeCouponGoodsClassDao
=
\DAO\GoodsClass\StoreCouponGoodsClassModel
::
getInstance
();
$result
=
array
();
$result
=
array
();
foreach
(
$coupons
as
$coupon
){
foreach
(
$coupons
as
$coupon
){
if
(
!
(
$coupon
[
'start_time'
]
<=
TIMESTAMP
&&
$coupon
[
'end_time'
]
>
TIMESTAMP
)){
continue
;
}
if
(
$coupon
[
'type'
]
==
\Our\ApiConst
::
goodsClassCoupon
){
//指定品类优惠券,需要判断该优惠券对应分类店铺是否在经营
if
(
$coupon
[
'type'
]
==
\Our\ApiConst
::
goodsClassCoupon
){
//指定品类优惠券,需要判断该优惠券对应分类店铺是否在经营
if
(
$storeClassIds
){
if
(
$storeClassIds
){
$gcIds
=
$storeCouponGoodsClassDao
->
getGoodsClassIdsByCouponId
(
$coupon
[
'id'
]);
$gcIds
=
$storeCouponGoodsClassDao
->
getGoodsClassIdsByCouponId
(
$coupon
[
'id'
]);
...
@@ -524,8 +527,9 @@ class CouponModel extends \DAO\AbstractModel {
...
@@ -524,8 +527,9 @@ class CouponModel extends \DAO\AbstractModel {
if
(
$couponId
){
if
(
$couponId
){
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$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(&$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
(
&
$couponService
,
'getStoreCouponsById'
),
array
(),
array
(
$storeId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getOnlineCouponList'
),
array
(),
array
(
$storeId
));
return
true
;
return
true
;
}
}
...
...
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