Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
08ebc110
Commit
08ebc110
authored
May 15, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
41ea3703
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
LookShopService.php
application/api_broker/service/LookShopService.php
+8
-7
No files found.
application/api_broker/service/LookShopService.php
View file @
08ebc110
...
...
@@ -26,6 +26,7 @@ class LookShopService
private
$systemConfigModel
;
const
LOOK_SHOP
=
"look_shop_"
;
//存入已看的楼盘id
const
LOOK_TOTAL
=
"look_total_"
;
//记录每个经纪人的看铺总数
const
LOOK_UP_NUM
=
"look_up_num_"
;
//记录每个经纪人的看铺升级次数
public
function
__construct
()
{
...
...
@@ -149,10 +150,10 @@ class LookShopService
if
(
!
$this
->
redis
->
hExists
(
$this
->
nowTime
,
$agent_id
))
{
//设置每个经纪人的看铺总数
$this
->
redis
->
hSet
(
$this
->
nowTime
,
$agent_id
,
0
);
//开始计数
$this
->
redis
->
hSet
(
self
::
LOOK_
TOTAL
.
$this
->
nowTime
,
$agent_id
,
$lookNum
);
//总
数
$this
->
redis
->
hSet
(
self
::
LOOK_
UP_NUM
.
$this
->
nowTime
,
$agent_id
,
1
);
//初始次
数
}
$agentLookNum
=
(
int
)
$this
->
redis
->
hGet
(
$this
->
nowTime
,
$agent_id
);
$totalNum
=
(
int
)
$this
->
redis
->
hGet
(
self
::
LOOK_TOTAL
.
$this
->
nowTime
,
$agent_id
);
$totalNum
=
$lookNum
*
(
int
)
$this
->
redis
->
hGet
(
self
::
LOOK_UP_NUM
.
$this
->
nowTime
,
$agent_id
);
Log
::
record
(
'info ----look agentLookNum-------'
.
$agentLookNum
,
"info"
);
Log
::
record
(
'info ----look totalNum-------'
.
$totalNum
,
"info"
);
if
(
$agentLookNum
>=
$totalNum
)
{
//如果数量为大于等于总数 证明看铺达到上限
...
...
@@ -176,7 +177,7 @@ class LookShopService
}
/**
* 升级经纪人看铺
数量
* 升级经纪人看铺
次数
* @param int $agent_id
* @return bool
*/
...
...
@@ -185,10 +186,9 @@ class LookShopService
if
(
!
$this
->
redis
){
return
false
;
}
$agentNum
=
$this
->
redis
->
hGet
(
self
::
LOOK_TOTAL
.
$this
->
nowTime
,
$agent_id
);
$lookNum
=
$this
->
redis
->
get
(
"lookNum"
);
$upLookNum
=
(
int
)
$lookNum
+
(
int
)
$agentNum
;
$this
->
redis
->
hSet
(
self
::
LOOK_TOTAL
.
$this
->
nowTime
,
$agent_id
,
$upLookNum
);
$agentUpNum
=
$this
->
redis
->
hGet
(
self
::
LOOK_UP_NUM
.
$this
->
nowTime
,
$agent_id
);
$upLookNum
=
(
int
)
$agentUpNum
+
1
;
$this
->
redis
->
hSet
(
self
::
LOOK_UP_NUM
.
$this
->
nowTime
,
$agent_id
,
$upLookNum
);
return
true
;
}
}
\ No newline at end of file
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