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
91d832b1
Commit
91d832b1
authored
Jul 25, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store_name
parent
e7df27eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
Cost.php
application/index/controller/Cost.php
+10
-7
FStoreCost.php
application/model/FStoreCost.php
+15
-3
No files found.
application/index/controller/Cost.php
View file @
91d832b1
...
...
@@ -297,9 +297,6 @@ class Cost extends Basic
$data
[
'office_attendance_num'
]
=
0
;
if
(
$this
->
params
[
'is_self'
]
==
1
)
{
$agent_data
=
$redis
->
getRedisCache
(
2
,
$data
[
'agent_id'
]);
$cost_where
[
'b.store_id'
]
=
$ext_where
[
'c.store_id'
]
=
$agent_data
[
'store_id'
];
$m_setting
=
new
FSettingLog
();
$setting_data
=
$m_setting
->
findByAll
(
'type,operator_name'
,
[
'setting_date'
=>
$data
[
'count_time'
]]);
foreach
(
$setting_data
as
$k
=>
$v
)
{
...
...
@@ -315,11 +312,17 @@ class Cost extends Basic
//费用类型 1办公室成本 2上海总部成本 3分部成本 4同联发展基金 5门店单独成本
switch
(
$data
[
'type'
])
{
case
1
:
$store_field
=
'a.cost_id as id,a.assume_fee,a.store_attendance_num,c.store_name'
;
$cost_where
[
'a.apply_for_id'
]
=
$data
[
'id'
];
$store_cost_data
=
$m_store_cost_ext
->
getFeeStoreCost
(
$store_field
,
$cost_where
);
$store_field
=
'c.id,b.assume_fee,b.store_attendance_num,b.store_id'
;
$cost_where
[
'b.apply_for_id'
]
=
$data
[
'id'
];
$cost_where
[
'a.status'
]
=
0
;
$cost_where
[
'a.setting_date'
]
=
$data
[
'count_time'
];
$store_cost_data
=
$m_store_cost
->
getFeeOfficeCostList
(
$store_field
,
$cost_where
);
if
(
$store_cost_data
)
{
$data
[
'store_cost_data'
]
=
$store_cost_data
;
foreach
(
$store_cost_data
as
$k
=>
$v
)
{
$store_cost_data
[
$k
][
'store_name'
]
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$v
[
'store_id'
]]);
}
$data
[
'store_cost_data'
]
=
$store_cost_data
;
}
if
(
$data
[
'office_id'
])
{
...
...
application/model/FStoreCost.php
View file @
91d832b1
...
...
@@ -92,7 +92,7 @@ class FStoreCost extends BaseModel
->
select
();
}
/**
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
...
...
@@ -101,10 +101,22 @@ class FStoreCost extends BaseModel
{
return
$this
->
alias
(
'a'
)
->
join
(
'f_store_cost_ext b'
,
'a.id = b.cost_id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'b.apply_for_id =
b
.id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'b.apply_for_id =
c
.id'
,
'left'
)
->
where
(
$where
)
->
sum
(
$field
);
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getFeeOfficeCostList
(
$field
,
$where
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost_ext b'
,
'a.id = b.cost_id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'b.apply_for_id = c.id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
}
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