fix: openapi 产品详情不输出links->platform问题
This commit is contained in:
@@ -83,7 +83,9 @@ class Product
|
||||
->hidden(['id', 'product_id']),
|
||||
// 关联购买链接
|
||||
'links' => fn($query) => $query->field(['product_id', 'platform_id', 'link'])
|
||||
->with(['platform' => fn($query) => $query->field(['id', 'platform'])])
|
||||
->with([
|
||||
'platforms' => fn($query) => $query->field(['id', 'platform'])
|
||||
])
|
||||
->hidden(['product_id', 'platform_id']),
|
||||
// 关联相关产品
|
||||
'related' => fn($query) => $query->field(['product_id', 'related_product_id'])
|
||||
@@ -110,7 +112,7 @@ class Product
|
||||
->bypk($id)
|
||||
->hidden(['category_id'])
|
||||
->find();
|
||||
|
||||
// dump($product);exit;
|
||||
// 处理封面图
|
||||
if (!empty($product['cover_image']) && !str_starts_with($product['cover_image'], 'http')) {
|
||||
$product['cover_image'] = image_domain_concat($product['cover_image']);
|
||||
|
||||
Reference in New Issue
Block a user