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
831d8de4
Commit
831d8de4
authored
Jul 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
44c98351
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
CostDetail.php
application/index/controller/CostDetail.php
+45
-2
FStoreCostExt.php
application/model/FStoreCostExt.php
+23
-0
No files found.
application/index/controller/CostDetail.php
View file @
831d8de4
...
...
@@ -48,7 +48,7 @@ class CostDetail extends Basic
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
a.type,a.fee_item,a.purpose,
b
.store_id,a.assume_fee'
;
a.type,a.fee_item,a.purpose,
c
.store_id,a.assume_fee'
;
$list
=
$this
->
storeCostExt
->
getStoreCostExt
(
$field
,
$conditions
,
$pageNo
,
$pageSize
);
if
(
!
$list
)
...
...
@@ -79,7 +79,7 @@ class CostDetail extends Basic
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
a.type,a.fee_item,a.purpose,
b
.store_id,a.assume_fee'
;
a.type,a.fee_item,a.purpose,
c
.store_id,a.assume_fee'
;
$list
=
$this
->
storeCostExt
->
getStoreCostExtExcel
(
$field
,
$conditions
);
if
(
!
$list
)
...
...
@@ -429,4 +429,46 @@ class CostDetail extends Basic
return
$str
;
}
/**
* 我的门店成本
* @return \think\Response
*/
public
function
getMyCostDetailList
()
{
$params
=
$this
->
params
;
/* $params = array(
);*/
$conditions
=
[];
//计入月份
if
(
!
empty
(
$params
[
"setting_date"
]))
{
$conditions
[
"b.setting_date"
]
=
$params
[
"setting_date"
];
}
//门店id
if
(
!
empty
(
$params
[
'store_id'
]))
{
$conditions
[
"b.store_id"
]
=
$params
[
"store_id"
];
}
$field
=
'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
a.type,a.fee_item,a.purpose,c.store_id,a.assume_fee'
;
$list
=
$this
->
storeCostExt
->
getMyCostDetailList
(
$field
,
$conditions
);
if
(
!
$list
)
return
$this
->
response
(
"200"
,
"success"
,
[]);
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'type_name'
]
=
$this
->
getTypeName
(
$v
[
'type'
]);
$list
[
$k
][
'fee_item_name'
]
=
$this
->
getFeeItemName
(
$v
[
'fee_item'
]);
$list
[
$k
][
'store_name'
]
=
$this
->
getStoreName
(
$v
[
'store_id'
]);
}
$count
=
$this
->
storeCostExt
->
getStoreCostExtTotal
(
$field
,
$conditions
);
$result
[
"list"
]
=
$list
;
$result
[
"total"
]
=
$count
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
}
\ No newline at end of file
application/model/FStoreCostExt.php
View file @
831d8de4
...
...
@@ -30,6 +30,8 @@ class FStoreCostExt extends BaseModel
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost b'
,
'a.cost_id = b.id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'a.apply_for_id = c.id'
,
'left'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
...
...
@@ -44,6 +46,8 @@ class FStoreCostExt extends BaseModel
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost b'
,
'a.cost_id = b.id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'a.apply_for_id = c.id'
,
'left'
)
->
where
(
$params
)
->
count
();
return
$result
;
...
...
@@ -107,4 +111,23 @@ class FStoreCostExt extends BaseModel
->
where
(
$where
)
->
sum
(
$field
);
}
/**
* 我的门店成本
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getMyCostDetailList
(
$field
,
$params
)
{
$params
[
"b.status"
]
=
0
;
$result
=
$this
->
db_
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost b'
,
'a.cost_id = b.id'
,
'left'
)
->
join
(
'f_apply_for_fee c'
,
'a.apply_for_id = c.id'
,
'left'
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
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