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
3f3e8284
Commit
3f3e8284
authored
Jul 25, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8595c221
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
CostParameter.php
application/index/controller/CostParameter.php
+15
-10
FStoreCostExt.php
application/model/FStoreCostExt.php
+1
-0
No files found.
application/index/controller/CostParameter.php
View file @
3f3e8284
...
...
@@ -369,7 +369,7 @@ class CostParameter extends Basic
/**
* 编辑
*
总部成本
编辑
* @return \think\Response
*/
public
function
editCompanyData
()
...
...
@@ -378,23 +378,28 @@ class CostParameter extends Basic
// $params = array(
// "type" => '1',
// "setting_date" => '2019-07-23',
// "save_json" => '[{"type":1},{"id":1}]',
// );
$checkResult
=
$this
->
validate
(
$params
,
"CostParameterValidate.editCompanyData"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$f_params
[
'type'
]
=
$params
[
'type'
];
$f_params
[
'setting_date'
]
=
$params
[
'setting_date'
];
$store_data_res
=
$this
->
m_company_data
->
findByOne
(
'id'
,
$params
);
if
(
$store_data_res
)
{
//修改
$this
->
updateCompanyData
(
$store_data_res
[
'id'
],
$params
);
}
else
{
//新增
$this
->
saveCompanyData
(
$params
);
if
(
!
checkTimeData
(
$params
[
'setting_date'
])){
return
$this
->
response
(
"101"
,
'非法时间'
);
}
$save_json
=
json_decode
(
$params
[
'save_json'
],
true
);
foreach
(
$save_json
as
$k
=>
$v
)
{
$f_params
[
'type'
]
=
$v
[
'type'
];
$f_params
[
'setting_date'
]
=
$params
[
'setting_date'
];
$store_data_res
=
$this
->
m_company_data
->
findByOne
(
'id'
,
$f_params
);
if
(
$store_data_res
)
{
//修改
$this
->
updateCompanyData
(
$store_data_res
[
'id'
],
$v
);
}
else
{
//新增
$this
->
saveCompanyData
(
$v
);
}
}
return
$this
->
response
(
"200"
,
"成功"
);
}
...
...
application/model/FStoreCostExt.php
View file @
3f3e8284
...
...
@@ -48,6 +48,7 @@ class FStoreCostExt extends BaseModel
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
echo
$this
->
getLastSql
();
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