|
|
|
|
@ -8,7 +8,9 @@ use App\Customer;
|
|
|
|
|
use App\Events\OrderAssigned;
|
|
|
|
|
use App\Models\Approval;
|
|
|
|
|
use App\Models\ApprovalItems;
|
|
|
|
|
use App\Models\Area;
|
|
|
|
|
use App\Models\Balance;
|
|
|
|
|
use App\Models\Bed;
|
|
|
|
|
use App\Models\Building;
|
|
|
|
|
use App\Models\FactorItems;
|
|
|
|
|
use App\Models\ManagerProject;
|
|
|
|
|
@ -274,6 +276,60 @@ class OrdersController extends CommonController
|
|
|
|
|
return response()->json($order->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/manager/get-project-areas/{project_id}",
|
|
|
|
|
* summary="V2-获取医院病区",
|
|
|
|
|
* description="获取医院病区",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="path", @OA\Schema(type="integer"), required=true, description="project id"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="获取医院床位"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getProjectAreas($project_id)
|
|
|
|
|
{
|
|
|
|
|
$areas = (new Area())
|
|
|
|
|
->where("area.project_id", $project_id)
|
|
|
|
|
->select("area.id", "area.name", "area.building_id")
|
|
|
|
|
->leftJoin("building", "building.id", "=", "area.building_id")
|
|
|
|
|
->addSelect("building.name as building_name")
|
|
|
|
|
->orderBy("building.myindex")
|
|
|
|
|
->orderBy("area.myindex")
|
|
|
|
|
->get();
|
|
|
|
|
return response()->json($areas->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/customer/get-area-beds/{area_id}",
|
|
|
|
|
* summary="V2-根据病区获取病床",
|
|
|
|
|
* description="根据病区获取病床",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="area_id", in="path", @OA\Schema(type="integer"), required=true, description="area id"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="根据病区获取病床"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getAreaBeds($area_id)
|
|
|
|
|
{
|
|
|
|
|
$beds = (new Bed())
|
|
|
|
|
->where("bed.area_id", $area_id)
|
|
|
|
|
->select("bed.id", "bed.name", "bed.area_id", "bed.room_id")
|
|
|
|
|
->leftJoin("room", "room.id", "=", "bed.room_id")
|
|
|
|
|
->addSelect("room.name as room_name")
|
|
|
|
|
->orderBy("bed.name")
|
|
|
|
|
->get();
|
|
|
|
|
|
|
|
|
|
return response()->json($beds->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/manager/get-available-paramedics",
|
|
|
|
|
|