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
7926f039
Commit
7926f039
authored
Apr 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
a7ca026f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
Performance.php
application/api_broker/controller/Performance.php
+2
-2
PerformanceService.php
application/api_broker/service/PerformanceService.php
+13
-5
AAgents.php
application/model/AAgents.php
+2
-1
No files found.
application/api_broker/controller/Performance.php
View file @
7926f039
...
@@ -101,11 +101,11 @@ class Performance extends Basic
...
@@ -101,11 +101,11 @@ class Performance extends Basic
{
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 4,
"agent_id" => 4,
"start_time" => "2018-04-12",
"start_time" => "2018-04-12",
"end_time" => "2018-04-12",
"end_time" => "2018-04-12",
);
);
*/
try
{
try
{
$result
=
$this
->
service_
->
storePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]);
$result
=
$this
->
service_
->
storePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]);
...
...
application/api_broker/service/PerformanceService.php
View file @
7926f039
...
@@ -372,12 +372,13 @@ class PerformanceService
...
@@ -372,12 +372,13 @@ class PerformanceService
$list
=
[];
$list
=
[];
$now_date
=
date
(
"Y-m-d"
,
time
());
//
$now_date = date("Y-m-d", time());
$now_date
=
"2018-04-12"
;
if
(
$start_time
==
$now_date
&&
$end_time
==
$now_date
)
{
if
(
$start_time
==
$now_date
&&
$end_time
==
$now_date
)
{
$verify
=
new
VerifyService
();
$verify
=
new
VerifyService
();
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
// dump($agent_ids);
$params
[
"id"
]
=
array
(
"in"
,
$agent_ids
);
$params
[
"id"
]
=
array
(
"in"
,
$agent_ids
);
//todo 1.获取所有经纪人
//todo 1.获取所有经纪人
$field
=
"id as agent_id,store_id"
;
$field
=
"id as agent_id,store_id"
;
...
@@ -386,7 +387,7 @@ class PerformanceService
...
@@ -386,7 +387,7 @@ class PerformanceService
$group
=
"store_id"
;
$group
=
"store_id"
;
}
}
$list
=
$this
->
agentModel
->
getAgentsList
(
$field
,
$params
,
$group
);
$list
=
$this
->
agentModel
->
getAgentsList
(
$field
,
$params
,
$group
);
//dump($list);
foreach
(
$list
as
$key
=>
$item
)
{
foreach
(
$list
as
$key
=>
$item
)
{
$totalParams
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$totalParams
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$totalParams
[
'agent_id'
]
=
$item
[
"agent_id"
];
$totalParams
[
'agent_id'
]
=
$item
[
"agent_id"
];
...
@@ -410,6 +411,13 @@ class PerformanceService
...
@@ -410,6 +411,13 @@ class PerformanceService
//实收
//实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$totalParams
,
2
);
//1表示业绩 2表示实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$totalParams
,
2
);
//1表示业绩 2表示实收
$list
[
$key
][
"official_receipts"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$list
[
$key
][
"official_receipts"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$sum
=
$list
[
$key
][
"add_house_num"
]
+
$list
[
$key
][
"add_user_num"
]
+
$list
[
$key
][
"march_in_num"
]
+
$list
[
$key
][
"performance"
]
+
$list
[
$key
][
"official_receipts"
]
;
if
(
$sum
<=
0
){
unset
(
$list
[
$key
]);
}
}
}
...
@@ -433,8 +441,8 @@ class PerformanceService
...
@@ -433,8 +441,8 @@ class PerformanceService
$list
[
$key
][
"store_name"
]
=
$info
[
0
][
"store_name"
];
$list
[
$key
][
"store_name"
]
=
$info
[
0
][
"store_name"
];
$list
[
$key
][
"name"
]
=
$info
[
0
][
"name"
];
$list
[
$key
][
"name"
]
=
$info
[
0
][
"name"
];
}
else
{
}
else
{
$list
[
$key
][
"store_name"
]
=
""
;
$list
[
$key
][
"store_name"
]
=
"
--
"
;
$list
[
$key
][
"name"
]
=
""
;
$list
[
$key
][
"name"
]
=
"
--
"
;
}
}
}
}
}
}
...
...
application/model/AAgents.php
View file @
7926f039
...
@@ -574,13 +574,14 @@ class AAgents extends BaseModel
...
@@ -574,13 +574,14 @@ class AAgents extends BaseModel
*/
*/
public
function
getStoreOrAgentInfo
(
$field
,
$params
)
public
function
getStoreOrAgentInfo
(
$field
,
$params
)
{
{
return
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
where
(
$params
)
->
where
(
$params
)
->
where
(
'a.level'
,
[
'='
,
20
],
[
'='
,
40
],
'or'
)
->
where
(
'a.level'
,
[
'='
,
20
],
[
'='
,
40
],
'or'
)
->
select
();
->
select
();
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