refactor: 修改产品购买链接分页接口
This commit is contained in:
@@ -47,11 +47,7 @@ class ProductPurchaseLink
|
|||||||
'pd.id',
|
'pd.id',
|
||||||
'pd.spu',
|
'pd.spu',
|
||||||
'pd.name',
|
'pd.name',
|
||||||
'CASE WHEN pd.is_show = 0 THEN "已下架" WHEN pd.is_show = 1 THEN "已上架" END' => 'is_show',
|
'CASE WHEN pd.is_show = 0 THEN "已下架" WHEN pd.is_show = 1 THEN "已上架" END' => 'is_show'
|
||||||
'pf.id' => 'platform_id',
|
|
||||||
'pf.platform' => 'platform_name',
|
|
||||||
'min(pl.id)' => 'link_id',
|
|
||||||
'pl.link'
|
|
||||||
])
|
])
|
||||||
->leftJoin('product_purchase_link pl', 'pl.product_id = pd.id')
|
->leftJoin('product_purchase_link pl', 'pl.product_id = pd.id')
|
||||||
->leftJoin('product_purchase_platform pf', 'pf.id = pl.platform_id')
|
->leftJoin('product_purchase_platform pf', 'pf.id = pl.platform_id')
|
||||||
@@ -86,7 +82,6 @@ class ProductPurchaseLink
|
|||||||
->join('product_purchase_platform pf', 'pf.id = pl.platform_id')
|
->join('product_purchase_platform pf', 'pf.id = pl.platform_id')
|
||||||
->where('pl.language_id', '=', request()->lang_id)
|
->where('pl.language_id', '=', request()->lang_id)
|
||||||
->where('pl.product_id', 'in', array_column($links->items(), 'id'))
|
->where('pl.product_id', 'in', array_column($links->items(), 'id'))
|
||||||
->where('pl.id', 'not in', array_column($links->items(), 'link_id'))
|
|
||||||
->select();
|
->select();
|
||||||
if (!$others->isEmpty()) {
|
if (!$others->isEmpty()) {
|
||||||
$others_map = [];
|
$others_map = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user