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
670b94e6
Commit
670b94e6
authored
Jul 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣汇总修改
parent
bc8aa634
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
Finance.php
application/index/controller/Finance.php
+0
-0
OPartialCommission.php
application/model/OPartialCommission.php
+16
-3
No files found.
application/index/controller/Finance.php
View file @
670b94e6
This diff is collapsed.
Click to expand it.
application/model/OPartialCommission.php
View file @
670b94e6
...
@@ -236,7 +236,8 @@ class OPartialCommission extends BaseModel
...
@@ -236,7 +236,8 @@ class OPartialCommission extends BaseModel
$data
=
$this
->
alias
(
'a'
)
$data
=
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
field
(
$field
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_real_income f'
,
'b.id = f.bargain_id'
,
'left'
)
->
join
(
'o_bargain e'
,
'b.father_id = e.id or b.id=e.id and e.father_id=0'
,
'left'
)
->
join
(
'o_real_income f'
,
'e.id = f.bargain_id'
,
'left'
)
->
join
(
'a_agents d'
,
'a.agent_id = d.id'
,
'left'
)
->
join
(
'a_agents d'
,
'a.agent_id = d.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -254,17 +255,29 @@ class OPartialCommission extends BaseModel
...
@@ -254,17 +255,29 @@ class OPartialCommission extends BaseModel
$data
[
$k
][
'district_store'
]
=
$district_store
[
'district_name'
]
.
'-'
.
$district_store
[
'store_name'
];
$data
[
$k
][
'district_store'
]
=
$district_store
[
'district_name'
]
.
'-'
.
$district_store
[
'store_name'
];
//税费
//税费
$data
[
$k
][
'fee'
]
=
$m_tax
->
where
(
'operation_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
$data
[
$k
][
'fee'
]
=
$m_tax
->
where
(
'operation_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
sum
(
'fee'
);
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
sum
(
'fee'
);
//去除多次应分佣金
//去除多次应分佣金
$should_commission
=
$this
->
where
(
'confirm_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
$should_commission
=
$this
->
where
(
'confirm_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
group
(
'bargain_id'
)
->
column
(
'should_commission'
);
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
group
(
'bargain_id'
)
->
column
(
'should_commission'
);
$data
[
$k
][
'should_commission'
]
=
0
;
$data
[
$k
][
'should_commission'
]
=
0
;
foreach
(
$should_commission
as
$kk
=>
$vv
)
{
foreach
(
$should_commission
as
$kk
=>
$vv
)
{
$data
[
$k
][
'should_commission'
]
+=
$vv
;
$data
[
$k
][
'should_commission'
]
+=
$vv
;
}
}
$field_sum
=
'sum(practical_fee) as practical_fee,sum(cash) as cash,sum(real_fee) as real_fee,sum(service_charge) as service_charge,
sum(charity_fund) as charity_fund'
;
//应分佣金
$partial_commission
=
$this
->
field
(
$field_sum
)
->
where
(
'confirm_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
find
();
$data
[
$k
][
'practical_fee'
]
=
$partial_commission
[
'practical_fee'
];
$data
[
$k
][
'cash'
]
=
$partial_commission
[
'cash'
];
$data
[
$k
][
'real_fee'
]
=
$partial_commission
[
'real_fee'
];
$data
[
$k
][
'service_charge'
]
=
$partial_commission
[
'service_charge'
];
$data
[
$k
][
'charity_fund'
]
=
$partial_commission
[
'charity_fund'
];
}
}
}
}
...
...
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