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
bd35380f
Commit
bd35380f
authored
May 08, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心升级看铺数
parent
3bc55dff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
LookShopService.php
application/api_broker/service/LookShopService.php
+12
-2
No files found.
application/api_broker/service/LookShopService.php
View file @
bd35380f
...
...
@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\GHousesToAgents
;
use
app\model\SystemConfig
;
use
think\Log
;
/**
...
...
@@ -20,6 +21,7 @@ class LookShopService
private
$nowTime
;
private
$gHousesToAgentsModel
;
private
$agentsModel
;
private
$systemConfigModel
;
const
LOOK_SHOP
=
"look_shop_"
;
//存入已看的楼盘id
const
LOOK_TOTAL
=
"look_total_"
;
//记录每个经纪人的看铺总数
...
...
@@ -30,6 +32,7 @@ class LookShopService
$this
->
nowTime
=
date
(
"Y-m-d"
,
time
());
$this
->
gHousesToAgentsModel
=
new
GHousesToAgents
();
$this
->
agentsModel
=
new
AAgents
();
$this
->
systemConfigModel
=
new
SystemConfig
();
}
...
...
@@ -107,13 +110,20 @@ class LookShopService
* 判断是否可以继续看铺,返回剩余数量
* @param int $agent_id
* @return int
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
isLookShop
(
int
$agent_id
)
:
int
{
$lookNum
=
0
;
$lookNum
=
50
;
//默认50看铺数量
if
(
!
$this
->
redis
->
get
(
"lookNum"
))
{
$lookNum
=
5
;
//数据库查询
//数据库查询
$data
=
$this
->
systemConfigModel
->
getSetting
([
"config_type"
=>
40
],
"rule"
);
if
(
$data
&&
$data
[
"agent_shop_num"
]
>
0
)
{
$lookNum
=
$data
[
"agent_shop_num"
];
}
$this
->
redis
->
set
(
"lookNum"
,
$lookNum
);
}
else
{
$lookNum
=
$this
->
redis
->
get
(
"lookNum"
);
...
...
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