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
57912ec0
Commit
57912ec0
authored
Feb 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人详情接口修改
parent
dbaba6e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
40 deletions
+16
-40
Broker.php
application/api/controller/Broker.php
+12
-10
Agents.php
application/model/Agents.php
+4
-4
JournalAccounts.php
application/model/JournalAccounts.php
+0
-26
No files found.
application/api/controller/Broker.php
View file @
57912ec0
...
...
@@ -5,8 +5,8 @@ use app\api\extend\Basic;
use
app\model\Agents
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
use
app\model\
JournalAccount
s
;
use
think\Db
;
use
app\model\
Remark
s
;
/**
* Description of Agents
*
...
...
@@ -132,12 +132,14 @@ class Broker extends Basic{
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 查询评论和成交记录
*
* @return type
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
commentAndDeal
()
{
$params
=
$this
->
params
;
...
...
@@ -150,16 +152,16 @@ class Broker extends Basic{
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$evalutate
=
new
Evaluate
();
$
journal
=
new
JournalAccount
s
();
$
remarks
=
new
Remark
s
();
$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,
j.singntime
'
;
$fields_journal
=
'a.house_id,
a.apply_id
'
;
switch
(
$params
[
'type'
])
{
case
0
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
$result
[
'journalAccounts'
]
=
$
journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$
remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'a
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
case
1
:
...
...
@@ -169,7 +171,7 @@ class Broker extends Basic{
break
;
case
2
:
//成交记录
$result
[
'journalAccounts'
]
=
$
journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$
remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'a
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
default
:
...
...
application/model/Agents.php
View file @
57912ec0
...
...
@@ -77,10 +77,10 @@ class Agents extends Model
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
$result
[
'head_portrait'
]
=
ADMIN_URL_TL
.
$result
[
'head_portrait'
];
$
journal
=
new
JournalAccount
s
();
$fields
=
'
count(j.id) as num
'
;
$Journal_num
=
$
journal
->
getJournalHouseInfoId
(
$fields
,
$id
);
$result
[
'JournalAccounts'
]
=
isset
(
$Journal_num
[
'num'
])
?
$Journal_num
[
'num'
]
:
0
;
//成交记录
$
remarks
=
new
Remark
s
();
$fields
=
'
a.id
'
;
$Journal_num
=
$
remarks
->
getJournalHouseInfoId
(
$fields
,
$id
);
$result
[
'JournalAccounts'
]
=
count
(
$Journal_num
)
;
//成交记录
$current_time
=
time
();
$user_time
=
strtotime
(
$result
[
'created'
]);
...
...
application/model/JournalAccounts.php
View file @
57912ec0
...
...
@@ -4,7 +4,6 @@ namespace app\model;
use
think\Model
;
use
think\helper\Time
;
use
think\Db
;
class
JournalAccounts
extends
Model
{
// 设置当前模型对应的完整数据表名称
...
...
@@ -109,29 +108,4 @@ class JournalAccounts extends Model
->
page
(
$pageNo
)
->
select
();
}
/**
* 查询当前经纪人的成交记录
*
* @param $fields
* @param $agent_id
* @return $result
*/
public
function
getJournalHouseInfoId
(
$fields
=
''
,
$agent_id
)
{
if
(
$agent_id
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
find
();
}
else
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
find
();
}
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