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
f1e49309
Commit
f1e49309
authored
Aug 17, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交分佣方业绩统计
parent
b85d6604
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
OrderLog.php
application/api_broker/controller/OrderLog.php
+32
-0
Finance.php
application/index/controller/Finance.php
+2
-0
OBargainModel.php
application/model/OBargainModel.php
+0
-6
No files found.
application/api_broker/controller/OrderLog.php
View file @
f1e49309
...
@@ -638,6 +638,7 @@ class OrderLog extends Basic
...
@@ -638,6 +638,7 @@ class OrderLog extends Basic
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
agentId
,
$this
->
params
[
'agent_id'
],
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
agentId
,
$this
->
params
[
'agent_id'
],
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
$source
);
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
$source
);
$this
->
updatePerformance
((
int
)
$this
->
params
[
'id'
],
(
int
)
$this
->
params
[
'agent_id'
]);
if
(
$data
[
'data'
]
==
0
)
{
if
(
$data
[
'data'
]
==
0
)
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Add the failure.'
;
$data
[
'msg'
]
=
'Add the failure.'
;
...
@@ -783,5 +784,35 @@ class OrderLog extends Basic
...
@@ -783,5 +784,35 @@ class OrderLog extends Basic
}
}
/**
* 更新个人业绩
*
* @param int $bargain_id
* @param int $agent_id
* @return bool
*/
private
function
updatePerformance
(
int
$bargain_id
=
0
,
int
$agent_id
=
0
)
:
bool
{
$where
=
[];
if
(
$bargain_id
)
{
$where
[
'b.id'
]
=
$bargain_id
;
}
if
(
$agent_id
)
{
$where
[
'a.id'
]
=
$agent_id
;
}
if
(
!
empty
(
$where
))
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentBragainDetail
(
'a.id,a.store_id,a.district_id,b.create_time'
,
[
'b.id'
=>
$bargain_id
]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
$agent_data
[
'create_time'
]));
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
}
return
true
;
}
}
}
\ No newline at end of file
application/index/controller/Finance.php
View file @
f1e49309
...
@@ -390,6 +390,8 @@ class Finance extends Basic
...
@@ -390,6 +390,8 @@ class Finance extends Basic
try
{
try
{
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
userId
,
$this
->
params
[
'agent_id'
],
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
userId
,
$this
->
params
[
'agent_id'
],
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
1
);
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
1
);
$this
->
updatePerformance
((
int
)
$this
->
params
[
'bargain_id'
],
(
int
)
$this
->
params
[
'agent_id'
]);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,新增分佣提成失败!请联系运营。'
);
return
$this
->
response
(
101
,
'内部错误,新增分佣提成失败!请联系运营。'
);
}
}
...
...
application/model/OBargainModel.php
View file @
f1e49309
...
@@ -932,12 +932,6 @@ class OBargainModel extends Model
...
@@ -932,12 +932,6 @@ class OBargainModel extends Model
$result
=
$this
->
insert
(
$insert_data
);
$result
=
$this
->
insert
(
$insert_data
);
if
(
$result
==
1
)
{
if
(
$result
==
1
)
{
$this
->
commit
();
$this
->
commit
();
$agent_data
=
$m_agent
->
verifyUser
(
'store_id,district_id'
,
''
,
[
'id'
=>
$agent_id
]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
$bargain_data
[
'create_time'
]));
$sum
->
updateTotalByAgentId
(
$agent_id
,
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
}
else
{
}
else
{
$this
->
rollback
();
$this
->
rollback
();
$result
=
false
;
$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