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
fa234e4e
Commit
fa234e4e
authored
Dec 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实收汇总优化-税费
parent
fef09fb3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
Finance.php
application/index/controller/Finance.php
+14
-3
OPartialCommission.php
application/model/OPartialCommission.php
+0
-6
OTaxes.php
application/model/OTaxes.php
+5
-0
No files found.
application/index/controller/Finance.php
View file @
fa234e4e
...
...
@@ -1640,6 +1640,7 @@ class Finance extends Basic
}
$m_partial
=
new
OPartialCommission
();
$m_tax
=
new
OTaxes
();
$fields
=
'd.income_time,c.create_time,c.id,a.agent_id,b.name,b.phone'
;
$commission_fields
=
'sum(practical_fee) as practical_fee,sum(cash) as cash,sum(real_fee) as real_fee,sum(service_charge) as service_charge,
...
...
@@ -1649,6 +1650,9 @@ class Finance extends Basic
}
$commission_where
[
'b.income_time'
]
=
[
'between time'
,
[
$operation_start_data
,
$operation_end_data
]];
$commission_where
[
'confirm_status'
]
=
1
;
$tax_where
[
'operation_date'
]
=
[
'between time'
,
[
$operation_start_data
,
$operation_end_data
]];
$tax_where
[
'is_del'
]
=
0
;
if
(
empty
(
$this
->
params
[
'excel'
])
&&
$this
->
params
[
'excel'
]
!=
1
)
{
$result_data
=
$m_partial
->
getCommissionTotalListV2
(
$pageNo
,
$pageSize
,
'a.agent_id desc'
,
$fields
,
$where
,
$operation_start_data
,
$operation_end_data
);
if
(
$result_data
[
'status'
]
==
'successful'
)
{
...
...
@@ -1664,7 +1668,11 @@ class Finance extends Basic
$list
[
$k
][
'real_fee'
]
=
$commission_data
[
'real_fee'
];
$list
[
$k
][
'service_charge'
]
=
$commission_data
[
'service_charge'
];
$list
[
$k
][
'charity_fund'
]
=
$commission_data
[
'charity_fund'
];
$list
[
$k
][
'over_fee'
]
=
$commission_data
[
'practical_fee'
]
-
$v
[
'fee'
];
$tax_where
[
'agent_id'
]
=
$v
[
'agent_id'
];
$fee
=
$m_tax
->
sumField
(
'fee'
,
$tax_where
);
$list
[
$k
][
'fee'
]
=
$fee
;
$list
[
$k
][
'over_fee'
]
=
$commission_data
[
'practical_fee'
]
-
$fee
;
}
$data
[
'data'
][
'list'
]
=
$list
;
$data
[
'data'
][
'total'
]
=
$m_partial
->
getCommissionTotalListTotalV2
(
$where
);
...
...
@@ -1693,8 +1701,11 @@ class Finance extends Basic
$excel_data
[
$k
][
'cash'
]
=
$commission_data
[
'cash'
];
//现金奖
$excel_data
[
$k
][
'charity_fund'
]
=
$commission_data
[
'charity_fund'
];
//慈善基金
$excel_data
[
$k
][
'practical_fee'
]
=
$commission_data
[
'practical_fee'
];
//实收佣金
$excel_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
//税费
$excel_data
[
$k
][
'over_fee'
]
=
$commission_data
[
'practical_fee'
]
-
$v
[
'fee'
];
$tax_where
[
'agent_id'
]
=
$v
[
'agent_id'
];
$fee
=
$m_tax
->
sumField
(
'fee'
,
$tax_where
);
$excel_data
[
$k
][
'fee'
]
=
$fee
;
$excel_data
[
$k
][
'over_fee'
]
=
$commission_data
[
'practical_fee'
]
-
$fee
;
}
$num
=
count
(
$excel_data
)
+
2
;
...
...
application/model/OPartialCommission.php
View file @
fa234e4e
...
...
@@ -308,12 +308,6 @@ class OPartialCommission extends BaseModel
$district_store
=
$m_agent
->
getStoreDistrict
(
'store_name,district_name'
,
[
'a.id'
=>
$v
[
'agent_id'
]
]);
$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
])
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
->
where
(
'is_del'
,
0
)
->
sum
(
'fee'
);
//去除多次应分佣金
$should_commission
=
$this
->
where
(
'confirm_date'
,
'between time'
,
[
$operation_start_data
,
$operation_end_data
])
->
where
(
'agent_id'
,
$v
[
'agent_id'
])
...
...
application/model/OTaxes.php
View file @
fa234e4e
...
...
@@ -279,4 +279,8 @@ class OTaxes extends BaseModel
$result
=
$this
->
where
(
$where_
)
->
update
(
$update_dta
);
return
$result
;
}
public
function
sumField
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
->
sum
(
$field
);
}
}
\ No newline at end of file
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