Commit 5b5cfdad authored by clone's avatar clone

1

parent f111439e
......@@ -148,10 +148,11 @@ class StoreFeeService
* @param $count_time
* @param $office_id
* @param $status
* @param $source
* @return array
*/
private function applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, $status)
$bank, $card_no, $count_time, $office_id, $status, $source = 0)
{
$arr = [];
......@@ -191,6 +192,9 @@ class StoreFeeService
if ($status) {
$arr["status"] = $status;
}
if ($source) {
$arr["source"] = $source;
}
if ($count_time) {
$arr["count_time"] = $count_time;
} elseif ($id <= 0 && !$count_time) {
......@@ -712,11 +716,10 @@ class StoreFeeService
$reader->setReadDataOnly(true);
$spreadsheet = "";
try {
$spreadsheet = $reader->load($file_path);
$spreadsheet = $reader->load("static/excel/" . $file_path);
} catch (\Exception $exception) {
return "找不到文件路径";
}
$sheet = $spreadsheet->getActiveSheet();
$highestRow = $sheet->getHighestRow(); // 最大行数
$highestColumn = $sheet->getHighestColumn(); // 最大列数
......@@ -728,11 +731,20 @@ class StoreFeeService
}*/
$data = array();
for ($row = 0; $row <= $highestRow; $row++) {
$tempData['name'] = $sheet->getCellByColumnAndRow(1, $row)->getValue();
$tempData['chinese'] = $sheet->getCellByColumnAndRow(2, $row)->getValue();
$tempData['math'] = $sheet->getCellByColumnAndRow(3, $row)->getValue();
$tempData['English'] = $sheet->getCellByColumnAndRow(4, $row)->getValue();
$data[] = $tempData;
$type = $sheet->getCellByColumnAndRow(1, $row)->getValue();
$fee_item = $sheet->getCellByColumnAndRow(2, $row)->getValue();
$total_fee = $sheet->getCellByColumnAndRow(3, $row)->getValue();
$agent_id = $sheet->getCellByColumnAndRow(4, $row)->getValue();
$store_id = $sheet->getCellByColumnAndRow(5, $row)->getValue();
$purpose = $sheet->getCellByColumnAndRow(6, $row)->getValue();
$site_id = $sheet->getCellByColumnAndRow(7, $row)->getValue();
$card_name = $sheet->getCellByColumnAndRow(8, $row)->getValue();
$bank = $sheet->getCellByColumnAndRow(9, $row)->getValue();
$card_no = $sheet->getCellByColumnAndRow(10, $row)->getValue();
$count_time = $sheet->getCellByColumnAndRow(11, $row)->getValue();
$office_id = $sheet->getCellByColumnAndRow(12, $row)->getValue();
array_push($data, $this->applyForFeeBin($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, 0, 1, 1));
}
dump($data);
}
......
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