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
20cc58a1
Commit
20cc58a1
authored
Jun 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人主页
parent
bce30988
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
45 deletions
+53
-45
Broker.php
application/api/controller/Broker.php
+9
-16
Member.php
application/index/controller/Member.php
+1
-1
Evaluate.php
application/model/Evaluate.php
+15
-28
OBargainModel.php
application/model/OBargainModel.php
+28
-0
No files found.
application/api/controller/Broker.php
View file @
20cc58a1
...
...
@@ -169,38 +169,31 @@ class Broker extends Basic{
if
(
$params
[
'agent_id'
])
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$bargain
=
new
OBargainModel
();
$evalutate
=
new
Evaluate
();
// $remarks = new Remarks();
$evaluate
=
new
Evaluate
();
$fields_evaluate
=
'house_id,user_id,user_nick,user_phone,user_pic,evaluate_grade,evaluate_content,evaluate_sign,a.create_time,record_id,a.source'
;
// $fields_journal = 'house_id,apply_id,created';
// $where['shopuser_id'] = $params['agent_id'];
// $where['transaction_status'] = 3;
$fields_evaluate
=
'house_id,user_id,user_nick,user_phone,user_pic,evaluate_grade,evaluate_content,'
;
$fields_evaluate
.=
'evaluate_sign,a.create_time,record_id,a.source,a.house_id,c.internal_address'
;
$bargain_fields
=
'a.id,a.price,a.create_time as singntime,d.external_title as title,d.rent_type,d.shop_sign as shangpu_tags'
;
// $where['a.agent_id'] = $this->params['agent_id'];
$bargain_fields
=
'a.id,a.price,a.create_time as singntime,d.external_title as title,d.rent_type,d.shop_sign as shangpu_tags,shop_area_start as room_area'
;
switch
(
$params
[
'type'
])
{
case
0
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalu
t
ate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$result
[
'evaluate'
]
=
$evaluate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainInfo
(
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]]);
// $result['journalAccounts'] = $remarks->getJournalHouseInfo($pageNo, $pageSize, 'id desc', $fields_journal, $where, $params['agent_id']);
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]]);
$data
[
'data'
]
=
$result
;
break
;
case
1
:
//评价列表信息
$result
[
'evaluate'
]
=
$evalu
t
ate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$result
[
'evaluate'
]
=
$evaluate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
break
;
case
2
:
//成交记录
// $result['journalAccounts'] = $remarks->getJournalHouseInfo($pageNo, $pageSize, 'id desc', $fields_journal, $where, $params['agent_id']);
// $bargain = new OBargainModel();
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainInfo
(
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]]);
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]]);
$data
[
'data'
]
=
$result
;
break
;
default
:
...
...
application/index/controller/Member.php
View file @
20cc58a1
...
...
@@ -217,7 +217,7 @@ class Member extends Basic{
$insert_data
[
'user_pswd'
]
=
md5
(
md5
(
$params
[
'pwd'
])
.
'+123'
);
$insert_data
[
'status'
]
=
0
;
$insert_data
[
'create_time'
]
=
$date
;
$insert_data
[
'
update_time'
]
=
$date
;
$insert_data
[
'
source'
]
=
$date
;
$insert_data
[
'agent_id'
]
=
$params
[
'agent_id'
];
//客方
$this
->
user
->
save
(
$insert_data
);
if
(
$this
->
user
->
id
)
{
...
...
application/model/Evaluate.php
View file @
20cc58a1
...
...
@@ -28,13 +28,13 @@ class Evaluate extends Model
if
(
$agent_id
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'g_houses c'
,
'a.house_id = c.id'
,
'left'
)
->
where
(
'agents_id'
,
$agent_id
)
->
where
(
'is_show'
,
0
)
->
where
(
'
a.
is_show'
,
0
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
...
...
@@ -46,7 +46,6 @@ class Evaluate extends Model
}
$data
=
[];
$sign
=
new
EvaluateSign
();
// $watch = new AppointWatchShop();
foreach
(
$result
as
$k
=>
$v
)
{
$v
->
evaluate_grade
=
floor
(
$v
->
evaluate_grade
/
2
);
...
...
@@ -59,33 +58,18 @@ class Evaluate extends Model
->
select
();
}
// if ($v->source == 10) {
// $applies_time = $watch->alias('a')
// ->field('b.receptiontime')
// ->join('applies b','b.id = a.applies_id','left')
// ->where('a.applies_id',$v->record_id)
// ->find();
if
(
isset
(
$v
[
'house_id'
]))
{
$applies_time
=
Db
::
table
(
'o_bargain'
)
->
alias
(
'a'
)
->
field
(
'a.create_time,c.internal_address'
)
->
join
(
'o_order b'
,
'a.order_id = b.id'
,
'left'
)
->
join
(
'g_houses c'
,
'b.house_id = c.id'
,
'left'
)
->
join
(
'o_report c'
,
'a.report_id = c.id'
,
'left'
)
->
where
(
'b.house_id'
,
$v
[
'house_id'
])
->
where
(
'c.user_id'
,
$v
[
'user_id'
])
->
where
(
'a.agent_id'
,
$agent_id
)
->
find
();
// } else {
// $applies_time = Db::table('Journalaccounts')->alias('a')
// ->field('b.receptiontime')
// ->join('applies b','b.id = a.apply_id','left')
// ->where('a.apply_id',$v->record_id)
// ->find();
// }
// $house_address = Db::table('HouseInfos')->field('address')->where('id',$v['house_id'])->find();
->
value
(
'a.create_time'
);
}
$data
[
$k
][
'houserAddress'
]
=
$applies_time
[
'internal_address'
]
?
$applies_time
[
'internal_address'
]
:
''
;
// $data[$k]['houserAddress'] = $house_address['address'] ? $house_address['address'] : '';
// $data[$k]['receptiontime'] = $applies_time['receptiontime'];
$data
[
$k
][
'receptiontime'
]
=
$applies_time
[
'create_time'
];
$data
[
$k
][
'houserAddress'
]
=
isset
(
$v
[
'internal_address'
])
?
$v
[
'internal_address'
]
:
''
;
$data
[
$k
][
'receptiontime'
]
=
$applies_time
;
$data
[
$k
][
'created'
]
=
$v
[
'create_time'
]
?
$v
[
'create_time'
]
:
''
;
}
...
...
@@ -94,10 +78,14 @@ class Evaluate extends Model
/**
* 获取商铺是否评价
* @param int $source
*
* @param $source
* @param $recordId
* @param $userId
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getIsEvaluate
(
$source
,
$recordId
,
$userId
){
$params
[
"source"
]
=
$source
;
...
...
@@ -106,6 +94,5 @@ class Evaluate extends Model
return
$this
->
field
(
"id"
)
->
where
(
$params
)
->
select
();
}
}
application/model/OBargainModel.php
View file @
20cc58a1
...
...
@@ -475,6 +475,34 @@ class OBargainModel extends Model
return
$data
;
}
/**
* 获取成交报告详情
*
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainOrderList
(
$field
,
$params
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$v
[
'singntime'
]))
{
$data
[
$k
][
'singntime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'singntime'
]));
}
}
return
$data
;
}
/**
* @param $params
* @param $type
...
...
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