Ver Fonte

修改配件

dongxiaoqin há 11 meses atrás
pai
commit
2b244cbe4e

+ 1 - 1
app/common/model/works/ServiceWorkSpare.php

@@ -32,7 +32,7 @@ class ServiceWorkSpare extends BaseModel
         'spare_parts' =>  'array'
     ];
 
-    public static function getLists($service_work_id, $type) {
+    public static function getLists($service_work_id, $type = null) {
         $where = [];
         //商城工单配件
         if ($type == 1) {

+ 1 - 2
app/workerapi/lists/ServiceWorkSparePartLists.php

@@ -58,8 +58,7 @@ class ServiceWorkSparePartLists extends BaseWorkerDataLists implements ListsSear
         $id = ServiceWork::where($this->searchWhere)->value('id');
         $spare_parts = [];
         if($id){
-            $spare_parts['spare_parts'] = ServiceWorkSpare::getLists($id, 1);
-            $spare_parts['self_spare_parts'] = ServiceWorkSpare::getLists($id, 2);
+            $spare_parts = ServiceWorkSpare::getLists($id);
         }
         return $spare_parts?array_values($spare_parts):[];
     }