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
65b6587e
Commit
65b6587e
authored
Aug 21, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ed4808a2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
UploadFileService.php
application/api_broker/service/UploadFileService.php
+3
-0
CostParameter.php
application/index/controller/CostParameter.php
+14
-4
AStore.php
application/model/AStore.php
+1
-0
No files found.
application/api_broker/service/UploadFileService.php
View file @
65b6587e
...
@@ -23,6 +23,9 @@ class UploadFileService
...
@@ -23,6 +23,9 @@ class UploadFileService
*/
*/
public
function
upload
(
$_upload_file
,
$type
,
$size
=
15000000
,
$ext
=
[
'jpg'
,
'png'
,
'jpeg'
,
'xlsx'
,
'doc'
,
'docx'
,
'pdf'
,
'ppt'
,
'pptx'
,
'xls'
,
'gif'
,
'mp4'
,
'video/mp4'
])
public
function
upload
(
$_upload_file
,
$type
,
$size
=
15000000
,
$ext
=
[
'jpg'
,
'png'
,
'jpeg'
,
'xlsx'
,
'doc'
,
'docx'
,
'pdf'
,
'ppt'
,
'pptx'
,
'xls'
,
'gif'
,
'mp4'
,
'video/mp4'
])
{
{
dump
(
$_upload_file
);
dump
(
$type
);
dump
(
$ext
);
/**
/**
*
*
* upload($_FILE['file'])
* upload($_FILE['file'])
...
...
application/index/controller/CostParameter.php
View file @
65b6587e
...
@@ -580,18 +580,23 @@ class CostParameter extends Basic
...
@@ -580,18 +580,23 @@ class CostParameter extends Basic
*/
*/
public
function
storeDataExcel
()
public
function
storeDataExcel
()
{
{
header
(
'Access-Control-Allow-Origin:*'
);
//
header('Access-Control-Allow-Origin:*');
set_time_limit
(
0
);
set_time_limit
(
0
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
checkTimeData
(
$params
[
'setting_date'
])){
if
(
!
checkTimeData
(
$params
[
'setting_date'
])){
return
$this
->
response
(
"101"
,
'非法时间'
);
return
$this
->
response
(
"101"
,
'非法时间'
);
}
}
$file
=
$_FILES
[
'file'
];
// $file = $_FILES['file'];
$type
=
request
()
->
param
(
'type'
);
// $type = request()->param('type');
dump
(
$_FILES
);
// $uploadFileService = new UploadFileService();
$file
=
$_FILES
[
'excel_import'
];
$type
=
$params
[
'type'
];
//excel_import
$uploadFileService
=
new
UploadFileService
();
$uploadFileService
=
new
UploadFileService
();
$uploadResult
=
$uploadFileService
->
upload
(
$file
,
$type
,
15000000
,
[
'xls'
,
'xlsx'
]);
$uploadResult
=
$uploadFileService
->
upload
(
$file
,
$type
,
15000000
,
[
'xls'
,
'xlsx'
]);
if
(
$uploadResult
[
"code"
]
==
200
)
{
if
(
$uploadResult
[
"code"
]
==
200
)
{
$path
=
$_FILES
[
'excel'
][
'tmp_name'
];
$path
=
$_FILES
[
'excel
_import
'
][
'tmp_name'
];
$result
=
$this
->
saveExcelData
(
$path
,
$params
[
'setting_date'
]);
$result
=
$this
->
saveExcelData
(
$path
,
$params
[
'setting_date'
]);
if
(
$result
[
"code"
]
==
200
)
{
if
(
$result
[
"code"
]
==
200
)
{
return
$this
->
response
(
"200"
,
"excel导入成功"
);
return
$this
->
response
(
"200"
,
"excel导入成功"
);
...
@@ -615,6 +620,11 @@ class CostParameter extends Basic
...
@@ -615,6 +620,11 @@ class CostParameter extends Basic
if
(
!
$list
)
if
(
!
$list
)
return
[
"code"
=>
101
,
"msg"
=>
"空excel"
];
return
[
"code"
=>
101
,
"msg"
=>
"空excel"
];
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
dump
(
$v
);
$is_office_store
=
$this
->
m_store
->
getStoreCost
(
"b.office_name"
,
[
"a.id"
=>
$v
[
'store_id'
]]);
dump
(
$is_office_store
);
exit
;
$f_params
[
'c.store_id'
]
=
$v
[
'id'
];
$f_params
[
'c.store_id'
]
=
$v
[
'id'
];
$f_params
[
'c.setting_date'
]
=
$setting_date
;
$f_params
[
'c.setting_date'
]
=
$setting_date
;
$f_params
[
'c.is_del'
]
=
0
;
$f_params
[
'c.is_del'
]
=
0
;
...
...
application/model/AStore.php
View file @
65b6587e
...
@@ -473,6 +473,7 @@ class AStore extends BaseModel
...
@@ -473,6 +473,7 @@ class AStore extends BaseModel
->
join
(
'f_office b'
,
'a.office_id = b.id'
,
'left'
)
->
join
(
'f_office b'
,
'a.office_id = b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
find
();
->
find
();
dump
(
$this
->
getLastSql
());
return
$result
;
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