Просмотр исходного кода

去除清洗的所有分类--配件

whitefang 1 год назад
Родитель
Сommit
77198776ec
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      app/workerapi/lists/SparePartLists.php

+ 4 - 0
app/workerapi/lists/SparePartLists.php

@@ -2,6 +2,7 @@
 namespace app\workerapi\lists;
 
 use app\common\lists\ListsSearchInterface;
+use app\common\model\goods_category\GoodsCategory;
 use app\common\model\spare_part\SparePart;
 
 
@@ -39,7 +40,10 @@ class SparePartLists extends BaseWorkerDataLists implements ListsSearchInterface
      */
     public function lists(): array
     {
+        //去除清洗的所有分类
+        $not_category_goods_ids = GoodsCategory::where('category_type',3)->column('id');
         return SparePart::where($this->searchWhere)
+            ->whereNotIn('goods_category_id',$not_category_goods_ids)
             ->field(['id', 'goods_category_id', 'spare_name', 'spare_image', 'spare_number', 'spare_unit', 'company_price', 'original_price', 'offering_price', 'spare_status'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])