|
|
|
|
@ -143,7 +143,7 @@ class OrdersController extends CommonController
|
|
|
|
|
* @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="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="page_size", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为5"),
|
|
|
|
|
* @OA\Parameter(name="status", in="query", @OA\Schema(type="string"), required=false, description="订单状态:[unconfirmed=>待确认,unassigned=>待派单,ongoing=>进行中,finished=>已完成]"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
@ -186,7 +186,7 @@ class OrdersController extends CommonController
|
|
|
|
|
->ofProject($this->manager->projects->pluck("id")->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 5;
|
|
|
|
|
$page_size = request()->page_size ?? 5;
|
|
|
|
|
$data = $data
|
|
|
|
|
->with([
|
|
|
|
|
"patient" => function ($query) {
|
|
|
|
|
@ -203,7 +203,7 @@ class OrdersController extends CommonController
|
|
|
|
|
])
|
|
|
|
|
->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($page_size);
|
|
|
|
|
foreach ($data as $order) {
|
|
|
|
|
$order = $order->refreshTotal();
|
|
|
|
|
}
|
|
|
|
|
@ -298,11 +298,13 @@ class OrdersController extends CommonController
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/manager/get-paramedics",
|
|
|
|
|
* summary="获取护工",
|
|
|
|
|
* path="/manager/get-project-paramedics/{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="query", @OA\Schema(type="string"), required=true, description="项目/医院id"),
|
|
|
|
|
* @OA\Parameter(name="project_id", in="path", @OA\Schema(type="string"), required=true, description="医院id"),
|
|
|
|
|
* @OA\Parameter(name="page", in="query", @OA\Schema(type="integer"), required=false, description="当前页码,默认为1"),
|
|
|
|
|
* @OA\Parameter(name="page_size", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为5"),
|
|
|
|
|
* @OA\Parameter(name="has_ongoing_orders", in="query", @OA\Schema(type="integer"), required=false, description="是否空闲的筛选,枚举[0,1]"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
@ -311,9 +313,8 @@ class OrdersController extends CommonController
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getParamedics()
|
|
|
|
|
public function getProjectParamedics()
|
|
|
|
|
{
|
|
|
|
|
//todo:根据管理老师的管辖范围筛选
|
|
|
|
|
$paramedics = new Paramedic();
|
|
|
|
|
if (request()->keyword) {
|
|
|
|
|
$keyword = request()->keyword;
|
|
|
|
|
@ -335,7 +336,9 @@ class OrdersController extends CommonController
|
|
|
|
|
default:
|
|
|
|
|
//do nothing
|
|
|
|
|
}
|
|
|
|
|
$paramedics = $paramedics->withCount("ongoingOrders as ongoing_count")->orderBy("ongoing_count")->paginate(10);
|
|
|
|
|
|
|
|
|
|
$page_size = request()->page_size ?? 5;
|
|
|
|
|
$paramedics = $paramedics->withCount("ongoingOrders")->orderBy("ongoing_orders_count")->paginate($page_size);
|
|
|
|
|
return response()->json($paramedics->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|