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
55c522f0
Commit
55c522f0
authored
Aug 29, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券领取问题q
parent
2e0e7825
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
CouponService.php
application/models/Business/Coupon/CouponService.php
+4
-4
Coupon.php
application/models/DAO/Coupon/Coupon.php
+1
-1
No files found.
application/models/Business/Coupon/CouponService.php
View file @
55c522f0
...
@@ -164,7 +164,7 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -164,7 +164,7 @@ class CouponServiceModel extends \Business\AbstractModel{
}
}
$couponDao
->
db
->
doCommit
();
$couponDao
->
db
->
doCommit
();
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$memberId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\MemberCouponRedisModel
::
getInstance
(),
array
(
&
$memberCouponDao
,
'getList'
),
array
(),
array
(
$memberId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$coupon
[
'store_id'
],
$memberId
));
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
),
array
(
$coupon
[
'store_id'
]
.
"_"
.
$memberId
));
return
true
;
return
true
;
}
}
...
@@ -278,7 +278,7 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -278,7 +278,7 @@ class CouponServiceModel extends \Business\AbstractModel{
public
function
getStoreCoupons
(
$where
,
$memberId
=
null
){
public
function
getStoreCoupons
(
$where
,
$memberId
=
null
){
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponDao
->
validStoreCouponParam
(
$where
);
$couponDao
->
validStoreCouponParam
(
$where
);
$couponList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$where
[
'storeId'
],
$memberId
),
\Our\ApiConst
::
oneHour
);
$couponList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$where
[
'storeId'
],
$memberId
),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]
.
"_"
.
$memberId
)
);
if
(
$couponList
){
if
(
$couponList
){
$couponList
=
array_values
(
$couponList
);
$couponList
=
array_values
(
$couponList
);
}
}
...
@@ -289,7 +289,7 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -289,7 +289,7 @@ class CouponServiceModel extends \Business\AbstractModel{
$this
->
validCouponStore
(
$where
);
$this
->
validCouponStore
(
$where
);
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponDao
->
validStoreCouponParam
(
$where
);
$couponDao
->
validStoreCouponParam
(
$where
);
$couponList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$where
[
'storeId'
],
$memberId
,
true
),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]
));
$couponList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$where
[
'storeId'
],
$memberId
,
\Our\ApiConst
::
one
),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]
.
"_"
.
$memberId
));
if
(
$couponList
){
if
(
$couponList
){
$couponList
=
array_values
(
$couponList
);
$couponList
=
array_values
(
$couponList
);
if
(
count
(
$couponList
)
>=
\Our\ApiConst
::
defaultCouponTitleLength
){
if
(
count
(
$couponList
)
>=
\Our\ApiConst
::
defaultCouponTitleLength
){
...
@@ -325,7 +325,7 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -325,7 +325,7 @@ class CouponServiceModel extends \Business\AbstractModel{
* @param $memberId 会员ID
* @param $memberId 会员ID
* @return array|bool
* @return array|bool
*/
*/
public
function
getStoreCouponsById
(
$storeId
,
$memberId
,
$timeFlag
=
false
){
public
function
getStoreCouponsById
(
$storeId
,
$memberId
,
$timeFlag
=
\Our\ApiConst
::
zero
){
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponDao
=
\DAO\Coupon\CouponModel
::
getInstance
();
$couponList
=
$couponDao
->
getStoreIndexCouponList
(
$storeId
,
$timeFlag
);
$couponList
=
$couponDao
->
getStoreIndexCouponList
(
$storeId
,
$timeFlag
);
if
(
!
$couponList
){
if
(
!
$couponList
){
...
...
application/models/DAO/Coupon/Coupon.php
View file @
55c522f0
...
@@ -261,7 +261,7 @@ class CouponModel extends \DAO\AbstractModel {
...
@@ -261,7 +261,7 @@ class CouponModel extends \DAO\AbstractModel {
* @param $storeId 店铺Id
* @param $storeId 店铺Id
* @return array
* @return array
*/
*/
public
function
getStoreIndexCouponList
(
$storeId
,
$timeFlag
=
false
){
public
function
getStoreIndexCouponList
(
$storeId
,
$timeFlag
=
\Our\ApiConst
::
zero
){
$coupons
=
$this
->
getStoreCouponList
(
$storeId
);
$coupons
=
$this
->
getStoreCouponList
(
$storeId
);
if
(
$coupons
){
if
(
$coupons
){
$result
=
array
();
$result
=
array
();
...
...
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