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
6401a0c2
Commit
6401a0c2
authored
Jul 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取 本月报销费用 (其他费用)
parent
2047945d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
CostParameter.php
application/index/controller/CostParameter.php
+30
-5
No files found.
application/index/controller/CostParameter.php
View file @
6401a0c2
...
...
@@ -9,6 +9,7 @@ use app\index\untils\ExportExcelUntil;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\CActivity
;
use
app\model\FApplyForFee
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FCompanyData
;
use
app\model\FSettingLog
;
...
...
@@ -297,11 +298,13 @@ class CostParameter extends Basic
$f_params
[
'setting_date'
]
=
$params
[
'setting_date'
];
$f_field
=
'type,fixed_fee,apply_for_fee,discounts'
;
$list_
=
$this
->
m_company_data
->
findByOne
(
$f_field
,
$f_params
);
if
(
!
$company_data
)
if
(
!
$company_data
)
{
$list_
[
'type'
]
=
$v
;
//费用类型 0上海总部成本 1杭州总部成本 2深圳总部成本 3广州总部成本 4北京总部成本 5同联发展基金 6总经理基薪
$list_
[
'fixed_fee'
]
=
0
;
//本月固定成本
$list_
[
'apply_for_fee'
]
=
0
;
//本月报销费用 (其他费用)
$list_
[
'fixed_fee'
]
=
0
;
//本月固定成本
$list_
[
'apply_for_fee'
]
=
$this
->
getApplyForFee
(
$v
,
$params
[
'setting_date'
])
;
//本月报销费用 (其他费用)
$list_
[
'discounts'
]
=
0
;
//百分比
}
$company_data
[]
=
$list_
;
}
...
...
@@ -309,6 +312,24 @@ class CostParameter extends Basic
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
/**
* 获取本月报销费用 (其他费用)
* @param $type
* @param $setting_date
* @return int
*/
public
function
getApplyForFee
(
$type
,
$setting_date
){
$fee_model
=
new
FApplyForFee
();
$params
[
'type'
]
=
$type
;
$params
[
'status'
]
=
4
;
$params
[
'is_del'
]
=
0
;
$params
[
'fee_item'
]
=
202
;
$params
[
'count_time'
]
=
$setting_date
;
$res
=
$fee_model
->
findByOne
(
'SUM(total_fee) as total_fee_num'
,
$params
);
$total_fee_num
=
isset
(
$res
[
'total_fee_num'
])
?
$res
[
'total_fee_num'
]
:
0
;
return
$total_fee_num
;
}
/**
* 编辑
...
...
@@ -446,13 +467,17 @@ class CostParameter extends Basic
$id_discounts_json
=
json_decode
(
$params
[
'id_discounts_json'
],
true
);
foreach
(
$id_discounts_json
as
$k
=>
$v
)
{
$u_params
=
[];
if
((
isset
(
$v
[
'id'
])
&&
$v
[
'id'
]
>
0
)
&&
(
isset
(
$v
[
'discounts'
])
&&
in_array
(
$v
[
'discounts'
],
[
0
,
1
])))
if
((
isset
(
$v
[
'id'
])
&&
$v
[
'id'
]
>
0
)
&&
(
isset
(
$v
[
'discounts'
])
&&
in_array
(
$v
[
'discounts'
],
[
0
,
1
])))
{
$f_params
[
'store_id'
]
=
$v
[
'id'
];
$f_params
[
'setting_date'
]
=
$params
[
'setting_date'
];
$store_data_res
=
$this
->
m_store_data
->
findByOne
(
'id'
,
$f_params
);
if
(
$store_data_res
)
if
(
$store_data_res
)
{
$u_params
[
'is_discounts'
]
=
$v
[
'discounts'
];
$this
->
updateStoreData
(
$store_data_res
[
'id'
],
$u_params
);
}
}
}
return
$this
->
response
(
"200"
,
"成功"
);
}
...
...
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