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
2ae37aa4
Commit
2ae37aa4
authored
Nov 26, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store
parent
7d6fff5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
StoreService.php
application/models/Business/Store/StoreService.php
+16
-10
FavoritesStore.php
application/models/DAO/FavoritesStore.php
+0
-3
No files found.
application/models/Business/Store/StoreService.php
View file @
2ae37aa4
...
...
@@ -49,14 +49,11 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeMembers
[]
=
$storeMember
;
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
$one
=
$favoritesStoreDao
->
getOne
(
'store_id'
,
array
(
'store_id'
=>
$storeId
,
'member_id'
=>
$memberId
,
'fav_type'
=>
\Our\ApiConst
::
one
,
'fav_from'
=>
\Our\ApiConst
::
scanFavor
),
''
);
var_dump
(
$one
);
if
(
!
$one
)
{
$result
=
$favoritesStoreDao
->
insertAll
(
$storeMembers
);
// if($result) {
// $favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
// }
var_dump
(
334
);
$favoritesStoreDao
->
updateStoreCollecitonsCache
(
array
(
$storeId
),
$memberId
,
2
);
if
(
$result
)
{
$favoritesStoreDao
->
updateStoreCollecitonsCache
(
array
(
$storeId
),
$memberId
,
2
);
}
$favoritesDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\FavoritesStoreRedisModel
::
getInstance
(),
array
(
&
$favoritesDao
,
'getOne'
),
array
(),
array
(
$memberId
));
}
...
...
@@ -417,11 +414,20 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeMember
[
'fav_type'
]
=
\Our\ApiConst
::
one
;
$storeMembers
[]
=
$storeMember
;
$favoritesStoreDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
$result
=
$favoritesStoreDao
->
insertAll
(
$storeMembers
);
if
(
!
$result
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
saveScanStoreInfoFailed
);
$one
=
$favoritesStoreDao
->
getOne
(
'store_id'
,
array
(
'store_id'
=>
$storeId
,
'member_id'
=>
$memberId
,
'fav_type'
=>
\Our\ApiConst
::
one
,
'fav_from'
=>
\Our\ApiConst
::
scanFavor
),
''
);
if
(
!
$one
)
{
$result
=
$favoritesStoreDao
->
insertAll
(
$storeMembers
);
if
(
!
$result
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
saveScanStoreInfoFailed
);
}
$favoritesStoreDao
->
updateStoreCollecitonsCache
(
array
(
$storeId
),
$memberId
,
2
);
$favoritesDao
=
\DAO\FavoritesStoreModel
::
getInstance
();
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\FavoritesStoreRedisModel
::
getInstance
(),
array
(
&
$favoritesDao
,
'getOne'
),
array
(),
array
(
$memberId
));
}
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\FavoritesStoreRedisModel
::
getInstance
(),
array
(
&
$favoritesStoreDao
,
'getOne'
),
array
(),
array
(
$memberId
));
return
true
;
}
...
...
application/models/DAO/FavoritesStore.php
View file @
2ae37aa4
...
...
@@ -187,7 +187,6 @@ class FavoritesStoreModel extends \DAO\AbstractModel {
* @throws \Our\Exception
*/
public
function
updateStoreCollecitonsCache
(
$storeIds
,
$memberId
,
$type
=
1
)
{
var_dump
(
$storeIds
);
if
(
!
$storeIds
||
!
is_array
(
$storeIds
))
{
return
true
;
}
...
...
@@ -207,8 +206,6 @@ class FavoritesStoreModel extends \DAO\AbstractModel {
}
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db6\FavoritesStoreRedisModel
::
getInstance
(),
array
(
&
$this
,
'getFavoritesStores'
),
array
(),
array
(
$memberId
));
//更新个人中心首页数量
var_dump
(
$type
);
var_dump
(
count
(
$storeIds
));
\DAO\MemberModel
::
getInstance
()
->
_changeNum
(
\Our\NameConst
::
storeCollection
,
$memberId
,
$type
==
1
?
-
(
count
(
$storeIds
))
:
count
(
$storeIds
));
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