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
aa3030db
Commit
aa3030db
authored
Nov 15, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
撤销成交报告同步所有人的业绩
parent
182ee770
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
Finance.php
application/index/controller/Finance.php
+24
-1
AAgents.php
application/model/AAgents.php
+18
-0
No files found.
application/index/controller/Finance.php
View file @
aa3030db
...
@@ -1938,7 +1938,7 @@ class Finance extends Basic
...
@@ -1938,7 +1938,7 @@ class Finance extends Basic
if
(
$result
)
{
if
(
$result
)
{
$code
=
200
;
$code
=
200
;
$this
->
editRecordLog
(
$this
->
params
[
'bargain_id'
],
'[撤销成交报告]'
,
3
);
//日志记录
$this
->
editRecordLog
(
$this
->
params
[
'bargain_id'
],
'[撤销成交报告]'
,
3
);
//日志记录
$this
->
updatePerformance
(
$this
->
params
[
'bargain_id'
]);
$this
->
updatePerformance
All
(
$this
->
params
[
'bargain_id'
]);
$bargain_data
=
$this
->
m_bargain
->
getBargainDetail
(
'order_id,order_no,agent_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$bargain_data
=
$this
->
m_bargain
->
getBargainDetail
(
'order_id,order_no,agent_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$financial_data
[
'bargain_id'
]
=
$this
->
params
[
'bargain_id'
];
$financial_data
[
'bargain_id'
]
=
$this
->
params
[
'bargain_id'
];
...
@@ -1990,6 +1990,29 @@ class Finance extends Basic
...
@@ -1990,6 +1990,29 @@ class Finance extends Basic
return
true
;
return
true
;
}
}
/**
* 更新多人业绩
*
* @param int $bargain_id
* @return bool
*/
private
function
updatePerformanceAll
(
int
$bargain_id
=
0
)
:
bool
{
$where
=
[];
if
(
$bargain_id
)
{
$where
[
'b.id'
]
=
$bargain_id
;
}
if
(
!
empty
(
$where
))
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentBargainAll
(
'a.id,a.store_id,a.district_id,b.create_time'
,
$where
);
foreach
(
$agent_data
as
$v
)
{
$this
->
updatePerformanceData
(
$v
[
'id'
],
$v
[
'create_time'
],
$v
[
'store_id'
],
$v
[
'district_id'
]);
}
}
return
true
;
}
private
function
updatePerformanceData
(
$id
,
$create_time
,
$store_id
,
$district_id
)
{
private
function
updatePerformanceData
(
$id
,
$create_time
,
$store_id
,
$district_id
)
{
//更新业绩统计
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$sum
=
new
ResultsSummaryNewTask
();
...
...
application/model/AAgents.php
View file @
aa3030db
...
@@ -1221,6 +1221,24 @@ class AAgents extends BaseModel
...
@@ -1221,6 +1221,24 @@ class AAgents extends BaseModel
return
$data
;
return
$data
;
}
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
*/
public
function
agentBargainAll
(
$field
,
$where
)
{
try
{
$data
=
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_bargain b'
,
'a.id = b.agent_id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
[];
}
return
$data
;
}
/**
/**
* 获取绑定号码
* 获取绑定号码
*
*
...
...
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