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
696fd788
Commit
696fd788
authored
Jul 03, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户列表搜索
parent
54afdd76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
1 deletion
+70
-1
Agent.php
application/index/controller/Agent.php
+33
-0
Member.php
application/index/controller/Member.php
+7
-1
Evaluate.php
application/model/Evaluate.php
+28
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Agent.php
View file @
696fd788
...
...
@@ -26,6 +26,7 @@ use app\model\AAgents;
use
app\model\ABindingDevice
;
use
app\model\Agents
;
use
app\model\AStore
;
use
app\model\Evaluate
;
use
app\model\Regions
;
use
think\Exception
;
use
think\Session
;
...
...
@@ -300,4 +301,35 @@ class Agent extends Basic
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
/**
* 经纪人列表计算-评价次数和分数
* 朱伟 2018年07月03日
*/
public
function
agentEvaluateNumAndFraction
()
{
$data
=
$this
->
request
->
param
();
$agents_id
=
$data
[
'agents_id'
];
if
(
!
isset
(
$agents_id
))
{
return
$this
->
response
(
"300"
,
"参数不全"
);
}
$params
[
'agents_id'
]
=
$agents_id
;
$field
=
'sum(evaluate_grade) as agent_evaluate_fraction'
;
$model
=
new
Evaluate
();
$agent_evaluate_num
=
$model
->
getAgentEvaluateNum
(
$params
);
$agent_evaluate_fraction_res
=
$model
->
getAgentEvaluateFraction
(
$field
,
$params
);
$agent_evaluate_fraction
=
round
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
]
/
2
/
$agent_evaluate_num
,
1
);
if
(
$agent_evaluate_num
&&
$agent_evaluate_fraction_res
)
{
$result
[
'agent_evaluate_num'
]
=
$agent_evaluate_num
;
$result
[
'agent_evaluate_fraction'
]
=
$agent_evaluate_fraction
;
return
$this
->
response
(
200
,
'成功'
,
$result
);
}
else
{
return
$this
->
response
(
100
,
'失败'
);
}
}
}
\ No newline at end of file
application/index/controller/Member.php
View file @
696fd788
...
...
@@ -60,7 +60,13 @@ class Member extends Basic{
//客户手机号
if
(
!
empty
(
$params
[
'phone'
]))
{
$where
[
0
]
=
[
'EXP'
,
'a.user_phone LIKE "%'
.
$this
->
params
[
'phone'
]
.
'%" or a.user_nick LIKE "%'
.
$this
->
params
[
'phone'
]
.
'%"'
];
//$where[0] = ['EXP','a.user_phone LIKE "%'.$this->params['phone'].'%" or a.user_nick LIKE "%'.$this->params['phone'].'%"'];
$where
[
'a.user_phone'
]
=
[
'LIKE'
,
'%'
.
$params
[
'phone'
]
.
'%'
];
}
if
(
!
empty
(
$params
[
'user_nick'
]))
{
//$where[0] = ['EXP','a.user_phone LIKE "%'.$this->params['phone'].'%" or a.user_nick LIKE "%'.$this->params['phone'].'%"'];
$where
[
'a.user_nick'
]
=
[
'LIKE'
,
'%'
.
$params
[
'user_nick'
]
.
'%'
];
}
//是否公客
...
...
application/model/Evaluate.php
View file @
696fd788
...
...
@@ -164,4 +164,32 @@ class Evaluate extends Model
return
$result
;
}
/**
* 经纪人列表计算-评价次数
* 朱伟 2018年07月03日
*/
public
function
getAgentEvaluateNum
(
$params
=
''
)
{
$result
=
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
/**
* 经纪人列表计算-分数
* 朱伟 2018年07月03日
*/
public
function
getAgentEvaluateFraction
(
$field
,
$params
=
''
)
{
$result
=
Db
::
table
(
'u_evaluate'
)
->
field
(
$field
)
->
alias
(
'a'
)
->
where
(
$params
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
}
application/route.php
View file @
696fd788
...
...
@@ -251,6 +251,8 @@ Route::group('index', [
'getNewsInfo'
=>
[
'index/news/getNewsInfo'
,
[
'method'
=>
'GET'
]
],
//商学院资讯详情
'getNewsLabel'
=>
[
'index/news/getNewsLabel'
,
[
'method'
=>
'GET'
]
],
//商学院资标签
'delNews'
=>
[
'index/news/delNews'
,
[
'method'
=>
'POST'
]
],
//删除商学院文章
'agentEvaluateNumAndFraction'
=>
[
'index/agent/agentEvaluateNumAndFraction'
,
[
'method'
=>
'POST|GET'
]
],
//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
]);
...
...
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