|
...
|
...
|
@@ -31,7 +31,7 @@ class ProductLogic extends BaseLogic |
|
|
|
{
|
|
|
|
$data = parent::getList($map, $sort, $columns, $row);
|
|
|
|
foreach ($data['list'] as &$v){
|
|
|
|
// $v = $this->formatData($v);
|
|
|
|
$v = $this->formatData($v);
|
|
|
|
$v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一
|
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
...
|
...
|
@@ -53,14 +53,14 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
public function formatData($info){
|
|
|
|
foreach ($info['category_id'] as $category_id) {
|
|
|
|
$info['category_id_text'][] = (new CategoryLogic())->getCacheInfo($category_id)['title'] ?? '';
|
|
|
|
}
|
|
|
|
foreach ($info['keyword_id'] as $keyword_id){
|
|
|
|
$info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??'';
|
|
|
|
}
|
|
|
|
$info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
|
|
|
|
$info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim');
|
|
|
|
// foreach ($info['category_id'] as $category_id) {
|
|
|
|
// $info['category_id_text'][] = (new CategoryLogic())->getCacheInfo($category_id)['title'] ?? '';
|
|
|
|
// }
|
|
|
|
// foreach ($info['keyword_id'] as $keyword_id){
|
|
|
|
// $info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??'';
|
|
|
|
// }
|
|
|
|
// $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
|
|
|
|
// $info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim');
|
|
|
|
$info['status_text'] = Product::statusMap()[$info['status']] ?? '';
|
|
|
|
$info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? '';
|
|
|
|
$info['url'] = $this->getProjectDomain() . $info['route'] ;
|
...
|
...
|
|