['in', $goodsIds]]; $status > 0 && $filter['goods_status'] = $status; if (!empty($goodsIds)) { $this->orderRaw('field(goods_id, ' . implode(',', $goodsIds) . ')'); } // 获取商品列表数据 return $this->with(['category', 'image.file', 'sku', 'spec_rel.spec', 'delivery.rule']) ->where($filter) ->select(); } }