From b717bdbd9f9638c7a67db85438f8b1c43afff038 Mon Sep 17 00:00:00 2001 From: "LAPTOP-7SGDREK0\\shiweijun" <411582373@qq.com> Date: Thu, 20 Feb 2025 15:16:19 +0800 Subject: [PATCH] fix:material --- app/Service/Api/Material/MaterialService.php | 7 ++++--- sync/http/admin/auth.http | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Service/Api/Material/MaterialService.php b/app/Service/Api/Material/MaterialService.php index 7806fbc..75bb61d 100644 --- a/app/Service/Api/Material/MaterialService.php +++ b/app/Service/Api/Material/MaterialService.php @@ -38,12 +38,13 @@ class MaterialService extends BaseService{ ->where('is_del',MaterialCode::IS_NO_DEL) ->where('status',MaterialCode::ENABLE) ->when(!empty($name), function ($query) use ($name) { - $query->where('name', 'like', "$name%"); + $query->where('name', 'like', "%$name%"); }) ->when(!empty($kitchenId), function ($query) use ($kitchenId) { $query->where('kitchen_id', $kitchenId); }) - ->paginate($limit)->toArray(); + ->paginate($limit,['name','unit','standard']) + ->toArray(); return $this->return->success('success',$list); } @@ -106,7 +107,7 @@ class MaterialService extends BaseService{ $info = $this->MaterialApplication->getInfoById($id); $info->is_del = 2; if ($info->status == MaterialCode::ALL_OUT || $info->status == MaterialCode::PART_OUT) throw new ErrException("已进行出库"); - if (!$info->save()) throw new ErrException('申请删除失败'); + if (!$info->save()) throw new ErrException('材料有出库,申请删除失败'); return $this->return->success(); } diff --git a/sync/http/admin/auth.http b/sync/http/admin/auth.http index 13703f0..8c29162 100644 --- a/sync/http/admin/auth.http +++ b/sync/http/admin/auth.http @@ -428,6 +428,11 @@ GET {{host}}/api/dish/list?limit=10 content-type: application/json Authorization: Bearer {{admin_token}} +###厨师查看材料列表 +GET {{host}}/api/material/list?limit=10 +content-type: application/json +Authorization: Bearer {{admin_token}} + ### 厨师申请材料 POST {{host}}/api/material/application Content-Type: application/x-www-form-urlencoded