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
9645d3c3
Commit
9645d3c3
authored
Jul 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
c01db511
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
24 deletions
+26
-24
OrderLogService.php
application/api_broker/service/OrderLogService.php
+9
-3
StatementService.php
application/api_broker/service/StatementService.php
+16
-19
OBargainModel.php
application/model/OBargainModel.php
+1
-2
No files found.
application/api_broker/service/OrderLogService.php
View file @
9645d3c3
...
...
@@ -1122,13 +1122,19 @@ class OrderLogService
$filed
=
"a.id,a.father_id,a.house_number,a.commission,a.agent_id,a.create_time,b.user_phone,b.user_name,b.user_id,c.id as order_id,
d.id as house_id,d.internal_title,d.internal_address"
;
$result
=
$bargainModel
->
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
);
$list
=
[];
foreach
(
$result
as
$k
=>
$v
)
{
if
(
$v
[
"father_id"
]
>
0
){
$father_id
=
$v
[
"father_id"
];
if
(
$father_id
>
0
&&
in_array
(
$father_id
,
$list
)){
unset
(
$result
[
$k
]);
}
else
{
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
$result
[
$k
][
"id"
]
=
$v
[
"father_id"
];
array_push
(
$list
,
$father_id
);
}
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
}
return
$result
;
return
;
}
...
...
application/api_broker/service/StatementService.php
View file @
9645d3c3
...
...
@@ -43,12 +43,13 @@ class StatementService
* @param $agent_id
* @param $time_start
* @param $time_end
* @param $day_or_week
* @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
,
$day_or_week
)
public
function
selectStatementByAgentId
(
$agent_id
,
$time_start
,
$time_end
,
$day_or_week
)
{
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
...
...
@@ -70,7 +71,7 @@ class StatementService
$conditions
[
"agent_id"
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_start
,
$time_end
)
);
//dump($user_type);
return
$this
->
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
);
return
$this
->
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
);
}
...
...
@@ -82,7 +83,7 @@ class StatementService
* @param $district_id
* @return array
*/
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
)
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
,
$day_or_week
)
{
$result
=
$params
=
[];
...
...
@@ -119,7 +120,7 @@ class StatementService
$conditions
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
if
(
$user_type
==
2
)
{
$district_lists
=
$this
->
getDistrictList
(
$conditions
,
$district_id
,
$day_or_week
);
$district_lists
=
$this
->
getDistrictList
(
$conditions
,
$district_id
,
$day_or_week
);
$district_list
=
$district_lists
[
"district_list"
];
$result
[
"last_week_total"
]
=
$district_lists
[
"last_week_total"
];
}
...
...
@@ -127,7 +128,6 @@ class StatementService
}
$result
[
"agent_total"
]
=
$agent_total
;
$result
[
"house_num"
]
=
$this
->
houseModel
->
getAddHouseNumByAgentId
(
$conditions
);
//dump($conditions);
...
...
@@ -138,9 +138,9 @@ class StatementService
//本月业绩
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
if
(
$user_type
==
2
)
{
//如果是总监
if
(
$user_type
==
2
)
{
//如果是总监
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
}
else
{
}
else
{
$where_
[
"district_id"
]
=
$district_id
;
}
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
...
...
@@ -152,7 +152,7 @@ class StatementService
//本周业绩
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
...
@@ -160,9 +160,9 @@ class StatementService
//本月完成单数
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
if
(
$user_type
==
2
)
{
//如果是总监
if
(
$user_type
==
2
)
{
//如果是总监
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
}
else
{
}
else
{
$where_
[
"district_id"
]
=
$district_id
;
}
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
...
...
@@ -213,12 +213,12 @@ class StatementService
$result
[
"district_list"
]
=
$district_list
;
if
(
$user_type
==
2
)
{
//如果是总监
if
(
$user_type
==
2
)
{
//如果是总监
//todo 判断是日报还是周报
if
(
$day_or_week
==
'day'
)
{
//日报
if
(
$day_or_week
==
'day'
)
{
//日报
}
else
{
//周报
}
else
{
//周报
//todo 本月业绩
$where_
=
[];
$start_time
=
date
(
"Y-m-01"
,
time
());
...
...
@@ -280,9 +280,6 @@ class StatementService
}
return
$result
;
}
...
...
@@ -310,7 +307,7 @@ class StatementService
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
...
...
@@ -329,7 +326,7 @@ class StatementService
* @param $district_id
* @return mixed
*/
private
function
getDistrictList
(
$conditions
,
$district_id
,
$day_or_week
)
private
function
getDistrictList
(
$conditions
,
$district_id
,
$day_or_week
)
{
//根据门店统计本周人数和上周人数
$time_start
=
$conditions
[
'time_start'
];
...
...
@@ -358,7 +355,7 @@ class StatementService
}
}
if
(
$day_or_week
==
'week'
)
{
if
(
$day_or_week
==
'week'
)
{
//todo 本月业绩
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));;
...
...
application/model/OBargainModel.php
View file @
9645d3c3
...
...
@@ -221,12 +221,11 @@ class OBargainModel extends Model
->
join
(
"o_order c"
,
"a.order_id = c.id"
,
"left"
)
->
join
(
"g_houses d"
,
"c.house_id = d.id"
,
"left"
)
->
where
(
$where_
)
->
group
(
"a.father_id"
)
->
order
(
"a.create_time desc"
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
//
echo $this->db_->getLastSql();
//
echo $this->db_->getLastSql();
return
$result
;
}
...
...
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