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
bce30988
Commit
bce30988
authored
Jun 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人详情
parent
fc3b8709
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
34 deletions
+114
-34
Broker.php
application/api/controller/Broker.php
+18
-9
AAgents.php
application/model/AAgents.php
+57
-0
Evaluate.php
application/model/Evaluate.php
+37
-25
OBargainModel.php
application/model/OBargainModel.php
+2
-0
No files found.
application/api/controller/Broker.php
View file @
bce30988
...
@@ -7,6 +7,7 @@ use app\model\AAgents;
...
@@ -7,6 +7,7 @@ use app\model\AAgents;
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\OBargainModel
;
use
app\model\Remarks
;
use
app\model\Remarks
;
/**
/**
...
@@ -168,20 +169,26 @@ class Broker extends Basic{
...
@@ -168,20 +169,26 @@ class Broker extends Basic{
if
(
$params
[
'agent_id'
])
{
if
(
$params
[
'agent_id'
])
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$bargain
=
new
OBargainModel
();
$evalutate
=
new
Evaluate
();
$evalutate
=
new
Evaluate
();
$remarks
=
new
Remarks
();
//
$remarks = new Remarks();
$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_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'
;
// $fields_journal = 'house_id,apply_id,created';
$where
[
'shopuser_id'
]
=
$params
[
'agent_id'
];
// $where['shopuser_id'] = $params['agent_id'];
$where
[
'transaction_status'
]
=
3
;
// $where['transaction_status'] = 3;
$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'];
switch
(
$params
[
'type'
])
{
switch
(
$params
[
'type'
])
{
case
0
:
case
0
:
//评价列表信息
//评价列表信息
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
$result
[
'evaluate'
]
=
$evalutate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
//成交记录
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_journal
,
$where
,
$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']);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
case
1
:
case
1
:
...
@@ -191,7 +198,9 @@ class Broker extends Basic{
...
@@ -191,7 +198,9 @@ class Broker extends Basic{
break
;
break
;
case
2
:
case
2
:
//成交记录
//成交记录
$result
[
'journalAccounts'
]
=
$remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields_journal
,
$where
,
$params
[
'agent_id'
]);
// $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'
]]);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
default
:
default
:
...
@@ -221,7 +230,7 @@ class Broker extends Basic{
...
@@ -221,7 +230,7 @@ class Broker extends Basic{
$data
[
'msg'
]
=
''
;
$data
[
'msg'
]
=
''
;
if
(
$this
->
params
[
'agent_id'
])
{
if
(
$this
->
params
[
'agent_id'
])
{
$agents
=
new
Agents
();
$agents
=
new
A
A
gents
();
$data
[
'data'
]
=
$agents
->
agentsDetail
(
$this
->
params
[
'agent_id'
]);
$data
[
'data'
]
=
$agents
->
agentsDetail
(
$this
->
params
[
'agent_id'
]);
}
else
{
}
else
{
$data
[
'status'
]
=
101
;
$data
[
'status'
]
=
101
;
...
...
application/model/AAgents.php
View file @
bce30988
...
@@ -835,4 +835,60 @@ class AAgents extends BaseModel
...
@@ -835,4 +835,60 @@ class AAgents extends BaseModel
->
where
(
$where
)
->
where
(
$where
)
->
find
();
->
find
();
}
}
/**
* 经纪人详情
* @param $id
* @return array|bool|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentsDetail
(
$id
)
{
if
(
$id
)
{
$result
=
$this
->
field
(
'id,name,create_time,img,store_id'
)
->
find
(
$id
);
$result
[
'head_portrait'
]
=
'user_header/'
.
$result
[
'img'
];
//头像
$evaluate_grade
=
Db
::
table
(
'u_evaluate'
)
->
field
(
'sum(evaluate_grade) as evaluate_grade, count(*) as evaluate_num'
)
->
where
(
'agents_id'
,
$id
)
->
where
(
'is_show'
,
0
)
->
find
();
$m_store
=
new
AStore
();
$result
[
'sub_shopname'
]
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$result
[
'store_id'
]]);
if
(
$evaluate_grade
[
'evaluate_grade'
])
{
$grade
=
floor
((
$evaluate_grade
[
'evaluate_grade'
]
/
2
)
/
$evaluate_grade
[
'evaluate_num'
]);
}
else
{
$grade
=
0
;
}
$result
[
'evaluate_grade'
]
=
$grade
;
//评分等级
$result
[
'evaluate_num'
]
=
$evaluate_grade
[
'evaluate_num'
];
//评论数量
$result
[
'watch_shop'
]
=
Db
::
table
(
'u_appoint_watch_shop'
)
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
$result
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$result
[
'head_portrait'
];
$bargain
=
new
OBargainModel
();
$result
[
'JournalAccounts'
]
=
$bargain
->
ifBargainNumByOrderId
([
'agent_id'
=>
$id
]);
//成交记录
$current_time
=
time
();
$user_time
=
strtotime
(
$result
[
'create_time'
]);
$year
=
date
(
'Y'
,
$current_time
)
-
date
(
'Y'
,
$user_time
);
//入职年限
if
(
$year
==
0
)
{
$result
[
'created'
]
=
$year
.
'个月以上'
;
}
else
{
$result
[
'created'
]
=
$year
.
'年以上'
;
}
$result
[
'label'
]
=
array
(
0
=>
'待定标签数据'
,
1
=>
'待定标签数据'
);
$data
=
$result
;
}
else
{
$data
=
false
;
}
return
$data
;
}
}
}
\ No newline at end of file
application/model/Evaluate.php
View file @
bce30988
...
@@ -11,14 +11,17 @@ class Evaluate extends Model
...
@@ -11,14 +11,17 @@ class Evaluate extends Model
/**
/**
* 获得评价列表
* 获得评价列表
*
*
* @param type $pageNo
* @param int $pageNo
* @param type $pageSize
* @param int $pageSize
* @param type $order_
* @param string $order_
* @param type $field
* @param $field
* @param type $params
* @param $params
* @param type $agent_id //获得经纪人的评价
* @param string $agent_id
* @return type
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @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
=
''
)
{
...
@@ -41,9 +44,10 @@ class Evaluate extends Model
...
@@ -41,9 +44,10 @@ class Evaluate extends Model
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
}
}
$data
=
array
()
;
$data
=
[]
;
$sign
=
new
EvaluateSign
();
$sign
=
new
EvaluateSign
();
$watch
=
new
AppointWatchShop
();
// $watch = new AppointWatchShop();
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
();
...
@@ -55,25 +59,33 @@ class Evaluate extends Model
...
@@ -55,25 +59,33 @@ class Evaluate extends Model
->
select
();
->
select
();
}
}
if
(
$v
->
source
==
10
)
{
// if ($v->source == 10) {
$applies_time
=
$watch
->
alias
(
'a'
)
// $applies_time = $watch->alias('a')
->
field
(
'b.receptiontime'
)
// ->field('b.receptiontime')
->
join
(
'applies b'
,
'b.id = a.applies_id'
,
'left'
)
// ->join('applies b','b.id = a.applies_id','left')
->
where
(
'a.applies_id'
,
$v
->
record_id
)
// ->where('a.applies_id',$v->record_id)
// ->find();
$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'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
find
();
->
find
();
}
else
{
//
} else {
$applies_time
=
Db
::
table
(
'Journalaccounts'
)
->
alias
(
'a'
)
//
$applies_time = Db::table('Journalaccounts')->alias('a')
->
field
(
'b.receptiontime'
)
//
->field('b.receptiontime')
->
join
(
'applies b'
,
'b.id = a.apply_id'
,
'left'
)
//
->join('applies b','b.id = a.apply_id','left')
->
where
(
'a.apply_id'
,
$v
->
record_id
)
//
->where('a.apply_id',$v->record_id)
->
find
();
//
->find();
}
//
}
$house_address
=
Db
::
table
(
'HouseInfos'
)
->
field
(
'address'
)
->
where
(
'id'
,
$v
[
'house_id'
])
->
find
();
//
$house_address = Db::table('HouseInfos')->field('address')->where('id',$v['house_id'])->find();
$data
[
$k
][
'houserAddress'
]
=
$house_address
[
'address'
]
?
$house_address
[
'address'
]
:
''
;
$data
[
$k
][
'houserAddress'
]
=
$applies_time
[
'internal_address'
]
?
$applies_time
[
'internal_address'
]
:
''
;
$data
[
$k
][
'receptiontime'
]
=
$applies_time
[
'receptiontime'
];
// $data[$k]['houserAddress'] = $house_address['address'] ? $house_address['address'] : '';
// $data[$k]['receptiontime'] = $applies_time['receptiontime'];
$data
[
$k
][
'receptiontime'
]
=
$applies_time
[
'create_time'
];
$data
[
$k
][
'created'
]
=
$v
[
'create_time'
]
?
$v
[
'create_time'
]
:
''
;
$data
[
$k
][
'created'
]
=
$v
[
'create_time'
]
?
$v
[
'create_time'
]
:
''
;
}
}
...
...
application/model/OBargainModel.php
View file @
bce30988
...
@@ -468,6 +468,8 @@ class OBargainModel extends Model
...
@@ -468,6 +468,8 @@ class OBargainModel extends Model
if
(
isset
(
$data
[
'id'
]))
{
if
(
isset
(
$data
[
'id'
]))
{
$m_fee
=
new
ORealIncome
();
$m_fee
=
new
ORealIncome
();
$data
[
'practical_fee'
]
=
$m_fee
->
getBargainTaxes
(
$data
[
'id'
]);
//获取实收佣金
$data
[
'practical_fee'
]
=
$m_fee
->
getBargainTaxes
(
$data
[
'id'
]);
//获取实收佣金
}
else
{
$data
=
[];
}
}
return
$data
;
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