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
396da28a
Commit
396da28a
authored
Jul 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全部门店成本
parent
739f83cd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
25 deletions
+32
-25
CostDetail.php
application/index/controller/CostDetail.php
+11
-24
CostDetailValidate.php
application/index/validate/CostDetailValidate.php
+9
-0
FStoreCost.php
application/model/FStoreCost.php
+11
-0
route.php
application/route.php
+1
-1
No files found.
application/index/controller/CostDetail.php
View file @
396da28a
...
...
@@ -9,6 +9,7 @@ use app\index\untils\ExportExcelUntil;
use
app\model\AStore
;
use
app\model\CActivity
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FStoreCost
;
use
app\model\FStoreCostExt
;
use
think\Request
;
...
...
@@ -431,40 +432,26 @@ class CostDetail extends Basic
/**
*
我的
门店成本
*
全部
门店成本
* @return \think\Response
*/
public
function
get
MyCostDetailLi
st
()
public
function
get
AllStoreCo
st
()
{
$params
=
$this
->
params
;
/* $params
= array(
);
*/
$params
=
array
(
"district_id"
=>
'12'
);
$checkResult
=
$this
->
validate
(
$params
,
"CostDetailValidate.get
MyCostDetailLi
st"
);
$checkResult
=
$this
->
validate
(
$params
,
"CostDetailValidate.get
AllStoreCo
st"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$conditions
=
[];
//计入月份
$conditions
[
"b.setting_date"
]
=
$params
[
"setting_date"
];
//门店id
$conditions
[
"a.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,b.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'
]);
}
$conditions
[
"b.district_id"
]
=
$params
[
"district_id"
];
$field
=
'c.district_name,a.store_name'
;
$m_store_cost
=
new
FStoreCost
();
$list
=
$m_store_cost
->
getAllStoreCost
(
$field
,
$conditions
);
$result
[
"list"
]
=
$list
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
...
...
application/index/validate/CostDetailValidate.php
View file @
396da28a
...
...
@@ -11,6 +11,9 @@ class CostDetailValidate extends Validate {
'type'
=>
'require|number|in:0,1,2'
,
'setting_date'
=>
'require'
,
'district_id'
=>
'require|number|gt:0'
,
];
protected
$message
=
[
...
...
@@ -24,11 +27,16 @@ class CostDetailValidate extends Validate {
'setting_date.require'
=>
'时间为必填字段'
,
'district_id.require'
=>
'store_id为必填字段'
,
'district_id.number'
=>
'store_id只能为数字'
,
'district_id.gt'
=>
'store_id必须大于0'
,
];
protected
$scene
=
[
'getCostInfo'
=>
[
'id'
,
'type'
],
'getMyCostDetailList'
=>
[
'store_id'
,
'setting_date'
],
'getAllStoreCost'
=>
[
'district_id'
],
];
}
\ No newline at end of file
application/model/FStoreCost.php
View file @
396da28a
...
...
@@ -105,4 +105,15 @@ class FStoreCost extends BaseModel
->
where
(
$where
)
->
sum
(
$field
);
}
public
function
getAllStoreCost
(
$field
,
$where
)
{
$where
[
'a.status'
]
=
0
;
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_store b'
,
'a.store_id=b.id'
,
'left'
)
->
join
(
'a_district c'
,
'b.district_id=c.id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
}
application/route.php
View file @
396da28a
...
...
@@ -542,7 +542,7 @@ Route::group('index', [
'getCostDetailList'
=>
[
'index/CostDetail/getCostDetailList'
,
[
'method'
=>
'POST|GET'
]],
'getCostDetailListExcel'
=>
[
'index/CostDetail/getCostDetailListExcel'
,
[
'method'
=>
'POST|GET'
]],
'get
MyCostDetailList'
=>
[
'index/CostDetail/getMyCostDetailLi
st'
,
[
'method'
=>
'POST|GET'
]],
'get
AllStoreCost'
=>
[
'index/CostDetail/getAllStoreCo
st'
,
[
'method'
=>
'POST|GET'
]],
'getCostInfo'
=>
[
'index/CostDetail/getCostInfo'
,
[
'method'
=>
'POST|GET'
]],
'addApplyFor'
=>
[
'index/StoreFee/addApplyFor'
,
[
'method'
=>
'POST'
]],
//新增报销申请
...
...
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