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
ec8e72fd
Commit
ec8e72fd
authored
Sep 05, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
621b8a0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
StatementService.php
application/api_broker/service/StatementService.php
+1
-1
OBargainModel.php
application/model/OBargainModel.php
+43
-0
No files found.
application/api_broker/service/StatementService.php
View file @
ec8e72fd
...
...
@@ -463,7 +463,7 @@ class StatementService
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
V2
(
$where_
,
3
);
//1表示业绩 2表示实收
$results
[
$key
][
"director_bargain_sum_store"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//todo 上周人数
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-14 day"
));
...
...
application/model/OBargainModel.php
View file @
ec8e72fd
...
...
@@ -4,6 +4,7 @@ namespace app\model;
use
app\task\controller\ResultsSummaryNewTask
;
use
think\Db
;
use
think\Log
;
use
think\Model
;
/**
...
...
@@ -741,7 +742,49 @@ class OBargainModel extends Model
// echo $this->getLastSql();
return
$return
;
}
public
function
getAddBargainNumV2
(
$params
,
$type
)
{
$where_
=
[];
$field
=
""
;
$join
=
[];
if
(
$type
==
1
)
{
$field
=
"sum(scale_fee) as num"
;
}
elseif
(
$type
==
2
)
{
$field
=
"sum(practical_fee) as num"
;
}
elseif
(
$type
==
3
)
{
$field
=
"count(1) as num"
;
//$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$where_
[
"role"
]
=
3
;
//必须是反签方
array_push
(
$join
,
[
' o_report c'
,
'a.report_id=c.id'
,
'left'
]);
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"agent_id"
])
&&
$type
==
3
)
{
unset
(
$where_
[
"agent_id"
]);
$where_
[
"c.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"
]
);
array_push
(
$join
,
[
' o_order b'
,
'a.order_id = b.id'
,
'left'
]);
}
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
$join
)
->
where
(
$where_
)
->
select
();
// echo $this->getLastSql();
Log
::
write
(
$this
->
getLastSql
(),
'本月完成单数-7151'
);
//记录日志
return
$return
;
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
...
...
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