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
b2d1df9e
Commit
b2d1df9e
authored
Feb 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人详情接口修改
parent
d10e36b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
100 deletions
+95
-100
Broker.php
application/api/controller/Broker.php
+12
-10
Agents.php
application/model/Agents.php
+11
-8
JournalAccounts.php
application/model/JournalAccounts.php
+0
-80
Remarks.php
application/model/Remarks.php
+72
-2
No files found.
application/api/controller/Broker.php
View file @
b2d1df9e
...
@@ -5,8 +5,8 @@ use app\api\extend\Basic;
...
@@ -5,8 +5,8 @@ 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\
JournalAccount
s
;
use
app\model\
Remark
s
;
use
think\Db
;
/**
/**
* Description of Agents
* Description of Agents
*
*
...
@@ -132,12 +132,14 @@ class Broker extends Basic{
...
@@ -132,12 +132,14 @@ class Broker extends Basic{
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
/**
/**
* 查询评论和成交记录
* 查询评论和成交记录
*
*
* @return type
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
commentAndDeal
()
{
public
function
commentAndDeal
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
...
@@ -150,16 +152,16 @@ class Broker extends Basic{
...
@@ -150,16 +152,16 @@ class Broker extends Basic{
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$evalutate
=
new
Evaluate
();
$evalutate
=
new
Evaluate
();
$
journal
=
new
JournalAccount
s
();
$
remarks
=
new
Remark
s
();
$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
=
'a.house_id,
j.singntime
'
;
$fields_journal
=
'a.house_id,
a.apply_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'
]
=
$
journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$
remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'a
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
case
1
:
case
1
:
...
@@ -169,7 +171,7 @@ class Broker extends Basic{
...
@@ -169,7 +171,7 @@ class Broker extends Basic{
break
;
break
;
case
2
:
case
2
:
//成交记录
//成交记录
$result
[
'journalAccounts'
]
=
$
journal
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'j
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$result
[
'journalAccounts'
]
=
$
remarks
->
getJournalHouseInfo
(
$pageNo
,
$pageSize
,
'a
.id desc'
,
$fields_journal
,
'j.transaction_status = 3'
,
$params
[
'agent_id'
]);
$data
[
'data'
]
=
$result
;
$data
[
'data'
]
=
$result
;
break
;
break
;
default
:
default
:
...
...
application/model/Agents.php
View file @
b2d1df9e
...
@@ -44,12 +44,15 @@ class Agents extends Model
...
@@ -44,12 +44,15 @@ class Agents extends Model
return
$data
;
return
$data
;
}
}
/**
/**
* 经纪人详情
* 经纪人详情
*
*
* @param type $id
* @param $id
* @return boolean
* @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
)
{
public
function
agentsDetail
(
$id
)
{
if
(
$id
)
{
if
(
$id
)
{
...
@@ -73,10 +76,10 @@ class Agents extends Model
...
@@ -73,10 +76,10 @@ class Agents extends Model
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
$result
[
'head_portrait'
]
=
ADMIN_URL_TL
.
$result
[
'head_portrait'
];
$result
[
'head_portrait'
]
=
ADMIN_URL_TL
.
$result
[
'head_portrait'
];
$
journal
=
new
JournalAccount
s
();
$
remarks
=
new
Remark
s
();
$fields
=
'
count(j.id) as num
'
;
$fields
=
'
a.id
'
;
$Journal_num
=
$
journal
->
getJournalHouseInfoId
(
$fields
,
$id
);
$Journal_num
=
$
remarks
->
getJournalHouseInfoId
(
$fields
,
$id
);
$result
[
'JournalAccounts'
]
=
isset
(
$Journal_num
[
'num'
])
?
$Journal_num
[
'num'
]
:
0
;
//成交记录
$result
[
'JournalAccounts'
]
=
count
(
$Journal_num
)
;
//成交记录
$current_time
=
time
();
$current_time
=
time
();
$user_time
=
strtotime
(
$result
[
'created'
]);
$user_time
=
strtotime
(
$result
[
'created'
]);
...
...
application/model/JournalAccounts.php
View file @
b2d1df9e
...
@@ -4,7 +4,6 @@ namespace app\model;
...
@@ -4,7 +4,6 @@ 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
{
{
// 设置当前模型对应的完整数据表名称
// 设置当前模型对应的完整数据表名称
...
@@ -31,60 +30,6 @@ class JournalAccounts extends Model
...
@@ -31,60 +30,6 @@ class JournalAccounts extends Model
->
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_
=
'j.id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
if
(
$agent_id
)
{
$result
=
$this
->
db
->
field
(
$field
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
group
(
'j.apply_id'
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
,
'left'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
group
(
'j.apply_id'
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
->
select
();
}
$fields_houinfo
=
'id,title,rent_type,price,room_area,room_area2,shangpu_tags,shangpu_type'
;
//查找商铺或街铺的名字和图片
foreach
(
$result
as
$key
=>
$value
)
{
$data
[
$key
]
=
Db
::
table
(
'houseinfos'
)
->
field
(
$fields_houinfo
)
->
where
(
'id'
,
$value
[
'house_id'
])
->
find
();
$data
[
$key
][
'singntime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$value
[
'singntime'
]));
$data
[
$key
][
'shangpu_tags'
]
=
explode
(
','
,
$data
[
$key
][
'shangpu_tags'
]);
$img
=
Db
::
table
(
'houseimgs'
)
->
field
(
'imagename'
)
->
where
(
'house_id'
,
$value
[
'house_id'
])
->
where
(
'imgtype'
,
1
)
->
find
();
if
(
$img
[
'imagename'
])
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/houseImg/'
.
$img
[
'imagename'
];
}
else
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/resource/image/pzz_.jpg'
;
}
}
return
$data
;
}
/**
/**
* @param int $pageNo
* @param int $pageNo
* @param int $pageSize
* @param int $pageSize
...
@@ -108,29 +53,4 @@ class JournalAccounts extends Model
...
@@ -108,29 +53,4 @@ class JournalAccounts extends Model
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
}
}
/**
* 查询当前经纪人的成交记录
*
* @param $fields
* @param $agent_id
* @return $result
*/
public
function
getJournalHouseInfoId
(
$fields
=
''
,
$agent_id
)
{
if
(
$agent_id
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
find
();
}
else
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'j'
)
->
join
(
'applies a'
,
'j.apply_id = a.id'
)
->
where
(
'a.agent_id'
,
$agent_id
)
->
where
(
'j.transaction_status = 3'
)
->
find
();
}
return
$result
;
}
}
}
application/model/Remarks.php
View file @
b2d1df9e
...
@@ -3,8 +3,78 @@
...
@@ -3,8 +3,78 @@
namespace
app\model
;
namespace
app\model
;
use
think\Model
;
use
think\Model
;
use
think\Db
;
class
Remarks
extends
Model
class
Remarks
extends
Model
{
{
//
/**
* 成交记录列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $agent_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getJournalHouseInfo
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
,
$params
,
$agent_id
=
''
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'applies b'
,
'a.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.shopuser_id'
,
$agent_id
)
->
group
(
'a.apply_id'
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
->
select
();
$fields_houinfo
=
'id,title,rent_type,price,room_area,room_area2,shangpu_tags,shangpu_type'
;
//查找商铺或街铺的名字和图片
foreach
(
$result
as
$key
=>
$value
)
{
$data
[
$key
]
=
Db
::
table
(
'houseinfos'
)
->
field
(
$fields_houinfo
)
->
where
(
'id'
,
$value
[
'house_id'
])
->
find
();
$singntime
=
Db
::
table
(
'journalaccounts'
)
->
field
(
'max(id),singntime'
)
->
where
([
'apply_id'
=>
$value
[
'apply_id'
]
])
->
find
();
$data
[
$key
][
'singntime'
]
=
$singntime
[
'singntime'
]
?
date
(
'Y-m-d'
,
strtotime
(
$singntime
[
'singntime'
]))
:
""
;
$data
[
$key
][
'shangpu_tags'
]
=
explode
(
','
,
$data
[
$key
][
'shangpu_tags'
]);
$img
=
Db
::
table
(
'houseimgs'
)
->
field
(
'imagename'
)
->
where
(
'house_id'
,
$value
[
'house_id'
])
->
where
(
'imgtype'
,
1
)
->
find
();
if
(
$img
[
'imagename'
])
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/houseImg/'
.
$img
[
'imagename'
];
}
else
{
$data
[
$key
][
'img'
]
=
ADMIN_URL_TL
.
'/resource/image/pzz_.jpg'
;
}
}
return
$data
;
}
/**
* 查询当前经纪人的成交记录
*
* @param string $fields
* @param $agent_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getJournalHouseInfoId
(
$fields
=
''
,
$agent_id
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'applies b'
,
'a.apply_id = a.id'
,
'LEFT'
)
->
where
(
'a.shopuser_id'
,
$agent_id
)
->
group
(
'a.apply_id'
)
->
select
();
return
$result
;
}
}
}
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