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
e78e9554
Commit
e78e9554
authored
May 08, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a44b7af4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
+35
-8
Square.php
application/api_broker/controller/Square.php
+6
-3
SquareService.php
application/api_broker/service/SquareService.php
+27
-3
SquareSortService.php
application/api_broker/service/SquareSortService.php
+2
-2
No files found.
application/api_broker/controller/Square.php
View file @
e78e9554
...
@@ -63,6 +63,9 @@ class Square extends Basic
...
@@ -63,6 +63,9 @@ class Square extends Basic
}
}
}
}
/**
* @return \think\Response
*/
public
function
getSquareSortList
()
public
function
getSquareSortList
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
...
@@ -136,13 +139,13 @@ class Square extends Basic
...
@@ -136,13 +139,13 @@ class Square extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*
$params = array(
/*
$params = array(
"level" => 1,//不传是主评论 1是主评论第一级回复 2是第一级回复的回复
"level" => 1,//不传是主评论 1是主评论第一级回复 2是第一级回复的回复
"comment_id" => 1, //主评论ID
"comment_id" => 1, //主评论ID
"agent_id_b" => 1, //被回复人的id
"agent_id_b" => 1, //被回复人的id
"square_id" => 1, // 开盘id
"square_id" => 5, // 开盘id
"comment" => "123123", // 开盘id
"author_id" => 1, // 主要做推送
"author_id" => 1, // 主要做推送
"square_site_id" => 10001,
);*/
);*/
$square_id
=
$params
[
'square_id'
];
$square_id
=
$params
[
'square_id'
];
$comment
=
$params
[
'comment'
];
$comment
=
$params
[
'comment'
];
...
...
application/api_broker/service/SquareService.php
View file @
e78e9554
...
@@ -135,12 +135,36 @@ class SquareService
...
@@ -135,12 +135,36 @@ class SquareService
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
}
}
/**
* 热帖
* @param $list
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getSquareSortList
(
$list
)
public
function
getSquareSortList
(
$list
)
{
{
dump
(
$list
);
$ids
=
""
;
foreach
(
$list
as
$key
=>
$item
)
{
$ids
.=
$key
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
$field
=
'id,title,agent_id,district_lable_id,cover_img,create_time'
;
$get_params
[
'status'
]
=
0
;
$get_params
[
'id'
]
=
array
(
"in"
,
$ids
);
$res
=
$this
->
m_square
->
getSquare
(
$field
,
$get_params
);
foreach
(
$res
as
$key
=>
$val
)
{
$agent
=
$this
->
redis
->
getRedisCache
(
2
,
$val
[
'agent_id'
]);
$res
[
$key
][
'name'
]
=
$agent
[
'name'
];
$res
[
$key
][
'image_path'
]
=
AGENTHEADERIMGURL
.
$agent
[
'img'
];
//部门标签
$res
[
$key
][
'district_lable_name'
]
=
$this
->
getDistrictLableName
(
$val
[
'district_lable_id'
]);
// $square_data = $this->m_square->getSquare('id,is_cream',['id'=>$v]);
$res
[
$key
][
'cover_img_path'
]
=
$val
[
'cover_img'
]
?
$this
->
internet_path
.
$val
[
'cover_img'
]
:
''
;
// return $result;
}
return
$res
;
}
}
/**
/**
...
...
application/api_broker/service/SquareSortService.php
View file @
e78e9554
...
@@ -137,7 +137,7 @@ class SquareSortService
...
@@ -137,7 +137,7 @@ class SquareSortService
if
(
$total
<=
$page_size
)
{
if
(
$total
<=
$page_size
)
{
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
0
,
-
1
,
true
);
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
0
,
-
1
,
true
);
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
0
,
-
1
,
true
);
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
0
,
-
1
,
true
);
$result
=
array_merge
(
$cream_list
,
$list
)
;
$result
=
$cream_list
+
$list
;
}
elseif
(
$index_min
<=
$cream_num
&&
$index_max
<=
$cream_num
)
{
}
elseif
(
$index_min
<=
$cream_num
&&
$index_max
<=
$cream_num
)
{
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
$index_min
,
$page_size
,
true
);
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
$index_min
,
$page_size
,
true
);
$result
=
$cream_list
;
$result
=
$cream_list
;
...
@@ -145,7 +145,7 @@ class SquareSortService
...
@@ -145,7 +145,7 @@ class SquareSortService
$residue
=
$index_max
-
$cream_num
;
$residue
=
$index_max
-
$cream_num
;
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
$index_min
,
-
1
,
true
);
$cream_list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY_CREAM
.
$site_id
,
$index_min
,
-
1
,
true
);
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
0
,
$residue
,
true
);
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
0
,
$residue
,
true
);
$result
=
array_merge
(
$cream_list
,
$list
)
;
$result
=
$cream_list
+
$list
;
}
elseif
(
$index_min
>
$cream_num
)
{
}
elseif
(
$index_min
>
$cream_num
)
{
$index_
=
$index_min
-
$cream_num
;
$index_
=
$index_min
-
$cream_num
;
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
$index_
,
$page_size
,
true
);
$list
=
$this
->
redis
->
zRange
(
self
::
SORT_KEY
.
$site_id
,
$index_
,
$page_size
,
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