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
ddf1eb59
Commit
ddf1eb59
authored
Jun 06, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
42a3d28c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
63 deletions
+123
-63
OfficeReport.php
application/api_broker/controller/OfficeReport.php
+7
-55
OfficeReportService.php
application/api_broker/service/OfficeReportService.php
+76
-5
OfficeGRoom.php
application/model/OfficeGRoom.php
+21
-0
OfficeGRoomToAgent.php
application/model/OfficeGRoomToAgent.php
+10
-0
OfficeOrderModel.php
application/model/OfficeOrderModel.php
+7
-3
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/OfficeReport.php
View file @
ddf1eb59
...
@@ -210,6 +210,9 @@ class OfficeReport extends Basic
...
@@ -210,6 +210,9 @@ class OfficeReport extends Basic
/**
/**
* 权限判定
* 权限判定
* @return \think\Response
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
appAgentAuth
()
public
function
appAgentAuth
()
{
{
...
@@ -222,62 +225,11 @@ class OfficeReport extends Basic
...
@@ -222,62 +225,11 @@ class OfficeReport extends Basic
if
(
!
isset
(
$params
[
"agent_id"
]))
{
if
(
!
isset
(
$params
[
"agent_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
if
(
isset
(
$params
[
"house_id"
]))
{
$agent_id
=
$params
[
"agent_id"
];
$agent_id
=
$params
[
"agent_id"
];
$house_id
=
isset
(
$params
[
"house_id"
])
?
$params
[
"house_id"
]
:
0
;
$house_id
=
$params
[
"house_id"
];
//todo 判断是不是案场权限人
$agentToHouseModel
=
new
GHousesToAgents
();
$where_
[
"houses_id"
]
=
$house_id
;
$where_
[
"agents_id"
]
=
$agent_id
;
$where_
[
"type"
]
=
1
;
$where_
[
"is_del"
]
=
0
;
$isCase
=
$agentToHouseModel
->
getHouseToAgents
(
"id"
,
$where_
);
$result
[
"marchIn"
]
=
$result
[
"collectingBill"
]
=
$result
[
"refund"
]
=
$result
[
"bargain"
]
=
false
;
if
(
count
(
$isCase
)
>
0
)
{
$result
[
"marchIn"
]
=
true
;
$result
[
"collectingBill"
]
=
true
;
$result
[
"refund"
]
=
true
;
$result
[
"bargain"
]
=
true
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
$auth_arr
=
[
$result
=
$this
->
service_
->
appAgentAuth
(
$agent_id
,
$house_id
);
/*'broker/report',
return
$this
->
response
(
"200"
,
"request null"
,
$result
);
'broker/addFollowUp',*/
'broker/marchIn'
,
'broker/collectingBill'
,
'broker/refund'
,
'broker/bargain'
,
/* 'broker/statusBargain',*/
];
$param
[
"name"
]
=
array
(
"in"
,
$auth_arr
);
$agents
=
new
AAgents
();
$is_auth
=
$agents
->
agentsAuthIds
(
$params
[
"agent_id"
],
$param
);
if
(
count
(
$is_auth
)
>
0
)
{
foreach
(
$is_auth
as
$item
)
{
if
(
$item
[
'name'
]
==
"broker/marchIn"
)
{
$result
[
"marchIn"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/collectingBill"
)
{
$result
[
"collectingBill"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/refund"
)
{
$result
[
"refund"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/bargain"
)
{
$result
[
"bargain"
]
=
true
;
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
}
...
...
application/api_broker/service/OfficeReportService.php
View file @
ddf1eb59
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\api\untils\GeTuiUtils
;
use
app\api\untils\GeTuiUtils
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\OfficeGRoom
;
use
app\model\OfficeGRoom
;
use
app\model\OfficeGRoomToAgent
;
use
app\model\OfficeOrderModel
;
use
app\model\OfficeOrderModel
;
use
app\model\OfficeOReportModel
;
use
app\model\OfficeOReportModel
;
use
app\model\Users
;
use
app\model\Users
;
...
@@ -22,11 +24,17 @@ class OfficeReportService
...
@@ -22,11 +24,17 @@ class OfficeReportService
private
$reportModel
;
private
$reportModel
;
private
$orderModel
;
private
$orderModel
;
private
$roomModel
;
private
$roomAgentModel
;
private
$agentModel
;
function
__construct
()
function
__construct
()
{
{
$this
->
reportModel
=
new
OfficeOReportModel
();
$this
->
reportModel
=
new
OfficeOReportModel
();
$this
->
orderModel
=
new
OfficeOrderModel
();
$this
->
orderModel
=
new
OfficeOrderModel
();
$this
->
roomModel
=
new
OfficeGRoom
();
$this
->
roomAgentModel
=
new
OfficeGRoomToAgent
();
$this
->
agentModel
=
new
AAgents
();
}
}
/**
/**
...
@@ -102,8 +110,11 @@ class OfficeReportService
...
@@ -102,8 +110,11 @@ class OfficeReportService
* @param $params
* @param $params
* @param $pageNo
* @param $pageNo
* @param $pageSize
* @param $pageSize
* @return mixed
|null
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\db\exception\BindParamException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
)
public
function
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
)
...
@@ -279,9 +290,8 @@ class OfficeReportService
...
@@ -279,9 +290,8 @@ class OfficeReportService
*/
*/
public
function
houseInfo
(
$house_id_str
)
public
function
houseInfo
(
$house_id_str
)
{
{
$houseModel
=
new
GHouses
();
$params
[
"a.id"
]
=
array
(
"in"
,
(
$house_id_str
));
$params
[
"id"
]
=
array
(
"in"
,
(
$house_id_str
));
return
$this
->
roomModel
->
getHouseInfo
(
"a.id,CONCAT(b.address,a.room_number) internal_address"
,
$params
);
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
}
}
public
function
signTitle
(
$type
)
public
function
signTitle
(
$type
)
...
@@ -356,7 +366,7 @@ class OfficeReportService
...
@@ -356,7 +366,7 @@ class OfficeReportService
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
)
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
)
{
{
$roomModel
=
new
OfficeGRoom
();
$roomModel
=
new
OfficeGRoom
();
$houseResult
=
$roomModel
->
getHouseDetail
(
"a.id,c.title,c.address,a.room_number"
,
[
"id"
=>
$house_id
]);
$houseResult
=
$roomModel
->
getHouseDetail
(
"a.id,c.title,c.address,a.room_number"
,
[
"
a.
id"
=>
$house_id
]);
$house_title
=
count
(
$houseResult
)
>
0
?
$houseResult
[
"address"
]
.
" "
.
$houseResult
[
"room_number"
]
:
null
;
$house_title
=
count
(
$houseResult
)
>
0
?
$houseResult
[
"address"
]
.
" "
.
$houseResult
[
"room_number"
]
:
null
;
$param
[
"order_no"
]
=
$order_no
;
$param
[
"order_no"
]
=
$order_no
;
$param
[
"f_id"
]
=
$f_id
;
$param
[
"f_id"
]
=
$f_id
;
...
@@ -389,4 +399,64 @@ class OfficeReportService
...
@@ -389,4 +399,64 @@ class OfficeReportService
}
}
return
0
;
return
0
;
}
}
/**
* @param $agent_id
* @param $house_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
appAgentAuth
(
$agent_id
,
$house_id
)
{
$result
[
"marchIn"
]
=
false
;
$result
[
"collectingBill"
]
=
false
;
$result
[
"refund"
]
=
false
;
$result
[
"bargain"
]
=
false
;
if
(
$house_id
>
0
)
{
//todo 判断是不是案场权限人
$where_
[
"house_id"
]
=
$house_id
;
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
"type"
]
=
1
;
$where_
[
"is_del"
]
=
0
;
$isCase
=
$this
->
roomAgentModel
->
getHouseToAgents
(
"id"
,
$where_
);
if
(
count
(
$isCase
)
>
0
)
{
$result
[
"marchIn"
]
=
true
;
$result
[
"collectingBill"
]
=
true
;
$result
[
"refund"
]
=
true
;
$result
[
"bargain"
]
=
true
;
}
}
else
{
$auth_arr
=
[
'broker/marchIn'
,
'broker/collectingBill'
,
'broker/refund'
,
'broker/bargain'
,
];
$param
[
"name"
]
=
array
(
"in"
,
$auth_arr
);
$is_auth
=
$this
->
agentModel
->
agentsAuthIds
(
$agent_id
,
$param
);
if
(
count
(
$is_auth
)
>
0
)
{
foreach
(
$is_auth
as
$item
)
{
if
(
$item
[
'name'
]
==
"broker/marchIn"
)
{
$result
[
"marchIn"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/collectingBill"
)
{
$result
[
"collectingBill"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/refund"
)
{
$result
[
"refund"
]
=
true
;
}
if
(
$item
[
'name'
]
==
"broker/bargain"
)
{
$result
[
"bargain"
]
=
true
;
}
}
}
}
return
$result
;
}
}
}
\ No newline at end of file
application/model/OfficeGRoom.php
View file @
ddf1eb59
...
@@ -436,4 +436,25 @@ class OfficeGRoom extends BaseModel
...
@@ -436,4 +436,25 @@ class OfficeGRoom extends BaseModel
->
where
(
$params
)
->
where
(
$params
)
->
find
();
->
find
();
}
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseInfo
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"office_g_building b"
,
"a.building_id=a.id"
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
}
application/model/OfficeGRoomToAgent.php
View file @
ddf1eb59
...
@@ -160,4 +160,14 @@ class OfficeGRoomToAgent extends BaseModel
...
@@ -160,4 +160,14 @@ class OfficeGRoomToAgent extends BaseModel
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
}
}
public
function
getHouseToAgents
(
$field
,
$params
)
{
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
1
)
->
select
();
}
}
}
application/model/OfficeOrderModel.php
View file @
ddf1eb59
...
@@ -65,18 +65,22 @@ class OfficeOrderModel extends Model
...
@@ -65,18 +65,22 @@ class OfficeOrderModel extends Model
return
$result
;
return
$result
;
}
}
/**
/**
* @param $ids
* @param $ids
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
selectSign
(
$ids
)
public
function
selectSign
(
$ids
)
{
{
return
$this
->
db_
return
$this
->
db_
->
field
(
'id as order_id,1 as type'
)
->
field
(
'id as order_id,1 as type'
)
->
where
(
"id"
,
"in"
,
0
)
->
where
(
"id"
,
"in"
,
0
)
->
union
(
'SELECT order_id,2 as type FROM o_march_in where order_id in ('
.
$ids
.
') group by order_id'
)
->
union
(
'SELECT order_id,2 as type FROM o
ffice_o
_march_in where order_id in ('
.
$ids
.
') group by order_id'
)
->
union
(
'SELECT order_id,3 as type FROM o_paylog where order_id in ('
.
$ids
.
') group by order_id'
)
->
union
(
'SELECT order_id,3 as type FROM o
ffice_o
_paylog where order_id in ('
.
$ids
.
') group by order_id'
)
->
union
(
'SELECT order_id,4 as type FROM o_bargain where order_id in ('
.
$ids
.
') group by order_id'
)
->
union
(
'SELECT order_id,4 as type FROM o
ffice_o
_bargain where order_id in ('
.
$ids
.
') group by order_id'
)
->
select
();
->
select
();
}
}
...
...
application/route.php
View file @
ddf1eb59
...
@@ -986,6 +986,8 @@ Route::group('office', [
...
@@ -986,6 +986,8 @@ Route::group('office', [
'reportList'
=>
[
'api_broker/OfficeReport/reportList'
,
[
'method'
=>
'get'
]],
'reportList'
=>
[
'api_broker/OfficeReport/reportList'
,
[
'method'
=>
'get'
]],
'getCheckType'
=>
[
'api_broker/OfficeReport/getCheckType'
,
[
'method'
=>
'get|post'
]],
'getCheckType'
=>
[
'api_broker/OfficeReport/getCheckType'
,
[
'method'
=>
'get|post'
]],
'reportListForPc'
=>
[
'api_broker/OfficeReport/reportListForPc'
,
[
'method'
=>
'get'
]],
'reportListForPc'
=>
[
'api_broker/OfficeReport/reportListForPc'
,
[
'method'
=>
'get'
]],
'appAgentAuth'
=>
[
'api_broker/OfficeReport/appAgentAuth'
,
[
'method'
=>
'get'
]],
'getRoomListByReport'
=>
[
'api_broker/OfficeRoom/getRoomListByReport'
,
[
'method'
=>
'get|post'
]],
'getRoomListByReport'
=>
[
'api_broker/OfficeRoom/getRoomListByReport'
,
[
'method'
=>
'get|post'
]],
'addShopFollowUp'
=>
[
'api_broker/OfficeRoom/addShopFollowUp'
,
[
'method'
=>
'get|post'
]],
'addShopFollowUp'
=>
[
'api_broker/OfficeRoom/addShopFollowUp'
,
[
'method'
=>
'get|post'
]],
'getMyBuildingRoom'
=>
[
'api_broker/OfficeRoom/getMyBuildingRoom'
,
[
'method'
=>
'get|post'
]],
'getMyBuildingRoom'
=>
[
'api_broker/OfficeRoom/getMyBuildingRoom'
,
[
'method'
=>
'get|post'
]],
...
...
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