|
@@ -6,6 +6,8 @@ use App\Base\BaseService;
|
|
use App\Models\Goods\Category;
|
|
use App\Models\Goods\Category;
|
|
use App\Models\Goods\Goods;
|
|
use App\Models\Goods\Goods;
|
|
use App\Models\Goods\GoodsCategoryMap;
|
|
use App\Models\Goods\GoodsCategoryMap;
|
|
|
|
+use App\Models\Goods\Spec;
|
|
|
|
+use App\Models\Goods\SpecAttr;
|
|
use App\Models\Setting;
|
|
use App\Models\Setting;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Support\Arr;
|
|
use Illuminate\Support\Arr;
|
|
@@ -94,6 +96,25 @@ class PageService extends BaseService
|
|
return array_merge($cids, $cidss, [$id]);
|
|
return array_merge($cids, $cidss, [$id]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function filterConfig($params)
|
|
|
|
+ {
|
|
|
|
+ $spec = Spec::whereIsCustom(0)->get();
|
|
|
|
+
|
|
|
|
+ return $spec->map(function (Spec $model) {
|
|
|
|
+ return [
|
|
|
|
+ "id" => $model->id,
|
|
|
|
+ "name" => $model->name,
|
|
|
|
+ "type" => "attr",
|
|
|
|
+ "child" => $model->attrs->map(function (SpecAttr $attr) {
|
|
|
|
+ return [
|
|
|
|
+ "id" => $attr->id,
|
|
|
|
+ "name" => $attr->name,
|
|
|
|
+ ];
|
|
|
|
+ }),
|
|
|
|
+ ];
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
public function categoryGoods($params)
|
|
public function categoryGoods($params)
|
|
{
|
|
{
|
|
$id = $params['id'];
|
|
$id = $params['id'];
|