|
...
|
...
|
@@ -31,11 +31,21 @@ class ProductLogic extends BaseLogic |
|
|
|
foreach ($v['category_id'] as $category_id){
|
|
|
|
$v['category_id_text'][] =(new CategoryLogic())->getCacheInfo($category_id)['title']??'';
|
|
|
|
}
|
|
|
|
$v['category_id_text'] = array_filter($v['category_id_text']);
|
|
|
|
$v['category_id_text'] = Arr::arrToSet($v['category_id_text'], 'trim');
|
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getInfo($id)
|
|
|
|
{
|
|
|
|
$info = parent::getInfo($id);
|
|
|
|
foreach ($info['category_id'] as $category_id) {
|
|
|
|
$info['category_id_text'][] = (new CategoryLogic())->getCacheInfo($category_id)['title'] ?? '';
|
|
|
|
}
|
|
|
|
$info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function save($param){
|
|
|
|
//封面取第一个图片
|
|
|
|
$param['thumb'] = $param['gallery'][0] ?? '';
|
...
|
...
|
|