Commit 65b6587e authored by zhuwei's avatar zhuwei

1

parent ed4808a2
......@@ -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'])
{
dump($_upload_file);
dump($type);
dump($ext);
/**
*
* upload($_FILE['file'])
......
......@@ -580,18 +580,23 @@ class CostParameter extends Basic
*/
public function storeDataExcel()
{
header('Access-Control-Allow-Origin:*');
// header('Access-Control-Allow-Origin:*');
set_time_limit(0);
$params = $this->params;
if(!checkTimeData($params['setting_date'])){
return $this->response("101", '非法时间');
}
$file = $_FILES['file'];
$type = request()->param('type');
// $file = $_FILES['file'];
// $type = request()->param('type');
dump($_FILES);
// $uploadFileService = new UploadFileService();
$file = $_FILES['excel_import'];
$type = $params['type']; //excel_import
$uploadFileService = new UploadFileService();
$uploadResult = $uploadFileService->upload($file, $type, 15000000, ['xls', 'xlsx']);
if ($uploadResult["code"] == 200) {
$path = $_FILES['excel']['tmp_name'];
$path = $_FILES['excel_import']['tmp_name'];
$result = $this->saveExcelData($path,$params['setting_date']);
if ($result["code"] == 200) {
return $this->response("200", "excel导入成功");
......@@ -615,6 +620,11 @@ class CostParameter extends Basic
if(!$list)
return ["code"=>101,"msg"=> "空excel"];
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.setting_date'] = $setting_date;
$f_params['c.is_del'] = 0;
......
......@@ -473,6 +473,7 @@ class AStore extends BaseModel
->join('f_office b', 'a.office_id = b.id', 'left')
->where($params)
->find();
dump($this->getLastSql());
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