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
42a3d28c
Commit
42a3d28c
authored
Jun 06, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d4fd721a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
35 deletions
+56
-35
OfficeReportService.php
application/api_broker/service/OfficeReportService.php
+38
-35
OfficeGRoom.php
application/model/OfficeGRoom.php
+18
-0
No files found.
application/api_broker/service/OfficeReportService.php
View file @
42a3d28c
...
...
@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use
app\api\untils\GeTuiUtils
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\OfficeGRoom
;
use
app\model\OfficeOrderModel
;
use
app\model\OfficeOReportModel
;
use
app\model\Users
;
...
...
@@ -24,8 +25,8 @@ class OfficeReportService
function
__construct
()
{
$this
->
reportModel
=
new
OfficeOReportModel
();
$this
->
orderModel
=
new
OfficeOrderModel
();
$this
->
reportModel
=
new
OfficeOReportModel
();
$this
->
orderModel
=
new
OfficeOrderModel
();
}
/**
...
...
@@ -42,9 +43,9 @@ class OfficeReportService
if
(
count
(
$userArr
)
>
0
)
{
$userResult
[
"user_phone"
]
=
$userArr
[
"user_phone"
];
if
(
empty
(
$userArr
[
'user_name'
]))
{
$userResult
[
"user_name"
]
=
$userArr
[
"user_nick"
];
$userResult
[
"user_name"
]
=
$userArr
[
"user_nick"
];
}
else
{
$userResult
[
"user_name"
]
=
$userArr
[
"user_name"
];
$userResult
[
"user_name"
]
=
$userArr
[
"user_name"
];
}
}
else
{
return
null
;
...
...
@@ -83,7 +84,7 @@ class OfficeReportService
foreach
(
$house_arr
as
$k
=>
$v
)
{
//todo 批量插入到数据库
if
(
$v
<=
0
)
{
if
(
$v
<=
0
)
{
break
;
}
$order_no
=
$this
->
createOrderNumber
();
...
...
@@ -109,9 +110,9 @@ class OfficeReportService
{
//todo 获取我报备的我的案场的,
//如果是店长则获取其下所有的经纪人 这里去掉了for190218
$vModel
=
new
VerifyService
();
$vModel
=
new
VerifyService
();
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$params
[
"report_agent_id"
]
);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$params
[
"report_agent_id"
]
);
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentIdV2
(
$params
[
"agent_id_s"
]);
$ids
=
""
;
...
...
@@ -137,25 +138,26 @@ class OfficeReportService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
returnResult
(
$result
){
$ids_str
=
""
;
public
function
returnResult
(
$result
)
{
$ids_str
=
""
;
$house_id_str
=
""
;
if
(
count
(
$result
)
>
0
)
{
foreach
(
$result
as
$k
=>
$v
)
{
$order_id
=
0
;
if
(
isset
(
$v
[
"order_id"
]))
{
if
(
isset
(
$v
[
"order_id"
]))
{
$order_id
=
$v
[
"order_id"
];
}
else
{
}
else
{
$order_id
=
$v
[
"id"
];
}
$ids_str
.=
$order_id
.
","
;
$ids_str
.=
$order_id
.
","
;
$house_id_str
.=
$v
[
"house_id"
]
.
","
;
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$ids_str
=
rtrim
(
$ids_str
,
","
);
$house_id_str
=
rtrim
(
$house_id_str
,
","
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
$house_arr
=
$this
->
houseInfo
(
$house_id_str
);
foreach
(
$result
as
$k
=>
$v
)
{
...
...
@@ -173,8 +175,9 @@ class OfficeReportService
}
}
return
$result
;
return
$result
;
}
/**
* 报备订单列表All
* @param $field
...
...
@@ -185,9 +188,9 @@ class OfficeReportService
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$check_type
)
public
function
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$check_type
)
{
$vModel
=
new
VerifyService
();
$vModel
=
new
VerifyService
();
$result
=
[];
switch
(
$check_type
)
{
case
1
:
...
...
@@ -195,19 +198,19 @@ class OfficeReportService
break
;
case
2
:
case
3
:
$agentArr
=
$vModel
->
getAgentsByAgentIdAndType
(
$params
[
"report_agent_id"
],
$check_type
);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$agentArr
=
$vModel
->
getAgentsByAgentIdAndType
(
$params
[
"report_agent_id"
],
$check_type
);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$params
[
"report_agent_id"
]
=
$agentArr
;
$caseHouseId
=
$vModel
->
getPanpartyAndExclusiveHouseIdByAgentId
(
$params
[
"agent_id_s"
]);
$ids
=
""
;
$caseHouseId
=
$vModel
->
getPanpartyAndExclusiveHouseIdByAgentId
(
$params
[
"agent_id_s"
]);
$ids
=
""
;
if
(
count
(
$caseHouseId
)
>
0
)
{
foreach
(
$caseHouseId
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
}
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
$ids
?
$ids
:
0
;
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
$ids
?
$ids
:
0
;
$params
[
"house_ids"
]
=
$ids
;
$result
=
$this
->
reportModel
->
selectReportList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
...
...
@@ -234,7 +237,7 @@ class OfficeReportService
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
if
(
$agentArr
)
{
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$params
[
"report_agent_id"
]
=
$agentArr
;
}
...
...
@@ -251,11 +254,11 @@ class OfficeReportService
$params
[
"house_ids"
]
=
$ids
;
$result
=
$this
->
reportModel
->
selectReportList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$count
=
$this
->
reportModel
->
selectReportCount
(
$field
,
$params
);
$count
=
$this
->
reportModel
->
selectReportCount
(
$field
,
$params
);
if
(
count
(
$result
)
>
0
)
{
$data
[
"result"
]
=
$this
->
returnResult
(
$result
);
$data
[
"total"
]
=
$count
[
0
][
"total"
]
?
$count
[
0
][
"total"
]
:
0
;
$data
[
"total"
]
=
$count
[
0
][
"total"
]
?
$count
[
0
][
"total"
]
:
0
;
return
$data
;
}
return
null
;
...
...
@@ -276,9 +279,9 @@ class OfficeReportService
*/
public
function
houseInfo
(
$house_id_str
)
{
$houseModel
=
new
GHouses
();
$params
[
"id"
]
=
array
(
"in"
,(
$house_id_str
));
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
$houseModel
=
new
GHouses
();
$params
[
"id"
]
=
array
(
"in"
,
(
$house_id_str
));
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
}
public
function
signTitle
(
$type
)
...
...
@@ -352,9 +355,9 @@ class OfficeReportService
*/
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
)
{
$
houseModel
=
new
GHouses
();
$houseResult
=
$
houseModel
->
getHouseDetail
(
"id,internal_title"
,
[
"id"
=>
$house_id
]);
$house_title
=
count
(
$houseResult
)
>
0
&&
isset
(
$houseResult
[
"internal_title"
])
?
$houseResult
[
"internal_title
"
]
:
null
;
$
roomModel
=
new
OfficeGRoom
();
$houseResult
=
$
roomModel
->
getHouseDetail
(
"a.id,c.title,c.address,a.room_number"
,
[
"id"
=>
$house_id
]);
$house_title
=
count
(
$houseResult
)
>
0
?
$houseResult
[
"address"
]
.
" "
.
$houseResult
[
"room_number
"
]
:
null
;
$param
[
"order_no"
]
=
$order_no
;
$param
[
"f_id"
]
=
$f_id
;
$param
[
"house_id"
]
=
$house_id
;
...
...
@@ -373,15 +376,15 @@ class OfficeReportService
public
function
getCheckType
(
$agent_id
)
{
$vip
=
new
VipService
();
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordAll/3'
)
==
0
)
{
//代表公司
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordAll/3'
)
==
0
)
{
//代表公司
return
1
;
}
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordDistrict/2'
)
==
0
)
{
//代表部门
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordDistrict/2'
)
==
0
)
{
//代表部门
return
2
;
}
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordStore/1'
)
==
0
)
{
//代表门店
if
(
$vip
->
vip
(
$agent_id
,
'index/inspectionRecordStore/1'
)
==
0
)
{
//代表门店
return
3
;
}
return
0
;
...
...
application/model/OfficeGRoom.php
View file @
42a3d28c
...
...
@@ -418,4 +418,22 @@ class OfficeGRoom extends BaseModel
->
page
(
$pageNo
)
->
select
();
}
/**
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
function
getHouseDetail
(
$field
,
$params
)
{
return
$data
=
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"office_g_building b"
,
"a.building_id=a.id"
)
->
where
(
$params
)
->
find
();
}
}
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