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
6f9c8c46
Commit
6f9c8c46
authored
Aug 30, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券为空问题吊证
parent
b817946e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Store.php
application/controllers/Store.php
+1
-2
CouponService.php
application/models/Business/Coupon/CouponService.php
+3
-1
No files found.
application/controllers/Store.php
View file @
6f9c8c46
...
@@ -113,8 +113,7 @@ class StoreController extends \Our\Controller_AbstractIndex {
...
@@ -113,8 +113,7 @@ class StoreController extends \Our\Controller_AbstractIndex {
$data
=
$this
->
req
[
\Our\NameConst
::
data
];
$data
=
$this
->
req
[
\Our\NameConst
::
data
];
$couponService
=
\Business\Coupon\CouponServiceModel
::
getInstance
();
$couponService
=
\Business\Coupon\CouponServiceModel
::
getInstance
();
$couponTitles
=
$couponService
->
getStorePromotionCouponTitles
(
$data
);
$couponTitles
=
$couponService
->
getStorePromotionCouponTitles
(
$data
);
$couponTitles
=!
empty
(
$couponTitles
)
?
$couponTitles
:
array
();
$this
->
success
(
$couponTitles
);
$this
->
success
(
$couponTitles
);
}
}
}
}
\ No newline at end of file
application/models/Business/Coupon/CouponService.php
View file @
6f9c8c46
...
@@ -269,7 +269,7 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -269,7 +269,7 @@ class CouponServiceModel extends \Business\AbstractModel{
$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
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$couponDao
,
'getStorePromotionCouponList'
),
array
(
$where
[
'storeId'
]),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]));
return
$couponTitles
;
return
$couponTitles
?
$couponTitles
:
array
()
;
}
}
/**
/**
...
@@ -281,6 +281,8 @@ class CouponServiceModel extends \Business\AbstractModel{
...
@@ -281,6 +281,8 @@ class CouponServiceModel extends \Business\AbstractModel{
$couponList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db13\CouponRedisModel
::
getInstance
(),
array
(
&
$this
,
'getStoreCouponsById'
),
array
(
$where
[
'storeId'
],
$memberId
),
\Our\ApiConst
::
oneHour
,
array
(
$where
[
'storeId'
]
.
"_"
.
$memberId
));
$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
);
}
else
{
$couponList
=
array
();
}
}
return
$couponList
;
return
$couponList
;
}
}
...
...
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