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
634fb25d
Commit
634fb25d
authored
Mar 09, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单搜索
parent
bebc797d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
222 additions
and
6 deletions
+222
-6
OrderLog.php
application/api_broker/controller/OrderLog.php
+4
-4
Statement.php
application/api_broker/controller/Statement.php
+53
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+1
-1
StatementService.php
application/api_broker/service/StatementService.php
+105
-0
AAgents.php
application/model/AAgents.php
+0
-0
FollowUpLogModel.php
application/model/FollowUpLogModel.php
+20
-0
GHouses.php
application/model/GHouses.php
+19
-1
Users.php
application/model/Users.php
+20
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
634fb25d
...
...
@@ -74,12 +74,12 @@ class OrderLog extends Basic
{
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"report_id"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
/*
if (!isset($params["agent_id"]) || !isset($params["report_id"]) || !isset($params["order_id"]) || !isset($params["order_no"])
|| !isset($params["collecting_bill"]) || !isset($params["collecting_bill"][0]["type"]) || !isset($params["house_number"])
|| !isset($params["industry_type"])) {
return $this->response("101", "请求参数错误");
}
/*
$params = array(
}
*/
$params
=
array
(
"agent_id"
=>
1
,
//收款经纪人id
"report_id"
=>
111
,
//报备id
"order_id"
=>
2
,
//关联order表id
...
...
@@ -94,7 +94,7 @@ class OrderLog extends Basic
"industry_type"
=>
"asdasdasd"
,
"remark"
=>
"没什么备注"
,
"transfer_img"
=>
"12312312312"
);
*/
);
$remark
=
isset
(
$params
[
"remark"
])
?
$params
[
"remark"
]
:
""
;
$transfer_img
=
isset
(
$params
[
"transfer_img"
])
?
$params
[
"transfer_img"
]
:
""
;
...
...
application/api_broker/controller/Statement.php
0 → 100644
View file @
634fb25d
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\StatementService
;
use
think\Exception
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/8
* Time : 上午11:22
* Intro:
*/
class
Statement
extends
Basic
{
private
$service_
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
StatementService
();
}
public
function
dayStatement
()
{
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
1
,
//"type" => 1, // 1.日报 2.周报
"time_start"
=>
date
(
"Y-m-d"
,
time
()),
"time_end"
=>
date
(
"Y-m-d"
,
time
())
.
" 23:59:59"
,
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
$result
=
$this
->
service_
->
selectStatementByAgentId
(
$params
[
"agent_id"
],
$params
[
"time_start"
],
$params
[
"time_end"
]);
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request is null"
);
}
}
catch
(
Exception
$exception
)
{
return
$this
->
response
(
"101"
,
"request is error,msg:"
.
$exception
);
}
}
}
\ No newline at end of file
application/api_broker/service/OrderLogService.php
View file @
634fb25d
...
...
@@ -63,7 +63,7 @@ class OrderLogService
if
(
!
empty
(
$bill_arr
))
{
return
$this
->
payLogModel
->
addPayLog
(
$bill_arr
);
}
return
0
;
return
$father_id
;
}
private
function
collectingBillBin
(
$father_id
,
$collecting_arr
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
...
...
application/api_broker/service/StatementService.php
0 → 100644
View file @
634fb25d
<?php
namespace
app\api_broker\service
;
use
app\model\AAgents
;
use
app\model\FollowUpLogModel
;
use
app\model\GHouses
;
use
app\model\Users
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/8
* Time : 上午11:33
* Intro:
*/
class
StatementService
{
private
$agentModel
;
private
$houseModel
;
private
$userModel
;
private
$followUpModel
;
function
__construct
()
{
$this
->
agentModel
=
new
AAgents
();
$this
->
houseModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
$this
->
followUpModel
=
new
FollowUpLogModel
();
}
/**
* @param $agent_id
* @param $time_start
* @param $time_end
* @return array|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectStatementByAgentId
(
$agent_id
,
$time_start
,
$time_end
){
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
$agent_result
=
$this
->
agentModel
->
getAgentById
(
$field
,
$agent_id
);
if
(
count
(
$agent_result
)
<=
0
){
return
null
;
}
$user_type
=
0
;
//经纪人权限,0经纪人 1店长 2总监
if
(
$agent_result
[
0
][
"level"
]
==
20
){
$user_type
=
1
;
}
elseif
(
$agent_result
[
0
][
"level"
]
==
30
||
$agent_result
[
0
][
"level"
]
==
40
){
$user_type
=
2
;
}
$store_id
=
$agent_result
[
0
][
"store_id"
];
$district_id
=
$agent_result
[
0
][
"district_id"
];
$conditions
[
"agent_id"
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_start
,
$time_end
)
);
return
$this
->
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
);
}
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
){
$result
=
$params
=
[];
switch
(
$user_type
){
case
0
:
//todo
break
;
case
1
:
//todo 统计门店下的所有经纪人
$params
[
"store_id"
]
=
$store_id
;
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
break
;
case
2
:
$params
[
"district_id"
]
=
$district_id
;
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
break
;
}
if
(
!
empty
(
$params
)){
$agentsArr
=
$this
->
agentModel
->
getAgentsByStoreId
(
$params
);
if
(
count
(
$agentsArr
)
>
0
){
$agentIds
=
""
;
foreach
(
$agentsArr
as
$key
=>
$value
){
$agentIds
.=
$value
[
"id"
]
.
","
;
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
$conditions
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
}
}
$result
[
"house_num"
]
=
$this
->
houseModel
->
getAddHouseNumByAgentId
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
$result
[
"follow_up_num"
]
=
$this
->
followUpModel
->
getAddFollowUpNumByAgentId
(
$conditions
);
return
$result
;
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
634fb25d
This diff is collapsed.
Click to expand it.
application/model/FollowUpLogModel.php
View file @
634fb25d
...
...
@@ -95,4 +95,23 @@ class FollowUpLogModel extends Model
->
select
();
}
/**
* 获取经纪人新增带看数量
* @param $params
* @return int|string
*/
public
function
getAddFollowUpNumByAgentId
(
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
$this
->
db_
->
where
(
$where_
)
->
count
();
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
634fb25d
...
...
@@ -416,7 +416,7 @@ class GHouses extends BaseModel
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
*/
function
getHouseDetailById
(
$field
,
$params
){
public
function
getHouseDetailById
(
$field
,
$params
){
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
...
...
@@ -425,6 +425,24 @@ class GHouses extends BaseModel
->
find
(
$params
[
"id"
]);
}
/**
* 获取经纪人时间段中新添加的楼盘个数
* @param $params
* @return int|string
*/
public
function
getAddHouseNumByAgentId
(
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"upload_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
where
(
$where_
)
->
count
();
}
/******zw end ************/
}
application/model/Users.php
View file @
634fb25d
...
...
@@ -283,4 +283,24 @@ class Users extends Model
->select();
return $data;
}*/
/**
* 获取经纪人新增用户数量
* @param $params
* @return int|string
*/
public
function
getAddUserNumByAgentId
(
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
where
(
$where_
)
->
count
();
}
}
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