Обновление 1.0
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Resources\ArchiveInfoResource;
|
||||
use App\Models\ArchiveInfo;
|
||||
use App\Models\Mis\SttMedicalHistory;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -35,4 +36,26 @@ class ArchiveInfoController extends Controller
|
||||
|
||||
return $hasCreated;
|
||||
}
|
||||
|
||||
public function check(Request $request)
|
||||
{
|
||||
$data = $request->validate([
|
||||
'id' => 'required',
|
||||
]);
|
||||
|
||||
$archive = ArchiveInfo::where('mis_history_id', $data['id'])
|
||||
->orWhere('foxpro_history_id', $data['id'])
|
||||
->first();
|
||||
|
||||
if (isset($archive)) {
|
||||
return response()->json([
|
||||
'id' => $archive->mis_history_id ?? $archive->foxpro_history_id,
|
||||
'type' => $archive->mis_history_id ? 'mis' : 'foxpro',
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Карты нет в архиве'
|
||||
])->setStatusCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user