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
74c6f727
Commit
74c6f727
authored
Aug 14, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分佣方调业绩统计
parent
462401b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
Finance.php
application/index/controller/Finance.php
+20
-2
OBargainModel.php
application/model/OBargainModel.php
+3
-1
No files found.
application/index/controller/Finance.php
View file @
74c6f727
...
...
@@ -21,6 +21,7 @@ use app\model\OFinancialAudit;
use
app\model\OPartialCommission
;
use
app\model\OPayLogModel
;
use
app\model\ORefundModel
;
use
app\task\controller\ResultsSummaryNewTask
;
class
Finance
extends
Basic
{
...
...
@@ -1433,13 +1434,30 @@ class Finance extends Basic
if
(
empty
(
$this
->
params
[
'scale'
]))
{
return
$this
->
response
(
101
,
'分佣比例为空'
);
}
//检查成交报告是否存在
$data
=
$m_bargain
->
getBargainPartialDetail
(
'a.id,a.agent_id,a.create_time'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
if
(
empty
(
$data
[
'id'
]))
{
return
$this
->
response
(
101
,
'没有成交报告信息'
);
}
$update
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$update
[
'scale'
]
=
$this
->
params
[
'scale'
];
$update
[
'role'
]
=
$this
->
params
[
'role'
];
$update
[
'scale_fee'
]
=
$this
->
params
[
'scale_fee'
];
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
//更改分佣方
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
verifyUser
(
'id,store_id,district_id'
,
''
,[
'id'
=>
$this
->
params
[
'agent_id'
]]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
$data
[
'create_time'
]));
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
$sum
->
updateTotalByAgentId
(
$data
[
'agent_id'
],
$data
[
'store_id'
],
$data
[
'district_id'
],
$date
);
//修改为最新的分佣方
/*记录日志 start*/
$bargain_data
=
$m_bargain
->
selectBargainByOrderNo
(
'agent_id,father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
...
...
application/model/OBargainModel.php
View file @
74c6f727
...
...
@@ -1251,12 +1251,14 @@ class OBargainModel extends Model
->
find
();
$m_agent
=
new
AAgents
();
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name
,a.store_id,a.district_id
'
;
$agent_info
=
$m_agent
->
getAgentsInfoByAgentId
(
$filed_agent
,
[
'agent_id'
=>
$result
[
'agent_id'
]
]);
$result
[
'district_name'
]
=
$agent_info
[
0
][
'district_name'
];
$result
[
'store_name'
]
=
$agent_info
[
0
][
'store_name'
];
$result
[
'name'
]
=
$agent_info
[
0
][
'name'
];
$result
[
'phone'
]
=
$agent_info
[
0
][
'phone'
];
$result
[
'store_id'
]
=
$agent_info
[
0
][
'store_id'
];
$result
[
'district_id'
]
=
$agent_info
[
0
][
'district_id'
];
}
catch
(
\Exception
$ex
)
{
$result
=
false
;
...
...
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