Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 20 |
| ExcelController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 8 |
90.00 | |
0.00% |
0 / 20 |
| index | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| create | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| store | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| makeExcel | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 13 |
|||
| show | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| edit | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| update | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| destroy | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Exports\GoodsNeateningExcelExport; | |
| use App\GoodsNeateningExcel; | |
| use Carbon\Carbon; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Support\Facades\Storage; | |
| use Maatwebsite\Excel\Facades\Excel; | |
| use function foo\func; | |
| class ExcelController extends Controller | |
| { | |
| /** | |
| * Display a listing of the resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function index() | |
| { | |
| } | |
| /** | |
| * Show the form for creating a new resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function create() | |
| { | |
| } | |
| /** | |
| * Store a newly created resource in storage. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function store(Request $request) | |
| { | |
| // | |
| } | |
| public function makeExcel() | |
| { | |
| ini_set('memory_limit', '512M'); | |
| $goodsesExcelArray=[['barcode','weight','id','key','time','url']]; | |
| $handler=fopen('d:/newdws10.json','r'); | |
| $json = fread($handler, filesize('d:/newdws10.json')); | |
| $json = '[' . $json . ']'; | |
| $jsonArr=json_decode($json,true); | |
| foreach ($jsonArr as $obj){ | |
| $url = $obj['url']??''; | |
| $barcode=$obj['barcode'].' '; | |
| array_push($goodsesExcelArray,[$barcode,$obj['weight'],$obj['id'].' ' | |
| ,$obj['key'],$obj['time'], $url]); | |
| } | |
| Excel::store(new GoodsNeateningExcelExport($goodsesExcelArray),'exportedJson.xlsx','public'); | |
| return ['result'=>'success']; | |
| } | |
| /** | |
| * Display the specified resource. | |
| * | |
| * @param \App\GoodsNeateningExcel $goodsNeateningExcel | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function show(GoodsNeateningExcel $goodsNeateningExcel) | |
| { | |
| // | |
| } | |
| /** | |
| * Show the form for editing the specified resource. | |
| * | |
| * @param \App\GoodsNeateningExcel $goodsNeateningExcel | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function edit(GoodsNeateningExcel $goodsNeateningExcel) | |
| { | |
| // | |
| } | |
| /** | |
| * Update the specified resource in storage. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @param \App\GoodsNeateningExcel $goodsNeateningExcel | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function update(Request $request, GoodsNeateningExcel $goodsNeateningExcel) | |
| { | |
| // | |
| } | |
| /** | |
| * Remove the specified resource from storage. | |
| * | |
| * @param \App\GoodsNeateningExcel $goodsNeateningExcel | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function destroy(GoodsNeateningExcel $goodsNeateningExcel) | |
| { | |
| // | |
| } | |
| } |