Commit 65b6587e authored by zhuwei's avatar zhuwei

1

parent ed4808a2
...@@ -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'])
......
...@@ -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;
......
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment