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
48c7be1d
Commit
48c7be1d
authored
Jan 11, 2019
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合销售缓存修改相关
parent
bef21b86
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
PBundling.php
application/models/DAO/PBundling.php
+16
-6
No files found.
application/models/DAO/PBundling.php
View file @
48c7be1d
...
...
@@ -192,7 +192,6 @@ class PBundlingModel extends \DAO\AbstractModel {
return
false
;
}
$pBundling
=
$result
[
'result'
];
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$pBundling
),
'/data/log/apptest'
);
$key
=
$result
[
'key'
];
if
(
$op
==
\Our\ApiConst
::
minus
){
$pBundling
[
'bl_storage'
]
=
$pBundling
[
'bl_storage'
]
-
$blStorage
;
...
...
@@ -205,9 +204,7 @@ class PBundlingModel extends \DAO\AbstractModel {
$pBundling
[
'bl_storage'
]
=
$pBundling
[
'bl_storage'
]
+
$blStorage
;
$pBundling
[
'bl_origin_storage'
]
=
$pBundling
[
'bl_origin_storage'
]
+
$blStorage
;
}
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$pBundling
),
'/data/log/apptest'
);
\Lock\RedisLock
::
getInstance
()
->
releaseLock
(
\Our\NameConst
::
pBundlingStorageRedisPrefix
.
$blId
);
\Our\Log
::
getInstance
()
->
write
(
$key
,
'/data/log/apptest'
);
return
$pBundlingRedisDao
->
setNoPrefix
(
$key
,
serialize
(
$pBundling
),
\Our\ApiConst
::
oneDaySecond
);
}
...
...
@@ -253,13 +250,26 @@ class PBundlingModel extends \DAO\AbstractModel {
public
function
deletePBundlingByBlId
(
$blId
){
$pBundlingDao
=
\Redis\Db4\PBundlingRedisModel
::
getInstance
();
$pBundlingDao
->
tableDelAll
(
$pBundlingDao
->
tableKeys
(
'gid_'
.
$blId
));
$isLock
=
\Lock\RedisLock
::
getInstance
()
->
getLock
(
\Our\NameConst
::
pBundlingStorageRedisPrefix
.
$blId
);
if
(
!
$isLock
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
serverBusy
);
}
$pBundlingRedisDao
=
\Redis\Db4\PBundlingRedisModel
::
getInstance
();
$pBundlingRedisDao
->
tableDelAll
(
$pBundlingRedisDao
->
tableKeys
(
'gid_'
.
$blId
));
\Business\Goods\GroupSaleServiceModel
::
getInstance
()
->
getPBundlingListByBlIds
(
array
(
$blId
));
\Lock\RedisLock
::
getInstance
()
->
releaseLock
(
\Our\NameConst
::
pBundlingStorageRedisPrefix
.
$blId
);
return
true
;
}
public
function
deletePBundlingByGoodsCommonId
(
$goodsCommonId
){
$pBundlingDao
=
\Redis\Db4\PBundlingRedisModel
::
getInstance
();
return
$pBundlingDao
->
tableDelAll
(
$pBundlingDao
->
tableKeys
(
'*'
.
\Our\NameConst
::
blGoods
.
$goodsCommonId
));
$blIdsStrs
=
$pBundlingDao
->
tableKeys
(
'*'
.
\Our\NameConst
::
blGoods
.
$goodsCommonId
);
foreach
(
$blIdsStrs
as
$blIdStr
){
$newstr
=
substr
(
$blIdStr
,
strpos
(
$blIdStr
,
'gid_'
)
+
4
);
$blId
=
substr
(
$newstr
,
0
,(
strlen
(
$newstr
)
-
strlen
(
substr
(
$newstr
,
strpos
(
$newstr
,
'_goodsCommon'
)))));
$this
->
deletePBundlingByBlId
(
$blId
);
}
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