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
df234ec7
Commit
df234ec7
authored
Sep 21, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车下单是删除购物车缓存
parent
0356bcb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+16
-0
AdvService.php
application/models/Business/Common/AdvService.php
+3
-3
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
df234ec7
...
@@ -41,6 +41,8 @@ class OrderConfirmUtil {
...
@@ -41,6 +41,8 @@ class OrderConfirmUtil {
private
$storeMemos
=
array
();
private
$storeMemos
=
array
();
private
$cartCacheDeleteFlag
=
false
;
public
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
public
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
$storeCartData
=
$this
->
checkPostData
(
$data
,
$memberId
,
$currentAddress
);
$storeCartData
=
$this
->
checkPostData
(
$data
,
$memberId
,
$currentAddress
);
//return $storeCartData;
//return $storeCartData;
...
@@ -89,6 +91,7 @@ class OrderConfirmUtil {
...
@@ -89,6 +91,7 @@ class OrderConfirmUtil {
$this
->
storeIds
=
array_keys
(
$cartList
[
'list'
]);
$this
->
storeIds
=
array_keys
(
$cartList
[
'list'
]);
$this
->
storeMemos
[
$this
->
postData
[
'storeId'
]]
=
isset
(
$this
->
postData
[
'storeMemo'
])
?
$this
->
postData
[
'storeMemo'
]
:
\Our\NameConst
::
emptyString
;
$this
->
storeMemos
[
$this
->
postData
[
'storeId'
]]
=
isset
(
$this
->
postData
[
'storeMemo'
])
?
$this
->
postData
[
'storeMemo'
]
:
\Our\NameConst
::
emptyString
;
}
else
{
}
else
{
$this
->
cartCacheDeleteFlag
=
true
;
foreach
(
$this
->
postData
as
$temp
){
foreach
(
$this
->
postData
as
$temp
){
$this
->
checkOneStoreData
(
$temp
);
$this
->
checkOneStoreData
(
$temp
);
if
(
!
$temp
[
'cartIds'
]){
if
(
!
$temp
[
'cartIds'
]){
...
@@ -513,10 +516,23 @@ class OrderConfirmUtil {
...
@@ -513,10 +516,23 @@ class OrderConfirmUtil {
}
}
public
function
opCacheInfo
(){
public
function
opCacheInfo
(){
if
(
$this
->
cartCacheDeleteFlag
){
$this
->
delCartCache
();
}
$this
->
deleteCacheInfo
();
$this
->
deleteCacheInfo
();
$this
->
pushSaleGoods
();
$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
(){
public
function
pushSaleGoods
(){
if
(
$this
->
saleGoodsIds
){
if
(
$this
->
saleGoodsIds
){
$saleGoodsDao
=
\DAO\SaleGoodsModel
::
getInstance
();
$saleGoodsDao
=
\DAO\SaleGoodsModel
::
getInstance
();
...
...
application/models/Business/Common/AdvService.php
View file @
df234ec7
...
@@ -157,8 +157,8 @@ class AdvServiceModel extends \Business\AbstractModel{
...
@@ -157,8 +157,8 @@ class AdvServiceModel extends \Business\AbstractModel{
$advMobileSql
=
\Our\Common
::
format
(
$advMobileSql
,
$where
[
'storeId'
],
$position
,
\Our\ApiConst
::
one
,
\Our\ApiConst
::
one
);
$advMobileSql
=
\Our\Common
::
format
(
$advMobileSql
,
$where
[
'storeId'
],
$position
,
\Our\ApiConst
::
one
,
\Our\ApiConst
::
one
);
$advMobileField
=
'href,src,end_time,start_time'
;
$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'
]));
$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
){
if
(
$advMobileList
){
$advs
=
array
();
foreach
(
$advMobileList
as
$adv
){
foreach
(
$advMobileList
as
$adv
){
if
(
$adv
[
'start_time'
]
<=
TIMESTAMP
&&
$adv
[
'end_time'
]
>
TIMESTAMP
){
if
(
$adv
[
'start_time'
]
<=
TIMESTAMP
&&
$adv
[
'end_time'
]
>
TIMESTAMP
){
$temp
=
array
();
$temp
=
array
();
...
@@ -167,7 +167,7 @@ class AdvServiceModel extends \Business\AbstractModel{
...
@@ -167,7 +167,7 @@ class AdvServiceModel extends \Business\AbstractModel{
$advs
[]
=
$temp
;
$advs
[]
=
$temp
;
}
}
}
}
}
else
{
}
/*
else{
$storeAdvPositionDao = \DAO\Adv\StoreAdvPositionModel::getInstance();
$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));
$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']){
if($storeAdvPosition&&$storeAdvPosition['default_content']){
...
@@ -176,7 +176,7 @@ class AdvServiceModel extends \Business\AbstractModel{
...
@@ -176,7 +176,7 @@ class AdvServiceModel extends \Business\AbstractModel{
}else{
}else{
$advs = array();
$advs = array();
}
}
}
}
*/
return
$advs
;
return
$advs
;
}
}
...
...
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