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
92d0c9bc
Commit
92d0c9bc
authored
Mar 02, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
带看
parent
3792d704
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
Report.php
application/api_broker/controller/Report.php
+4
-4
ReportService.php
application/api_broker/service/ReportService.php
+26
-2
OrderModel.php
application/model/OrderModel.php
+1
-1
No files found.
application/api_broker/controller/Report.php
View file @
92d0c9bc
...
@@ -82,13 +82,13 @@ class Report extends Basic
...
@@ -82,13 +82,13 @@ class Report extends Basic
* @return \think\Response
* @return \think\Response
*/
*/
public
function
reportList
(){
public
function
reportList
(){
$params
=
array
(
/*
$params = array(
"agent_id" =>1,
"agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_no"=>1,
"page_size"=>15
"page_size"=>15
);
);
*/
//
$params = $this->params;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])){
if
(
!
isset
(
$params
[
"agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
@@ -97,7 +97,7 @@ class Report extends Basic
...
@@ -97,7 +97,7 @@ class Report extends Basic
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$field
=
"a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.house_id,b.house_title"
;
$field
=
"a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.
id as order_id,b.
house_id,b.house_title"
;
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
...
...
application/api_broker/service/ReportService.php
View file @
92d0c9bc
...
@@ -91,11 +91,22 @@ class ReportService
...
@@ -91,11 +91,22 @@ class ReportService
foreach
(
$result
as
$k
=>
$v
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
$ids_str
+=
$v
[
"order_id"
]
+
","
;
$ids_str
.=
$v
[
"order_id"
]
.
","
;
}
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$ids_str
=
rtrim
(
$ids_str
,
","
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
dump
(
$sign_arr
);
foreach
(
$result
as
$k
=>
$v
){
foreach
(
$sign_arr
as
$value
){
if
(
$v
[
"order_id"
]
==
$value
[
"order_id"
]){
$result
[
$k
][
"sign"
]
.=
$this
->
signTitle
(
$value
[
"type"
])
.
","
;
}
}
}
return
$result
;
return
$result
;
}
}
return
null
;
return
null
;
...
@@ -106,6 +117,19 @@ class ReportService
...
@@ -106,6 +117,19 @@ class ReportService
return
$this
->
orderModel
->
selectSign
(
$ids_str
);
return
$this
->
orderModel
->
selectSign
(
$ids_str
);
}
}
private
function
signTitle
(
$type
){
switch
(
$type
){
case
2
:
return
"进场"
;
case
3
:
return
"收款"
;
case
4
:
return
"成交报告"
;
default
:
return
null
;
}
}
/**
/**
* 订单号
* 订单号
...
...
application/model/OrderModel.php
View file @
92d0c9bc
...
@@ -61,7 +61,7 @@ class OrderModel extends Model
...
@@ -61,7 +61,7 @@ class OrderModel extends Model
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"
,
$ids
]]
)
->
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_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_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_bargain where order_id in ('
.
$ids
.
') group by order_id'
)
...
...
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