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
1a558d3e
Commit
1a558d3e
authored
Jun 28, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人主页客户看铺地址和头像修改
parent
5a55c32a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
19 deletions
+48
-19
Evaluate.php
application/model/Evaluate.php
+48
-19
No files found.
application/model/Evaluate.php
View file @
1a558d3e
<?php
<?php
namespace
app\model
;
namespace
app\model
;
use
think\Db
;
use
think\Db
;
use
think\Model
;
use
think\Model
;
...
@@ -23,14 +24,16 @@ class Evaluate extends Model
...
@@ -23,14 +24,16 @@ class Evaluate extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
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
)
->
alias
(
'a'
)
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'g_houses c'
,
'a.house_id = c.id'
,
'left'
)
->
join
(
'g_houses c'
,
'a.house_id = c.id'
,
'left'
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'a.is_show'
,
0
)
->
where
(
'a.is_show'
,
0
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
...
@@ -44,17 +47,23 @@ class Evaluate extends Model
...
@@ -44,17 +47,23 @@ class Evaluate extends Model
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
}
}
$data
=
[];
$data
=
$applies_time
=
[];
$sign
=
new
EvaluateSign
();
$sign
=
new
EvaluateSign
();
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
$v
->
evaluate_grade
=
floor
(
$v
->
evaluate_grade
/
2
);
$v
->
evaluate_grade
=
floor
(
$v
->
evaluate_grade
/
2
);
$data
[
$k
]
=
$v
->
getData
();
$data
[
$k
]
=
$v
->
getData
();
$data
[
$k
][
'user_pic'
]
=
CURRENT_URL
.
'/static/head_portrait/'
.
$data
[
$k
][
'user_pic'
];
if
(
empty
(
$data
[
$k
][
'user_pic'
]))
{
$data
[
$k
][
'user_pic'
]
=
$data
[
$k
][
'user_pic'
];
}
else
{
$data
[
$k
][
'user_pic'
]
=
CURRENT_URL
.
'/static/head_portrait/'
.
$data
[
$k
][
'user_pic'
];
}
if
(
$v
[
'evaluate_sign'
])
{
if
(
$v
[
'evaluate_sign'
])
{
$data
[
$k
][
'evaluate_sign'
]
=
$sign
->
field
(
'sign_name,point_obj'
)
$data
[
$k
][
'evaluate_sign'
]
=
$sign
->
field
(
'sign_name,point_obj'
)
->
where
(
'id'
,
'in'
,
$v
[
'evaluate_sign'
])
->
where
(
'id'
,
'in'
,
$v
[
'evaluate_sign'
])
->
where
(
'is_del'
,
0
)
->
where
(
'is_del'
,
0
)
->
select
();
->
select
();
}
}
...
@@ -68,13 +77,16 @@ class Evaluate extends Model
...
@@ -68,13 +77,16 @@ class Evaluate extends Model
->
value
(
'a.create_time'
);
->
value
(
'a.create_time'
);
}
}
if
(
!
empty
(
$v
[
'external_address'
]))
{
if
(
empty
(
$v
[
'external_address'
]))
{
$len
=
mb_strlen
(
$v
[
'internal_address'
]);
$v
[
'internal_address'
]
=
mb_substr
(
$v
[
'internal_address'
],
0
,
(
int
)
$len
/
2
)
.
'***'
;
}
else
{
$v
[
'internal_address'
]
=
$v
[
'external_address'
];
$v
[
'internal_address'
]
=
$v
[
'external_address'
];
}
}
$data
[
$k
][
'houserAddress'
]
=
$v
[
'internal_address'
];
$data
[
$k
][
'houserAddress'
]
=
$v
[
'internal_address'
];
$data
[
$k
][
'receptiontime'
]
=
$applies_time
;
$data
[
$k
][
'receptiontime'
]
=
$applies_time
;
$data
[
$k
][
'created'
]
=
$v
[
'create_time'
]
?
$v
[
'create_time'
]
:
''
;
$data
[
$k
][
'created'
]
=
$v
[
'create_time'
]
?
$v
[
'create_time'
]
:
''
;
}
}
return
$data
;
return
$data
;
...
@@ -91,8 +103,9 @@ class Evaluate extends Model
...
@@ -91,8 +103,9 @@ class Evaluate extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getIsEvaluate
(
$source
,
$recordId
,
$userId
){
public
function
getIsEvaluate
(
$source
,
$recordId
,
$userId
)
$params
[
"source"
]
=
$source
;
{
$params
[
"source"
]
=
$source
;
$params
[
"record_id"
]
=
$recordId
;
$params
[
"record_id"
]
=
$recordId
;
$params
[
"user_id"
]
=
$userId
;
$params
[
"user_id"
]
=
$userId
;
return
$this
->
field
(
"id"
)
return
$this
->
field
(
"id"
)
...
@@ -100,18 +113,27 @@ class Evaluate extends Model
...
@@ -100,18 +113,27 @@ class Evaluate extends Model
->
select
();
->
select
();
}
}
public
function
findEvaluationList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
=
''
)
{
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
findEvaluationList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
=
''
)
{
$result
=
$this
$result
=
$this
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
'a'
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'a_agents c'
,
'a.agents_id = c.id'
,
'left'
)
->
join
(
'a_agents c'
,
'a.agents_id = c.id'
,
'left'
)
->
join
(
'o_march_in d'
,
'a.record_id=d.id and a.source=10'
,
'left'
)
->
join
(
'o_march_in d'
,
'a.record_id=d.id and a.source=10'
,
'left'
)
->
join
(
'o_bargain e'
,
'a.record_id=e.id and a.source =20'
,
'left'
)
->
join
(
'o_bargain e'
,
'a.record_id=e.id and a.source =20'
,
'left'
)
->
where
(
'is_show'
,
0
)
->
where
(
'is_show'
,
0
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -121,7 +143,14 @@ class Evaluate extends Model
...
@@ -121,7 +143,14 @@ class Evaluate extends Model
return
$result
;
return
$result
;
}
}
public
function
findEvaluationListCount
(
$field
,
$params
=
''
)
{
/**
* @param $field
* @param string $params
* @return int|string
*/
public
function
findEvaluationListCount
(
$field
,
$params
=
''
)
{
$result
=
$this
$result
=
$this
->
field
(
$field
)
->
field
(
$field
)
...
...
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