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
b1bd2c34
Commit
b1bd2c34
authored
Jan 17, 2019
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下架店铺移除扫码关系
parent
31b1284a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
MemberService.php
application/models/Business/User/MemberService.php
+10
-1
FavoritesStore.php
application/models/DAO/FavoritesStore.php
+8
-2
No files found.
application/models/Business/User/MemberService.php
View file @
b1bd2c34
...
...
@@ -1125,7 +1125,16 @@ class MemberServiceModel extends \Business\AbstractModel
if
(
$keys
=
$favoritesRedis
->
tableKeys
(
'myFavoritesStore'
.
$favoritesRedis
::
DELIMITER
.
$memberId
.
'_'
))
{
$storeId
=
$favoritesRedis
->
tableCacheGet
(
$keys
[
0
]);
}
else
{
$favStore
=
$favoritesDao
->
getStoreAndFavoriteStore
(
'han_store.store_id'
,
array
(
'fav_from'
=>
\Our\ApiConst
::
scanFavor
,
'han_favorites_store.member_id'
=>
$memberId
,
'open_flag'
=>
1
,
'store_state'
=>
1
));
$storeIds
=
$favoritesDao
->
getStoreAndFavoriteStore
(
'han_store.store_id'
,
array
(
'fav_from'
=>
\Our\ApiConst
::
scanFavor
,
'han_favorites_store.member_id'
=>
$memberId
,
'open_flag|store_state'
=>
0
),
array
());
if
(
$storeIds
)
{
$storeIds
=
array_column
(
$storeIds
,
'store_id'
);
$return
=
$favoritesDao
->
update
(
array
(
'fav_type'
=>
0
,
'fav_from'
=>
0
),
'store_id in ('
.
implode
(
','
,
$storeIds
)
.
')'
,
true
,
$memberId
);
if
(
$return
)
{
$favoritesDao
->
updateStoreCollecitonsCache
(
$storeIds
,
$memberId
);
}
}
$favStore
=
$favoritesDao
->
getOne
(
'store_id'
,
array
(
'fav_from'
=>
\Our\ApiConst
::
scanFavor
,
'member_id'
=>
$memberId
));
// $favStore = $favoritesDao->getStoreAndFavoriteStore('han_store.store_id',array('fav_from'=>\Our\ApiConst::scanFavor,'han_favorites_store.member_id'=>$memberId,'open_flag'=>1,'store_state'=>1),array('fav_time'=>'desc','favid'=>'desc'),array(0,1));
if
(
$favStore
&&
$favStore
[
'store_id'
]){
$storeId
=
$favStore
[
'store_id'
];
}
else
{
...
...
application/models/DAO/FavoritesStore.php
View file @
b1bd2c34
...
...
@@ -58,14 +58,20 @@ class FavoritesStoreModel extends \DAO\AbstractModel {
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchOne
();
return
$result
;
}
public
function
getStoreAndFavoriteStore
(
$field
,
$where
,
$order
=
array
(
'fav_time'
=>
'desc'
,
'favid'
=>
'desc'
))
{
public
function
getStoreAndFavoriteStore
(
$field
,
$where
,
$order
=
array
(
'fav_time'
=>
'desc'
,
'favid'
=>
'desc'
)
,
$limit
=
null
)
{
$this
->
setDb
(
$this
->
dbName
);
if
(
$order
){
foreach
(
$order
as
$key
=>
$value
){
$this
->
db
->
order
(
$key
,
$value
);
}
}
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
join
(
'han_store'
,
'han_store.store_id = han_favorites_store.store_id'
,
'inner'
)
->
where
(
$where
)
->
fetchOne
();
if
(
$limit
)
{
$this
->
db
->
limit
(
$limit
[
0
],
$limit
[
1
]);
}
if
(
is_array
(
$where
)){
$where
=
$this
->
db
->
getSqlWhereByArray
(
$where
);
}
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
join
(
'han_store'
,
'han_store.store_id = han_favorites_store.store_id'
,
'inner'
)
->
where
(
$where
)
->
fetchAll
();
return
$result
;
}
public
function
insert
(
$param
){
...
...
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