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
51305dd9
Commit
51305dd9
authored
Feb 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交记录去除重复的楼盘id
parent
9dcbe19f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
+21
-23
Broker.php
application/api/controller/Broker.php
+6
-4
Agents.php
application/model/Agents.php
+4
-2
Remarks.php
application/model/Remarks.php
+11
-17
No files found.
application/api/controller/Broker.php
View file @
51305dd9
...
...
@@ -16,7 +16,7 @@ use app\model\Remarks;
* Intro :
*/
class
Broker
extends
Basic
{
/**
* 获取当前商铺或街铺的经纪人
*
...
...
@@ -155,13 +155,15 @@ class Broker extends Basic{
$remarks
=
new
Remarks
();
$fields_evaluate
=
'house_id,user_id,user_nick,user_phone,user_pic,evaluate_grade,evaluate_content,evaluate_sign,a.create_time,record_id,a.source'
;
$fields_journal
=
'a.house_id,a.apply_id'
;
$fields_journal
=
'house_id,apply_id,created'
;
$where
[
'shopuser_id'
]
=
$params
[
'agent_id'
];
$where
[
'transaction_status'
]
=
3
;
switch
(
$params
[
'type'
])
{
case
0
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'
a.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'
id desc'
,
$fields_journal
,
$where
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
case
1
:
...
...
@@ -171,7 +173,7 @@ class Broker extends Basic{
break
;
case
2
:
//成交记录
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'
a.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'
id desc'
,
$fields_journal
,
$where
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
default
:
...
...
application/model/Agents.php
View file @
51305dd9
...
...
@@ -77,8 +77,10 @@ class Agents extends Model
$result
[
'head_portrait'
]
=
ADMIN_URL_TL
.
$result
[
'head_portrait'
];
$remarks
=
new
Remarks
();
$fields
=
'a.id'
;
$Journal_num
=
$remarks
->
getJournalHouseInfoId
(
$fields
,
$id
);
$fields
=
'id'
;
$where
[
'shopuser_id'
]
=
$id
;
$where
[
'transaction_status'
]
=
3
;
$Journal_num
=
$remarks
->
getJournalHouseInfoId
(
$fields
,
$where
);
$result
[
'JournalAccounts'
]
=
count
(
$Journal_num
);
//成交记录
$current_time
=
time
();
...
...
application/model/Remarks.php
View file @
51305dd9
...
...
@@ -21,12 +21,12 @@ class Remarks extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getJournalHouseInfo
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'
a.
id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
public
function
getJournalHouseInfo
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'applies b'
,
'a.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.shopuser_id'
,
$agent_id
)
->
group
(
'
a.apply
_id'
)
$result
=
$this
->
field
(
$field
)
->
where
(
'shopuser_id'
,
$agent_id
)
->
where
(
$params
)
->
group
(
'
house
_id'
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
...
...
@@ -38,11 +38,7 @@ class Remarks extends Model
$data
[
$key
]
=
Db
::
table
(
'houseinfos'
)
->
field
(
$fields_houinfo
)
->
where
(
'id'
,
$value
[
'house_id'
])
->
find
();
$singntime
=
Db
::
table
(
'journalaccounts'
)
->
field
(
'max(id),singntime'
)
->
where
([
'apply_id'
=>
$value
[
'apply_id'
]
])
->
find
();
$data
[
$key
][
'singntime'
]
=
$singntime
[
'singntime'
]
?
date
(
'Y-m-d'
,
strtotime
(
$singntime
[
'singntime'
]))
:
""
;
$data
[
$key
][
'singntime'
]
=
$value
[
'created'
]
?
date
(
'Y-m-d'
,
strtotime
(
$value
[
'created'
]))
:
""
;
$data
[
$key
][
'shangpu_tags'
]
=
explode
(
','
,
$data
[
$key
][
'shangpu_tags'
]);
$img
=
Db
::
table
(
'houseimgs'
)
->
field
(
'imagename'
)
...
...
@@ -53,7 +49,6 @@ class Remarks extends Model
}
else
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/resource/image/pzz_.jpg'
;
}
}
return
$data
;
...
...
@@ -63,17 +58,16 @@ class Remarks extends Model
* 查询当前经纪人的成交记录
*
* @param string $fields
* @param $
agent_id
* @param $
params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getJournalHouseInfoId
(
$fields
=
''
,
$agent_id
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'applies b'
,
'a.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.shopuser_id'
,
$agent_id
)
->
group
(
'a.apply_id'
)
public
function
getJournalHouseInfoId
(
$fields
=
''
,
$params
)
{
$result
=
$this
->
field
(
$fields
)
->
where
(
$params
)
->
group
(
'house_id'
)
->
select
();
return
$result
;
}
...
...
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