File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public function __construct()
38
38
public function handle (ApiExcelEvent $ event )
39
39
{
40
40
// 获取事件中保存的数据
41
+ // $data = ['id' => 6, 'state' => 1, 'upload_url' => '/storage/20190318_103542_5c8f03fe14d89.xlsx'];
41
42
$ data = $ event ->getData ();
42
43
// 根据状态处理数据
43
44
switch ($ data ['state ' ]) {
@@ -46,13 +47,12 @@ public function handle(ApiExcelEvent $event)
46
47
$ path = public_path ($ data ['upload_url ' ]);
47
48
if ($ data ['state ' ] == 1 && file_exists ($ path )) {
48
49
// 获取 appkey 和 url
49
- $ apiExcel = ApiExcel::findOrFail ($ data ['id ' ]);
50
- $ param = $ apiExcel ->apiParam ()->get ();
50
+ $ apiExcel = ApiExcel::find ($ data ['id ' ]);
51
+ $ param = $ apiExcel ->apiParam ()->first ();
51
52
if ($ param ) {
52
- $ param = $ param [0 ];
53
53
$ multi = MultithreadingRepository::getInstent ();
54
- $ multi ->setParam ($ path , ['concurrent ' => $ apiExcel[ ' concurrent ' ] ]);
55
- $ result = $ multi ->newMultiRequest ($ param[ ' url ' ] , $ data [ ' appkey ' ] );
54
+ $ multi ->setParam ($ path , ['concurrent ' => $ apiExcel-> concurrent ]);
55
+ $ result = $ multi ->newMultiRequest ($ param-> url , $ apiExcel -> appkey );
56
56
57
57
ksort ($ result );
58
58
You can’t perform that action at this time.
0 commit comments