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
acd096d1
Commit
acd096d1
authored
Dec 12, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评论列表和成交商铺列表
parent
67efed0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
6 deletions
+149
-6
Broker.php
application/api/controller/Broker.php
+55
-5
Evaluate.php
application/model/Evaluate.php
+46
-0
JournalAccounts.php
application/model/JournalAccounts.php
+48
-1
No files found.
application/api/controller/Broker.php
View file @
acd096d1
...
@@ -5,6 +5,7 @@ use app\api\extend\Basic;
...
@@ -5,6 +5,7 @@ use app\api\extend\Basic;
use
app\model\Agents
;
use
app\model\Agents
;
use
app\model\Evaluate
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
use
app\model\EvaluateSign
;
use
app\model\JournalAccounts
;
/**
/**
* Description of Agents
* Description of Agents
*
*
...
@@ -92,12 +93,10 @@ class Broker extends Basic{
...
@@ -92,12 +93,10 @@ class Broker extends Basic{
'agents_id'
=>
$params
[
'agents_id'
],
'agents_id'
=>
$params
[
'agents_id'
],
'source'
=>
$params
[
'source'
],
'source'
=>
$params
[
'source'
],
'record_id'
=>
$params
[
'record_id'
],
'record_id'
=>
$params
[
'record_id'
],
'evaluate_grade'
=>
'evaluate_grade'
=>
$params
[
'evaluate_grade'
],
isset
(
$params
[
'evaluate_grade'
])
?
$params
[
'evaluate_grade'
]
:
''
,
'evaluate_content'
=>
$params
[
'evaluate_content'
],
'evaluate_content'
=>
isset
(
$params
[
'evaluate_content'
])
?
$params
[
'evaluate_content'
]
:
''
,
'evaluate_sign'
=>
implode
(
','
,
$id_arr
),
'evaluate_sign'
=>
implode
(
','
,
$id_arr
),
'crate_time'
=>
$date
,
'cr
e
ate_time'
=>
$date
,
'update_time'
=>
$date
,
'update_time'
=>
$date
,
'is_show'
=>
0
,
'is_show'
=>
0
,
'house_id'
=>
$params
[
'house_id'
]
'house_id'
=>
$params
[
'house_id'
]
...
@@ -108,4 +107,55 @@ class Broker extends Basic{
...
@@ -108,4 +107,55 @@ class Broker extends Basic{
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
/**
* 查询评论和成交记录
*
* @return type
*/
public
function
commentAndDeal
()
{
$params
=
$this
->
params
;
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
if
(
$params
[
'agent_id'
])
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$evalutate
=
new
Evaluate
();
$journal
=
new
JournalAccounts
();
$fields_evaluate
=
'evaluate_grade,evaluate_content,evaluate_sign'
;
switch
(
$params
[
'type'
])
{
case
0
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
$result
[
'journalAccounts'
]
=
$journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j.id desc'
,
$fields
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
case
1
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
case
2
:
//成交记录
$result
[
'journalAccounts'
]
=
$journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
''
,
''
,
''
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
default
:
$data
[
'stauts'
]
=
101
;
$data
[
'msg'
]
=
'type is null'
;
break
;
}
}
else
{
$data
[
'msg'
]
=
'agent_id is null'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
}
application/model/Evaluate.php
View file @
acd096d1
...
@@ -8,4 +8,50 @@ class Evaluate extends Model
...
@@ -8,4 +8,50 @@ class Evaluate extends Model
{
{
// 设置当前模型对应的完整数据表名称
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_evaluate'
;
protected
$table
=
'u_evaluate'
;
/**
* 获得评价列表
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $params
* @param type $agent_id //获得经纪人的评价
* @return type
*/
public
function
getEvaluate
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
if
(
$agent_id
)
{
$result
=
$this
->
field
(
$field
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'is_show'
,
0
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$result
=
$this
->
field
(
$field
)
->
where
(
'is_show'
,
0
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
$sign
=
new
EvaluateSign
();
foreach
(
$result
as
$k
=>
$v
)
{
$data
[
$k
]
=
$v
->
getData
();
if
(
$v
[
'evaluate_sign'
])
{
$data
[
$k
][
'evaluate_sign'
]
=
$sign
->
field
(
'sign_name,point_obj'
)
->
where
(
'id'
,
'in'
,
$v
[
'evaluate_sign'
])
->
where
(
'is_del'
,
0
)
->
select
();
}
}
return
$data
;
}
}
}
application/model/JournalAccounts.php
View file @
acd096d1
...
@@ -4,7 +4,7 @@ namespace app\model;
...
@@ -4,7 +4,7 @@ namespace app\model;
use
think\Model
;
use
think\Model
;
use
think\helper\Time
;
use
think\helper\Time
;
use
think\Db
;
class
JournalAccounts
extends
Model
class
JournalAccounts
extends
Model
{
{
// 设置当前模型对应的完整数据表名称
// 设置当前模型对应的完整数据表名称
...
@@ -30,4 +30,51 @@ class JournalAccounts extends Model
...
@@ -30,4 +30,51 @@ class JournalAccounts extends Model
->
where
(
$where_
)
->
where
(
$where_
)
->
count
(
"id"
);
->
count
(
"id"
);
}
}
/**
* 成交记录列表
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $params
* @param type $agent_id
* @return type
*/
public
function
getJournalHouseInfo
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
if
(
$agent_id
)
{
$result
=
$this
->
field
(
'a.house_id'
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
group
(
'j.apply_id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$result
=
$this
->
field
(
'a.house_id'
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
group
(
'j.apply_id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
$fields_houinfo
=
'id,title,rent_type,price,room_area,room_area2,shangpu_type'
;
//查找商铺或街铺的名字和图片
foreach
(
$result
as
$key
=>
$value
)
{
$data
[
$key
]
=
Db
::
table
(
'houseinfos'
)
->
field
(
$fields_houinfo
)
->
where
(
'id'
,
$value
[
'house_id'
])
->
find
();
$img
=
Db
::
table
(
'houseimgs'
)
->
field
(
'imagename'
)
->
where
(
'house_id'
,
$value
[
'house_id'
])
->
where
(
'imgtype'
,
1
)
->
find
();
$data
[
$key
][
'img'
]
=
$img
[
'imagename'
];
}
return
$data
;
}
}
}
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