|
|
|
@ -129,10 +129,11 @@ class OrdersController extends CommonController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @OA\Get(
|
|
|
|
* @OA\Get(
|
|
|
|
* path="/manager/get-orders",
|
|
|
|
* path="/manager/get-projcet-orders/{project_id}",
|
|
|
|
* summary="获取订单列表",
|
|
|
|
* summary="V2-获取订单列表",
|
|
|
|
* description="获取订单列表",
|
|
|
|
* description="获取订单列表",
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
* @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=false, description="医院ID"),
|
|
|
|
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=false, description="查询关键词"),
|
|
|
|
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=false, description="查询关键词"),
|
|
|
|
* @OA\Parameter(name="page", in="query", @OA\Schema(type="integer"), required=false, description="当前页码,默认为1"),
|
|
|
|
* @OA\Parameter(name="page", in="query", @OA\Schema(type="integer"), required=false, description="当前页码,默认为1"),
|
|
|
|
* @OA\Parameter(name="pageLength", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为5"),
|
|
|
|
* @OA\Parameter(name="pageLength", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为5"),
|
|
|
|
@ -181,22 +182,20 @@ class OrdersController extends CommonController
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 5;
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 5;
|
|
|
|
$data = $data
|
|
|
|
$data = $data
|
|
|
|
->with([
|
|
|
|
->with([
|
|
|
|
"project",
|
|
|
|
"patient" => function ($query) {
|
|
|
|
"product",
|
|
|
|
$query->select("id", "customer_id", "name", "sex", "age");
|
|
|
|
"customer",
|
|
|
|
},
|
|
|
|
"manager",
|
|
|
|
|
|
|
|
"patient",
|
|
|
|
|
|
|
|
"productItem",
|
|
|
|
"productItem",
|
|
|
|
"productParamedicLevel",
|
|
|
|
"productParamedicLevel",
|
|
|
|
"bed" => function ($query) {
|
|
|
|
"bed" => function ($query) {
|
|
|
|
$query->with(["room", "building"]);
|
|
|
|
$query->with(["room", "building"])->select("id", "room_id", "building_id");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"paramedic",
|
|
|
|
"paramedic" => function ($query) {
|
|
|
|
"handlingApprovalItem" => function ($query) {
|
|
|
|
$query->select();
|
|
|
|
$query->with("approval");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->orderBy("id", "desc")
|
|
|
|
->orderBy("id", "desc")
|
|
|
|
|
|
|
|
->select("id", "serial", "customer_id", "patient_id", "project_id", "product_id", "manager_id", "from_date", "to_date", "remark", "status", "contact", "mobile", "price", "patient_quantity")
|
|
|
|
->paginate($pageLength);
|
|
|
|
->paginate($pageLength);
|
|
|
|
foreach ($data as $order) {
|
|
|
|
foreach ($data as $order) {
|
|
|
|
$order = $order->refreshTotal();
|
|
|
|
$order = $order->refreshTotal();
|
|
|
|
|