|
|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Customer;
|
|
|
|
|
|
|
|
|
|
use App\Models\Area;
|
|
|
|
|
use App\Models\Balance;
|
|
|
|
|
use App\Models\Building;
|
|
|
|
|
use App\Models\Factor;
|
|
|
|
|
@ -90,30 +91,32 @@ class OrdersController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
$buildings = (new Building())->where("project_id", $id)->with(["areas" => function ($query) {
|
|
|
|
|
$query->select("id","building_id","name","myindex")->orderBy("myindex");
|
|
|
|
|
}])->select("id","name","myindex")->orderBy("myindex")->get();
|
|
|
|
|
}])->select("id","project_id","name","myindex")->orderBy("myindex")->get();
|
|
|
|
|
return response()->json($buildings->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/customer/get-beds-by-project/{id}",
|
|
|
|
|
* summary="获取医院床位",
|
|
|
|
|
* description="获取医院床位",
|
|
|
|
|
* path="/customer/get-beds-by-area/{id}",
|
|
|
|
|
* summary="V2-根据病区获取病床",
|
|
|
|
|
* description="根据病区获取病床",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="project id"),
|
|
|
|
|
* @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="area id"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="获取医院床位"
|
|
|
|
|
* description="根据病区获取病床"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getBedsByProject($id)
|
|
|
|
|
public function getBedsByArea($id)
|
|
|
|
|
{
|
|
|
|
|
$buildings = (new Building())->where("project_id", $id)->with(["areas" => function ($query) {
|
|
|
|
|
$query->with("beds");
|
|
|
|
|
}])->get();
|
|
|
|
|
return response()->json($buildings->toArray());
|
|
|
|
|
$area = (new Area())->with(["beds"=>function($query) {
|
|
|
|
|
$query->with(["room"=>function($query) {
|
|
|
|
|
$query->select("id","name");
|
|
|
|
|
}])->select("id","name","area_id","room_id");
|
|
|
|
|
}])->first();
|
|
|
|
|
return response()->json($area->beds->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|