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
e815cbb7
Commit
e815cbb7
authored
Jun 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实收记录
parent
a3f95ac6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
3 deletions
+90
-3
Performance.php
application/api_broker/controller/Performance.php
+36
-0
PerformanceService.php
application/api_broker/service/PerformanceService.php
+25
-0
OBargainModel.php
application/model/OBargainModel.php
+27
-2
route.php
application/route.php
+2
-1
No files found.
application/api_broker/controller/Performance.php
View file @
e815cbb7
...
...
@@ -423,4 +423,40 @@ class Performance extends Basic
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
/**
* 获取时间段实收数据
* @return \think\Response
*/
public
function
officialReceiptsList
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"type" => 1, //1个人,2经纪人
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceValidate.verify"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
//默认排序一周
$end_day
=
!
empty
(
$params
[
"end_time"
])
?
$params
[
"end_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$start_day
=
!
empty
(
$params
[
"start_time"
])
?
$params
[
"start_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$result
=
$this
->
service_
->
officialReceipts
(
$params
[
"type"
],
$params
[
"agent_id"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"date"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
}
application/api_broker/service/PerformanceService.php
View file @
e815cbb7
...
...
@@ -725,4 +725,28 @@ class PerformanceService
}
return
[
"code"
=>
200
,
"date"
=>
$superviseList
];
}
/**
* 获取实收记录
* @param $type
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public
function
officialReceipts
(
$type
,
$agent_id
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentId
(
$agent_id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,c.name,d.store_name,e.district_name,a.practical_fee,a.create_time"
;
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
$receivedList
=
$this
->
bargainModel
->
getReceivedList
(
$page_no
,
$page_size
,
$field
,
$where_
);
return
[
"code"
=>
200
,
"date"
=>
$receivedList
];
}
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
e815cbb7
...
...
@@ -569,7 +569,7 @@ class OBargainModel extends Model
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
...
...
@@ -659,7 +659,7 @@ class OBargainModel extends Model
$date
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
where
(
$where_
)
->
select
();
//echo $this->getLastSql();
...
...
@@ -667,6 +667,31 @@ class OBargainModel extends Model
}
public
function
getReceivedList
(
$page_no
,
$page_size
,
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"b.create_time"
]
=
$params
[
"create_time"
];
}
$date
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
join
(
"a_agents c"
,
"a.agent_id=c.id"
,
"left"
)
->
join
(
"a_store d"
,
"c.store_id=d.id"
,
"left"
)
->
join
(
"a_district e"
,
"c.district_id=c.id"
,
"left"
)
->
where
(
$where_
)
->
page
(
$page_no
)
->
limit
(
$page_size
)
->
select
();
return
$date
;
}
public
function
getAddBargainList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
...
...
application/route.php
View file @
e815cbb7
...
...
@@ -468,7 +468,8 @@ Route::group('broker', [
'marchInList'
=>
[
'api_broker/Performance/marchInList'
,
[
'method'
=>
'POST|GET'
]
],
//进场list
'paylogList'
=>
[
'api_broker/Performance/paylogList'
,
[
'method'
=>
'POST|GET'
]
],
//收款list
'performanceList'
=>
[
'api_broker/Performance/performanceList'
,
[
'method'
=>
'POST|GET'
]
],
//业绩list
'superviseList'
=>
[
'api_broker/Performance/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行list
'superviseList'
=>
[
'api_broker/Performance/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行list
'officialReceiptsList'
=>
[
'api_broker/Performance/officialReceiptsList'
,
[
'method'
=>
'POST|GET'
]
],
//实收list
//user
'returnSearchCondition'
=>
[
'api_broker/User/returnSearchCondition'
,
[
'method'
=>
'get'
]
],
//客户搜索条件
...
...
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