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
c305d4e0
Commit
c305d4e0
authored
Dec 13, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人主页
parent
b80e006f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
7 deletions
+61
-7
Broker.php
application/api/controller/Broker.php
+3
-3
Agents.php
application/model/Agents.php
+28
-2
Evaluate.php
application/model/Evaluate.php
+4
-2
JournalAccounts.php
application/model/JournalAccounts.php
+26
-0
No files found.
application/api/controller/Broker.php
View file @
c305d4e0
...
@@ -128,19 +128,19 @@ class Broker extends Basic{
...
@@ -128,19 +128,19 @@ class Broker extends Basic{
$evalutate
=
new
Evaluate
();
$evalutate
=
new
Evaluate
();
$journal
=
new
JournalAccounts
();
$journal
=
new
JournalAccounts
();
$fields_evaluate
=
'evaluate_grade,evaluate_content,evaluate_sign'
;
$fields_evaluate
=
'
user_nick,user_pic,
evaluate_grade,evaluate_content,evaluate_sign'
;
switch
(
$params
[
'type'
])
{
switch
(
$params
[
'type'
])
{
case
0
:
case
0
:
//评价列表信息
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'
a.
id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
//成交记录
$result
[
'journalAccounts'
]
=
$journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j.id desc'
,
''
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j.id desc'
,
''
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
case
1
:
case
1
:
//评价列表信息
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'
a.
id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
case
2
:
case
2
:
...
...
application/model/Agents.php
View file @
c305d4e0
...
@@ -61,8 +61,34 @@ class Agents extends Model
...
@@ -61,8 +61,34 @@ class Agents extends Model
public
function
agentsDetail
(
$id
)
{
public
function
agentsDetail
(
$id
)
{
if
(
$id
)
{
if
(
$id
)
{
$result
=
$this
->
field
(
'id,realname,created,sub_shopname,head_portrait'
)
->
where
(
'id'
,
$id
)
->
find
();
$result
=
$this
->
field
(
'id,realname,created,sub_shopname,head_portrait'
)
->
where
(
'id'
,
$id
)
->
find
();
$result
[
'head_portrait'
]
=
'user_header/'
.
$result
[
'head_portrait'
];
$result
[
'head_portrait'
]
=
'user_header/'
.
$result
[
'head_portrait'
];
//头像
$result
[
'evaluate_grade'
]
=
Db
::
table
(
''
);
$evaluate_grade
=
Db
::
table
(
'u_evaluate'
)
->
field
(
'avg(evaluate_grade) as evaluate_grade, count(*) as num'
)
->
where
(
'agents_id'
,
$id
)
->
where
(
'is_show'
,
0
)
->
find
();
$result
[
'evaluate_grade'
]
=
sprintf
(
"%.1f"
,
substr
(
sprintf
(
"%.2f"
,
$evaluate_grade
[
'evaluate_grade'
]),
0
,
-
1
));
//评分等级
$result
[
'evaluate_num'
]
=
$evaluate_grade
[
'num'
];
//评论数量
$result
[
'watch_shop'
]
=
Db
::
table
(
'u_appoint_watch_shop'
)
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
$journal
=
new
JournalAccounts
();
$fields
=
'count(j.id) as num'
;
$result
[
'JournalAccounts'
]
=
$journal
->
getJournalHouseInfoId
(
$fields
,
$id
)[
'num'
];
//成交记录
$current_time
=
time
();
$user_time
=
strtotime
(
$result
[
'created'
]);
$year
=
date
(
'Y'
,
$current_time
)
-
date
(
'Y'
,
$user_time
);
//入职年限
if
(
$year
==
0
)
{
$result
[
'created'
]
=
$year
.
'个月以上'
;
}
else
{
$result
[
'created'
]
=
$year
.
'年以上'
;
}
$result
[
'label'
]
=
array
(
0
=>
'待定标签数据'
,
1
=>
'待定标签数据'
);
}
else
{
}
else
{
$data
=
false
;
$data
=
false
;
}
}
...
...
application/model/Evaluate.php
View file @
c305d4e0
...
@@ -23,7 +23,8 @@ class Evaluate extends Model
...
@@ -23,7 +23,8 @@ class Evaluate extends Model
public
function
getEvaluate
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
public
function
getEvaluate
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
if
(
$agent_id
)
{
if
(
$agent_id
)
{
$result
=
$this
->
field
(
$field
)
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'is_show'
,
0
)
->
where
(
'is_show'
,
0
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -32,7 +33,8 @@ class Evaluate extends Model
...
@@ -32,7 +33,8 @@ class Evaluate extends Model
->
select
();
->
select
();
}
else
{
}
else
{
$result
=
$this
->
field
(
$field
)
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
where
(
'is_show'
,
0
)
->
where
(
'is_show'
,
0
)
->
order
(
$order_
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
...
...
application/model/JournalAccounts.php
View file @
c305d4e0
...
@@ -98,4 +98,30 @@ class JournalAccounts extends Model
...
@@ -98,4 +98,30 @@ class JournalAccounts extends Model
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
}
}
/**
* 查询当前经纪人的成交记录
*
* @param type $param
* @return type
*/
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'
)
->
where
(
$param
)
->
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'
)
->
where
(
$param
)
->
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