Skip to content

Commit c9a8e7a

Browse files
committed
fix: 根据 api_excel_id 获取完成率
1 parent f4d909e commit c9a8e7a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

laravel/app/Services/WebSocketService.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ public function outJson($code = 200, $data = [], $reason = 'success')
105105
return json_encode(['code' => $code, 'reason' => $reason, 'data' => $data], JSON_UNESCAPED_UNICODE);
106106
}
107107

108+
109+
/**
110+
* 根据 api_excel_id 获取完成率
111+
*
112+
* @param $id
113+
*
114+
* @return array
115+
*/
116+
protected function getRateById($id)
117+
{
118+
$rate = '100';
119+
if ($id && $id == floor($id)) {
120+
// 3. 输出完成率
121+
$rate = MultithreadingRepository::getInstent()->completionRate($id);
122+
}
123+
return $this->outJson(200, ['rate' => $rate]);
124+
}
125+
108126
/**
109127
* 获取api_excel 列表-完成率
110128
*

0 commit comments

Comments
 (0)