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
eac956b3
Commit
eac956b3
authored
Mar 02, 2018
by
zw
Committed by
hujun
Mar 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
带看
parent
27296d99
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
29 deletions
+61
-29
Report.php
application/api_broker/controller/Report.php
+12
-14
Basic.php
application/api_broker/extend/Basic.php
+3
-14
ReportService.php
application/api_broker/service/ReportService.php
+25
-0
OReportModel.php
application/model/OReportModel.php
+6
-1
OrderModel.php
application/model/OrderModel.php
+15
-0
No files found.
application/api_broker/controller/Report.php
View file @
eac956b3
...
...
@@ -19,14 +19,14 @@ class Report extends Basic
{
private
$service_
;
private
$fulModel
;
private
$oReportModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
ReportService
();
$this
->
fulModel
=
new
FollowUpLogModel
();
$this
->
oReportModel
=
new
OReportModel
();
}
/**
...
...
@@ -66,8 +66,6 @@ class Report extends Basic
if
(
!
$userArr
)
{
return
$this
->
response
(
"101"
,
"不存在此用户"
);
}
$is_ok
=
$this
->
service_
->
verifyReport
(
$agent_id
,
$this
->
agentName
,
$store_id
,
$user_id
,
$userArr
[
"user_phone"
],
$userArr
[
"user_name"
],
$house_ids
,
$vehicle
,
$intro
,
$predict_see_time
);
if
(
$is_ok
>
0
)
{
...
...
@@ -84,26 +82,26 @@ class Report extends Basic
* @return \think\Response
*/
public
function
reportList
(){
/*
$params = array(
$params
=
array
(
"agent_id"
=>
1
,
);*/
$params
=
$this
->
params
;
"type"
=>
1
,
//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"
=>
1
,
"page_size"
=>
15
);
//$params = $this->params;
if
(
!
isset
(
$params
[
"agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$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"
;
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
$this
->
oReportModel
->
selectReportList
(
$field
,
$params
);
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
if
(
count
(
$result
)
>
0
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
...
...
application/api_broker/extend/Basic.php
View file @
eac956b3
...
...
@@ -9,7 +9,6 @@ namespace app\api_broker\extend;
* Time: 9:35
* 基类
*/
use
app\api\untils\JwtUntils
;
use
app\model\AAgents
;
use
app\model\Users
;
use
app\model\GOperatingRecords
;
...
...
@@ -42,7 +41,6 @@ class Basic extends Controller
'broker/token'
,
'broker/getShopList'
,
'broker/getShopDetail'
,
'broker/login'
);
/**
...
...
@@ -65,22 +63,14 @@ class Basic extends Controller
}
elseif
(
strtoupper
(
$this
->
request
->
method
())
===
"POST"
)
{
$this
->
params
=
$this
->
request
->
param
()
!=
null
?
$this
->
request
->
param
()
:
null
;
}
/*临时验证 start*/
if
(
isset
(
$this
->
params
[
'AuthToken'
])
&&
$this
->
params
[
'AuthToken'
]
!=
'null'
&&
!
empty
(
$this
->
params
[
'AuthToken'
]))
{
$jwt
=
new
\Firebase\JWT\
JWT
();
$jwt
=
new
JWT
();
$this
->
authToken
=
$this
->
params
[
'AuthToken'
];
$result
=
$jwt
->
decode
(
$this
->
authToken
,
config
(
'jwt_key'
),
array
(
'HS256'
));
//解码token
$this
->
timeStamp_
=
$result
->
timeStamp_
;
if
(
isset
(
$result
->
data
->
phone
))
{
$phone
=
$result
->
data
->
phone
;
}
else
{
$phone
=
$result
->
data
;
}
$is
=
Db
::
table
(
'agents'
)
->
where
(
'phone'
,
$result
->
data
)
->
count
();
$is
=
Db
::
table
(
'agents'
)
->
where
(
'phone'
,
$phone
)
->
count
();
$this
->
agentPhone
=
$result
->
data
;
if
(
$is
==
0
)
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"用户验证失败,重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
...
...
@@ -91,7 +81,6 @@ class Basic extends Controller
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
tokenVerify
();
}
unset
(
$this
->
params
[
"AuthToken"
]);
/*临时验证 end*/
...
...
@@ -122,7 +111,7 @@ class Basic extends Controller
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"AuthToken不能为空!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
//
$this->verifyAgentInfo();
//
$this->verifyAgentInfo();
$this
->
verifyTime
();
}
...
...
application/api_broker/service/ReportService.php
View file @
eac956b3
...
...
@@ -20,11 +20,13 @@ class ReportService
private
$reportModel
;
private
$orderModel
;
private
$oReportModel
;
function
__construct
()
{
$this
->
reportModel
=
new
OReportModel
();
$this
->
orderModel
=
new
OrderModel
();
$this
->
oReportModel
=
new
OReportModel
();
}
/**
...
...
@@ -81,6 +83,29 @@ class ReportService
}
public
function
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
){
$result
=
$this
->
oReportModel
->
selectReportList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$ids_str
=
""
;
if
(
count
(
$result
)
>
0
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
$ids_str
+=
$v
[
"order_id"
]
+
","
;
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
dump
(
$sign_arr
);
return
$result
;
}
return
null
;
}
public
function
orderSign
(
$ids_str
){
return
$this
->
orderModel
->
selectSign
(
$ids_str
);
}
/**
* 订单号
...
...
application/model/OReportModel.php
View file @
eac956b3
...
...
@@ -76,9 +76,11 @@ class OReportModel extends Model
/**
* @param string $filed
* @param $params
* @param $pageNo
* @param $pageSize
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectReportList
(
$filed
=
"id"
,
$params
){
public
function
selectReportList
(
$filed
=
"id"
,
$params
,
$pageNo
,
$pageSize
){
$where_
=
[];
if
(
isset
(
$params
[
"report_agent_id"
]))
{
...
...
@@ -92,6 +94,8 @@ class OReportModel extends Model
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id= b.f_id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
}
\ No newline at end of file
application/model/OrderModel.php
View file @
eac956b3
...
...
@@ -54,4 +54,18 @@ class OrderModel extends Model
->
select
();
}
/**
* @param $ids
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectSign
(
$ids
){
return
$this
->
db_
->
field
(
'id as order_id,1 as type'
)
->
where
([
"id"
,[
"in"
,
$ids
]])
->
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,4 as type FROM o_bargain where order_id in ('
.
$ids
.
') group by order_id'
)
->
select
();
}
}
\ No newline at end of file
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