修改活动专区商品排序

This commit is contained in:
lewis 2024-12-27 11:31:54 +08:00
parent bebbd7083d
commit 69030f1fbc

View File

@ -126,7 +126,7 @@ class ActivityZoneFormLogic extends BaseLogic
$service = new ActivityZoneService();
$activityZoneForm = ActivityZoneForm::findOrEmpty($params['id'])->toArray();
$productIds = ActivityZone::where('form_id', $params['id'])->column('product_id');
$products = StoreProduct::field('id,unit,store_name,two_cate_id')->whereIn('id', $productIds)->order('two_cate_id')->select()->toArray();
$products = StoreProduct::field('id,unit,store_name,two_cate_id')->whereIn('id', $productIds)->order('two_cate_id asc,cate_id asc')->select()->toArray();
$unitIds = array_unique(array_column($products, 'unit'));
$cateIds = array_unique(array_column($products, 'two_cate_id'));
$unit = StoreProductUnit::whereIn('id', $unitIds)->field('id,name')->withTrashed()->select()->toArray();