Browse Source

fix:根据验收类型获取

super-yimizi 1 month ago
parent
commit
5ad9fd340d

+ 2 - 2
application/api/controller/inspection/Index.php

@@ -17,11 +17,11 @@ class Index extends Base
      public function getOptions()
      {
         //  查询验货类型的 
-        $inspectId= $this->request->param('inspect_type_id');
+        $inspectId= $this->request->param('inspection_type_id');
         if(intval($inspectId) <= 0){
             $this->error('验货类型ID不能为空');
         }
-        $params['inspect_type_id'] = $inspectId;
+        $params['inspection_type_id'] = $inspectId;
         $params = [
             'status' => StatusEnum::ENABLED,
         ];

+ 2 - 2
application/common/Service/InspectService.php

@@ -40,9 +40,9 @@ class InspectService
             $where['name'] = ['like', '%' . $params['name'] . '%'];
         }
 
-        if (isset($params['inspect_type_id']) && $params['inspect_type_id'] !== '') {
+        if (isset($params['inspection_type_id']) && $params['inspection_type_id'] !== '') {
             // 通过关联表查询ID
-            $typeItem = TypeItem::where('type_id', $params['inspect_type_id'])->select();
+            $typeItem = TypeItem::where('type_id', $params['inspection_type_id'])->select();
             $inspectIds = array_column( collection($typeItem)->toArray(), 'item_id');
             $where['id'] = ['in', $inspectIds];
         }