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
32a46a60
Commit
32a46a60
authored
Jul 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
99058dda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
22 deletions
+29
-22
CostDetail.php
application/index/controller/CostDetail.php
+9
-10
CostParameter.php
application/index/controller/CostParameter.php
+1
-3
CostDetailValidate.php
application/index/validate/CostDetailValidate.php
+16
-9
route.php
application/route.php
+3
-0
No files found.
application/index/controller/CostDetail.php
View file @
32a46a60
...
...
@@ -440,15 +440,18 @@ class CostDetail extends Basic
/* $params = array(
);*/
$checkResult
=
$this
->
validate
(
$params
,
"CostDetailValidate.getMyCostDetailList"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$conditions
=
[];
//计入月份
if
(
!
empty
(
$params
[
"setting_date"
]))
{
$conditions
[
"b.setting_date"
]
=
$params
[
"setting_date"
];
}
$conditions
[
"b.setting_date"
]
=
$params
[
"setting_date"
];
//门店id
if
(
!
empty
(
$params
[
'store_id'
]))
{
$conditions
[
"b.store_id"
]
=
$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'
;
...
...
@@ -463,11 +466,7 @@ class CostDetail extends Basic
$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
);
}
...
...
application/index/controller/CostParameter.php
View file @
32a46a60
...
...
@@ -188,8 +188,7 @@ class CostParameter extends Basic
$f_params
[
'store_id'
]
=
$params
[
'store_id'
];
$f_params
[
'setting_date'
]
=
$params
[
'setting_date'
];
$store_data_res
=
$this
->
m_store_data
->
findByOne
(
'id'
,
$params
);
$store_data_res
=
$this
->
m_store_data
->
findByOne
(
'id'
,
$f_params
);
if
(
$store_data_res
)
{
//修改
$this
->
updateStoreData
(
$store_data_res
[
'id'
],
$params
);
}
else
{
//新增
...
...
@@ -264,7 +263,6 @@ class CostParameter extends Basic
if
((
isset
(
$params
[
'deduct'
]))
&&
(
$params
[
'deduct'
]
>
0
))
$data
[
'deduct'
]
=
$params
[
'deduct'
];
$res
=
$this
->
m_store_data
->
updateStoreData
(
$data
);
return
$res
;
}
...
...
application/index/validate/CostDetailValidate.php
View file @
32a46a60
...
...
@@ -7,22 +7,28 @@ class CostDetailValidate extends Validate {
protected
$rule
=
[
'id'
=>
'require|number|gt:0'
,
'type'
=>
'require|number|in:0,1,2'
,
'store_id'
=>
'require|number|gt:0'
,
'type'
=>
'require|number|in:0,1,2'
,
'setting_date'
=>
'require'
,
];
protected
$message
=
[
'id.require'
=>
'id为必填字段'
,
'id.number'
=>
'id只能为数字'
,
'id.gt'
=>
'id必须大于0'
,
'store_id.require'
=>
'store_id为必填字段'
,
'store_id.number'
=>
'store_id只能为数字'
,
'store_id.gt'
=>
'store_id必须大于0'
,
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'type.in'
=>
'type范围错误'
,
'setting_date.require'
=>
'时间为必填字段'
,
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'type.in'
=>
'type范围错误'
,
];
protected
$scene
=
[
'getCostInfo'
=>
[
'id'
,
'type'
],
'getCostInfo'
=>
[
'id'
,
'type'
],
'getMyCostDetailList'
=>
[
'store_id'
,
'setting_date'
],
];
}
\ No newline at end of file
application/route.php
View file @
32a46a60
...
...
@@ -541,6 +541,9 @@ Route::group('index', [
'delStoreFeeImage'
=>
[
'index/StoreFee/delStoreFeeImage'
,
[
'method'
=>
'POST'
]],
//删除图片
'getCostDetailList'
=>
[
'index/CostDetail/getCostDetailList'
,
[
'method'
=>
'POST|GET'
]],
'getCostDetailListExcel'
=>
[
'index/CostDetail/getCostDetailListExcel'
,
[
'method'
=>
'POST|GET'
]],
'getMyCostDetailList'
=>
[
'index/CostDetail/getMyCostDetailList'
,
[
'method'
=>
'POST|GET'
]],
'getCostInfo'
=>
[
'index/CostDetail/getCostInfo'
,
[
'method'
=>
'POST|GET'
]],
'addApplyFor'
=>
[
'index/StoreFee/addApplyFor'
,
[
'method'
=>
'POST'
]],
//新增报销申请
'editApplyFor'
=>
[
'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