作者 赵彬吉

update

... ... @@ -34,6 +34,9 @@ class ProductController extends BaseController
$ids = CategoryRelated::where('cate_id', $this->param['category_id'])->pluck('product_id')->toArray();
$map[] = ['id', 'in', $ids];
}
if(!empty($this->param['status'])){
$map[] = ['status', $this->param['status']];
}
$sort = ['id' => 'desc'];
$data = $logic->getList($map, $sort, ['id', 'title', 'thumb', 'category_id', 'keywords', 'status', 'created_at', 'updated_at']);
return $this->success($data);
... ...
... ... @@ -32,6 +32,7 @@ class ProductLogic extends BaseLogic
$v['category_id_text'][] =(new CategoryLogic())->getCacheInfo($category_id)['title']??'';
}
$v['category_id_text'] = Arr::arrToSet($v['category_id_text'], 'trim');
$v['status_text'] = Product::statusMap()[$v['status']] ?? '';
}
return $this->success($data);
}
... ... @@ -43,6 +44,7 @@ class ProductLogic extends BaseLogic
$info['category_id_text'][] = (new CategoryLogic())->getCacheInfo($category_id)['title'] ?? '';
}
$info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
$info['status_text'] = Product::statusMap()[$info['status']] ?? '';
return $this->success($info);
}
... ...