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
2ec20608
Commit
2ec20608
authored
Sep 17, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
确认分佣-评价列表
parent
3c5d0252
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
23 deletions
+51
-23
Broker.php
application/index/controller/Broker.php
+1
-1
Evaluation.php
application/index/controller/Evaluation.php
+42
-1
Evaluate.php
application/model/Evaluate.php
+7
-21
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Broker.php
View file @
2ec20608
...
@@ -701,7 +701,7 @@ class Broker extends Basic
...
@@ -701,7 +701,7 @@ class Broker extends Basic
$params
[
'agents_id'
]
=
$v
;
$params
[
'agents_id'
]
=
$v
;
//dump($v);
//dump($v);
$field
=
'sum(evaluate_grade) as agent_evaluate_fraction'
;
$field
=
'sum(evaluate_grade) as agent_evaluate_fraction'
;
$agent_evaluate_num
=
$model
->
get
AgentEvaluateNum
(
$params
);
$agent_evaluate_num
=
$model
->
get
Total
(
$params
);
$agent_evaluate_fraction_res
=
$model
->
getAgentEvaluateFraction
(
$field
,
$params
);
$agent_evaluate_fraction_res
=
$model
->
getAgentEvaluateFraction
(
$field
,
$params
);
$agent_evaluate_fraction
=
0
;
$agent_evaluate_fraction
=
0
;
if
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
])
{
if
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
])
{
...
...
application/index/controller/Evaluation.php
View file @
2ec20608
...
@@ -8,7 +8,7 @@ namespace app\index\controller;
...
@@ -8,7 +8,7 @@ namespace app\index\controller;
*/
*/
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\Evaluate
;
use
app\model\Evaluate
;
use
think\Request
;
use
app\model\OBargainModel
;
class
Evaluation
extends
Basic
class
Evaluation
extends
Basic
{
{
...
@@ -94,4 +94,44 @@ class Evaluation extends Basic
...
@@ -94,4 +94,44 @@ class Evaluation extends Basic
return
$this
->
response
(
200
,
'success'
,
$data
);
return
$this
->
response
(
200
,
'success'
,
$data
);
}
}
/**
* 确认分佣-评价列表
*
* @return \think\Response
*/
public
function
getEvaluate
()
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'参数错误'
);
}
$bargain_id
=
$this
->
params
[
'bargain_id'
];
$m_bargain
=
new
OBargainModel
();
$bargain_where
[
'id'
]
=
$bargain_id
;
$bargain_where
[
'father_id'
]
=
0
;
$order_id
=
$m_bargain
->
getFieldValue
(
'order_id'
,
$bargain_where
);
if
(
empty
(
$order_id
))
{
return
$this
->
response
(
101
,
'没有该记录'
);
}
$evaluate_where
[
'source'
]
=
20
;
$evaluate_where
[
'record_id'
]
=
$bargain_id
;
$field
=
'evaluate_grade,evaluate_grade_attitude,evaluate_grade_clothing,evaluate_content,create_time,user_id'
;
$evaluate_data
=
$this
->
evaluateModel
->
getAgentEvaluateFraction
(
$field
,
$evaluate_where
);
$list
=
[];
foreach
(
$evaluate_data
as
$k
=>
$v
)
{
$evaluate_grade
=
$v
[
'evaluate_grade'
]
/
2
;
$evaluate_grade_attitude
=
$v
[
'evaluate_grade_attitude'
]
/
2
;
$evaluate_grade_clothing
=
$v
[
'evaluate_grade_clothing'
]
/
2
;
$list
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
$list
[
$k
][
'user_id'
]
=
$v
[
'user_id'
];
$list
[
$k
][
'evaluate_content'
]
=
$v
[
'evaluate_content'
];
$list
[
$k
][
'order_id'
]
=
$order_id
;
$list
[
$k
][
'grade_string'
]
=
'专业'
.
$evaluate_grade
.
'/态度'
.
$evaluate_grade_attitude
.
'/着装'
.
$evaluate_grade_clothing
;
}
return
$this
->
response
(
200
,
''
,
$list
);
}
}
}
\ No newline at end of file
application/model/Evaluate.php
View file @
2ec20608
...
@@ -5,7 +5,7 @@ namespace app\model;
...
@@ -5,7 +5,7 @@ namespace app\model;
use
think\Db
;
use
think\Db
;
use
think\Model
;
use
think\Model
;
class
Evaluate
extends
Model
class
Evaluate
extends
Base
Model
{
{
// 设置当前模型对应的完整数据表名称
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_evaluate'
;
protected
$table
=
'u_evaluate'
;
...
@@ -167,30 +167,16 @@ class Evaluate extends Model
...
@@ -167,30 +167,16 @@ class Evaluate extends Model
}
}
/**
/**
* 经纪人列表计算-评价次数
*
*/
* @param $field
public
function
getAgentEvaluateNum
(
$params
=
''
)
* @param string $params
{
* @return false|\PDOStatement|string|\think\Collection
$result
=
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
/**
* 经纪人列表计算-分数
* 朱伟 2018年07月03日
*/
*/
public
function
getAgentEvaluateFraction
(
$field
,
$params
=
''
)
public
function
getAgentEvaluateFraction
(
$field
,
$params
=
''
)
{
{
$result
=
Db
::
table
(
'u_evaluate'
)
return
$this
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
'a'
)
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
//dump($this->getLastSql());
return
$result
;
}
}
/**
/**
...
...
application/route.php
View file @
2ec20608
...
@@ -337,6 +337,7 @@ Route::group('index', [
...
@@ -337,6 +337,7 @@ Route::group('index', [
'getActivityCoupon'
=>
[
'index/Finance/getActivityCoupon'
,
[
'method'
=>
'GET'
]],
//收款各种详情
'getActivityCoupon'
=>
[
'index/Finance/getActivityCoupon'
,
[
'method'
=>
'GET'
]],
//收款各种详情
'evaluationList'
=>
[
'index/Evaluation/evaluationList'
,
[
'method'
=>
'POST|GET'
]],
//评价列表 2018-06-13
'evaluationList'
=>
[
'index/Evaluation/evaluationList'
,
[
'method'
=>
'POST|GET'
]],
//评价列表 2018-06-13
'getEvaluate'
=>
[
'index/Evaluation/getEvaluate'
,
[
'method'
=>
'GET'
]],
//确认分佣-评价列表
'marchInList'
=>
[
'index/MarchIn/marchInList'
,
[
'method'
=>
'POST|GET'
]],
//进场记录列表2018-06-13
'marchInList'
=>
[
'index/MarchIn/marchInList'
,
[
'method'
=>
'POST|GET'
]],
//进场记录列表2018-06-13
'superviseList'
=>
[
'index/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]],
//监督执行列表2018-06-14
'superviseList'
=>
[
'index/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]],
//监督执行列表2018-06-14
'business_school'
=>
[
'index/news/index'
,
[
'method'
=>
'GET'
]],
//商学院资讯列表
'business_school'
=>
[
'index/news/index'
,
[
'method'
=>
'GET'
]],
//商学院资讯列表
...
...
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