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
e9080c40
Commit
e9080c40
authored
Jun 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩子页面
parent
6d07d968
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
403 additions
and
43 deletions
+403
-43
Performance.php
application/api_broker/controller/Performance.php
+160
-17
PerformanceService.php
application/api_broker/service/PerformanceService.php
+91
-1
PerformanceValidate.php
application/api_broker/validate/PerformanceValidate.php
+2
-0
OBargainModel.php
application/model/OBargainModel.php
+51
-23
OMarchInModel.php
application/model/OMarchInModel.php
+30
-0
OPayLogModel.php
application/model/OPayLogModel.php
+30
-0
OReportModel.php
application/model/OReportModel.php
+35
-2
route.php
application/route.php
+4
-0
No files found.
application/api_broker/controller/Performance.php
View file @
e9080c40
...
...
@@ -69,13 +69,13 @@ class Performance extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"agent_id" => 9,
"start_time" => "2018-04-13",
"end_time" => "2018-06-18",
"is_case" => 1,//1经纪人 2案场
"house_id" => 0
);*/
/*$params = array(
"agent_id" => 9,
"start_time" => "2018-04-13",
"end_time" => "2018-06-18",
"is_case" => 1,//1经纪人 2案场
"house_id" => 0
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
])
||
!
isset
(
$params
[
"is_case"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -183,14 +183,14 @@ class Performance extends Basic
{
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
);*/
/* $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
)
{
...
...
@@ -210,6 +210,7 @@ class Performance extends Basic
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
/**
* 获取时间段新增客源数据
* @return \think\Response
...
...
@@ -218,7 +219,149 @@ class Performance extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
/* $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_
->
getUserResourceList
(
$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"
]);
}
}
/**
* 获取时间段带看数据
* @return \think\Response
*/
public
function
followList
()
{
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.verifyOther"
);
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_
->
getFollowList
(
$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"
]);
}
}
/**
* 获取时间段进场数据
* @return \think\Response
*/
public
function
marchInList
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceValidate.verifyOther"
);
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_
->
marchInList
(
$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"
]);
}
}
/**
* 获取时间段进场数据
* @return \think\Response
*/
public
function
paylogList
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceValidate.verifyOther"
);
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_
->
paylogList
(
$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"
]);
}
}
/**
* 获取时间段进场数据
* @return \think\Response
*/
public
function
performanceList
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"type" => 1, //1个人,2经纪人
"agent_id" => 80,
"start_time" => "2018-06-12",
...
...
@@ -238,7 +381,7 @@ class Performance extends Basic
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$result
=
$this
->
service_
->
getUserResourceList
(
$params
[
"type"
],
$params
[
"agent_id"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
$result
=
$this
->
service_
->
performanceList
(
$params
[
"type"
],
$params
[
"agent_id"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"date"
]);
}
else
{
...
...
application/api_broker/service/PerformanceService.php
View file @
e9080c40
...
...
@@ -587,7 +587,6 @@ class PerformanceService
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"id,user_name,user_phone,user_nick,create_time,agent_id"
;
$addUserList
=
$this
->
userModel
->
getAddUserList
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$addUserList
as
$key
=>
$val
)
{
if
(
$val
[
"agent_id"
]
==
$agent_id
)
{
$addUserList
[
$key
][
"is_my"
]
=
1
;
...
...
@@ -598,4 +597,94 @@ class PerformanceService
}
return
[
"code"
=>
200
,
"date"
=>
$addUserList
];
}
/**
* 获取带看数据
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
getFollowList
(
$agent_id
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentId
(
$agent_id
,
2
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,a.user_name,a.user_phone,a.predict_see_time,b.house_title"
;
$reportList
=
$this
->
reportModel
->
getAddReportList
(
$params
,
$field
,
$page_no
,
$page_size
);
foreach
(
$reportList
as
$key
=>
$val
)
{
$reportList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$reportList
];
}
/**
* 获取进场数据
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
marchInList
(
$agent_id
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentId
(
$agent_id
,
2
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title"
;
$addMarchInList
=
$this
->
marchInModel
->
getAddMarchInList
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$addMarchInList
as
$key
=>
$val
)
{
$addMarchInList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
];
}
/**
* 获取收款数据
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
paylogList
(
$agent_id
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentId
(
$agent_id
,
2
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title"
;
$payLogList
=
$this
->
payLogModel
->
getAddPayLogList
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$payLogList
as
$key
=>
$val
)
{
$payLogList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$payLogList
];
}
/**
* 获取业绩数据
* @param $type
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
performanceList
(
$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,b.name,c.store_name,d.district_name,a.scale_fee,a.create_time"
;
$performanceList
=
$this
->
bargainModel
->
getAddBargainList
(
$params
,
$field
,
$page_no
,
$page_size
);
return
[
"code"
=>
200
,
"date"
=>
$performanceList
];
}
}
\ No newline at end of file
application/api_broker/validate/PerformanceValidate.php
View file @
e9080c40
...
...
@@ -27,5 +27,6 @@ class PerformanceValidate extends Validate
protected
$scene
=
[
'verify'
=>
[
'type'
,
'agent_id'
],
'verifyOther'
=>
[
'agent_id'
],
];
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
e9080c40
...
...
@@ -111,20 +111,21 @@ class OBargainModel extends Model
* @param $house_id
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectBargainListByHouseId
(
$house_id
){
public
function
selectBargainListByHouseId
(
$house_id
)
{
$params
[
"b.house_id"
]
=
$house_id
;
$params
[
"a.status"
]
=
array
(
"not in"
,
"21,30"
);
$data
=
$this
->
db_
$params
[
"a.status"
]
=
array
(
"not in"
,
"21,30"
);
$data
=
$this
->
db_
->
field
(
"a.id,a.industry_type"
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id=b.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.order_id=b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
$str
=
""
;
if
(
count
(
$data
)
<=
0
)
{
return
$str
;
$str
=
""
;
if
(
count
(
$data
)
<=
0
)
{
return
$str
;
}
foreach
(
$data
as
$item
){
foreach
(
$data
as
$item
)
{
$str
.=
"、"
.
$item
[
"industry_type"
];
}
return
$str
;
...
...
@@ -305,8 +306,8 @@ class OBargainModel extends Model
if
(
$audit_level
!=
-
1
)
{
$sql_string
=
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
;
$sql_string
=
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
;
$data
=
$this
->
table
(
$sql_string
)
->
field
(
$field
)
...
...
@@ -362,12 +363,12 @@ class OBargainModel extends Model
* @param int $audit_level
* @return int
*/
public
function
getBargainTotal
(
array
$params
=
[],
int
$audit_level
=
0
)
:
int
public
function
getBargainTotal
(
array
$params
=
[],
int
$audit_level
=
0
)
:
int
{
$total
=
0
;
if
(
$audit_level
!=
-
1
)
{
$total
=
$this
->
table
(
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
)
$total
=
$this
->
table
(
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
)
->
join
(
'o_bargain a'
,
'e.bargain_id = a.id'
,
'left'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
...
...
@@ -407,7 +408,7 @@ class OBargainModel extends Model
// $this->startTrans();
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
'status'
=>
[
'in'
,
'10,11'
]
'status'
=>
[
'in'
,
'10,11'
]
])
->
find
();
if
(
$bargain_data
!=
''
)
{
...
...
@@ -447,7 +448,7 @@ class OBargainModel extends Model
$update_data
[
'status'
]
=
13
;
$update_data
[
'account_statement'
]
=
1
;
$update_data
[
'account_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
whereOr
(
'father_id'
,
$bargain_data
[
'id'
])
->
update
(
$update_data
);
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
whereOr
(
'father_id'
,
$bargain_data
[
'id'
])
->
update
(
$update_data
);
$this
->
save
(
$update_data
,
[
'id'
=>
$bargain_data
[
'id'
]
]);
}
else
{
$update_data
[
'status'
]
=
11
;
...
...
@@ -525,7 +526,7 @@ class OBargainModel extends Model
->
page
(
$pageNo
)
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$v
[
'singntime'
]))
{
$data
[
$k
][
'singntime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'singntime'
]));
}
...
...
@@ -537,8 +538,8 @@ class OBargainModel extends Model
}
if
(
isset
(
$v
[
'house_id'
]))
{
$img_name
=
$this
->
db_
->
table
(
'g_houses_imgs'
)
->
where
(
'id'
,
$v
[
'house_id'
])
->
value
(
'img_name'
);
$data
[
$k
][
'img'
]
=
CK_IMG_URL
.
'images/'
.
$img_name
;
$img_name
=
$this
->
db_
->
table
(
'g_houses_imgs'
)
->
where
(
'id'
,
$v
[
'house_id'
])
->
value
(
'img_name'
);
$data
[
$k
][
'img'
]
=
CK_IMG_URL
.
'images/'
.
$img_name
;
}
}
...
...
@@ -589,7 +590,8 @@ class OBargainModel extends Model
}
elseif
(
$type
==
2
)
{
$field
=
"sum(practical_fee) as num"
;
}
elseif
(
$type
==
3
)
{
$field
=
"count(1) as num"
;
$field
=
"count(1) as num"
;
$where_
[
"a.trade_type"
]
=
10
;
}
...
...
@@ -612,6 +614,32 @@ class OBargainModel extends Model
->
select
();
}
public
function
getAddBargainList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
join
(
"a_store c"
,
"b.store_id = c.id"
,
"left"
)
->
join
(
"a_district d"
,
"b.district_id = d.id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
}
public
function
getAddBargainOrderList
(
$field
,
$params
)
{
$where_
=
[];
...
...
@@ -684,7 +712,7 @@ class OBargainModel extends Model
$this
->
lock
(
true
);
$bargain_data
=
$this
->
where
(
'id'
,
$id
)
->
find
();
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
$submit_agent_name
=
$m_agent
->
getAgentsById
(
$submit_agent_id
,
'name'
);
if
(
empty
(
$bargain_data
[
'id'
]))
{
$result
=
false
;
...
...
@@ -871,8 +899,8 @@ class OBargainModel extends Model
*/
public
function
getAgentTypeByBargainId
(
int
$bargain_id
)
:
array
{
$result
=
[];
$m_partial
=
new
OPartialCommission
();
$result
=
[];
$m_partial
=
new
OPartialCommission
();
$partial_bargain
=
$m_partial
->
getBragainScale
(
$bargain_id
);
foreach
(
$partial_bargain
as
$val
)
{
...
...
@@ -887,7 +915,7 @@ class OBargainModel extends Model
}
else
{
$data
=
$this
->
field
(
'role,agent_id,scale,scale_fee'
)
->
where
(
'id'
,
$bargain_id
)
->
where
(
'id'
,
'not in'
,
implode
(
','
,
$bargain_id_arr
))
->
where
(
'id'
,
'not in'
,
implode
(
','
,
$bargain_id_arr
))
// ->whereOr('father_id', $bargain_id)
->
select
();
}
...
...
application/model/OMarchInModel.php
View file @
e9080c40
...
...
@@ -133,6 +133,36 @@ class OMarchInModel extends Model
->
select
();
}
/**
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddMarchInList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"a.reception_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
])){
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]);
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
}
public
function
getAddMarchInOrderList
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
...
...
application/model/OPayLogModel.php
View file @
e9080c40
...
...
@@ -185,6 +185,36 @@ class OPayLogModel extends Model
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddPayLogList
(
$params
,
$field
,
$page_no
,
$page_size
){
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
])){
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]);
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
}
/**
* @param $field
* @param $params
...
...
application/model/OReportModel.php
View file @
e9080c40
...
...
@@ -370,6 +370,39 @@ class OReportModel extends Model
return
$result
;
}
/**
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddReportList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
$where_
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* @param $field
* @param $params
...
...
@@ -516,8 +549,8 @@ class OReportModel extends Model
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"b.f_id = a.id"
,
"left"
)
->
join
(
"o_march_in c"
,
"c.report_id = a.id"
,
"right"
)
->
join
(
"g_houses d"
,
"d.id = b.house_id"
,
"left"
)
->
join
(
"o_march_in c"
,
"c.report_id = a.id"
,
"right"
)
->
join
(
"g_houses d"
,
"d.id = b.house_id"
,
"left"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
...
...
application/route.php
View file @
e9080c40
...
...
@@ -472,6 +472,10 @@ Route::group('broker', [
'housingResource'
=>
[
'api_broker/Performance/housingResource'
,
[
'method'
=>
'POST|GET'
]
],
//获取房源list
'userResource'
=>
[
'api_broker/Performance/userResource'
,
[
'method'
=>
'POST|GET'
]
],
//获取客源list
'followList'
=>
[
'api_broker/Performance/followList'
,
[
'method'
=>
'POST|GET'
]
],
//报备list
'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
]);
...
...
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