调整套餐对比接口数据格式

wenjuan
yanzai 1 year ago
parent 290284b181
commit 61ba6a1fb5

@ -351,6 +351,24 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$count = DB::table('orders')->where(['combo_id' => $combo->combo_id])->whereIn('status', [2, 4])->count(); $count = DB::table('orders')->where(['combo_id' => $combo->combo_id])->whereIn('status', [2, 4])->count();
$combo->saleCount = $count; $combo->saleCount = $count;
} }
foreach ($combos as $key => $combo) {
$tags = json_decode($combo->tags, true);
$combo->tags2 = json_decode($combo->tags2, true);
foreach ($tags as $k => $tag) {
$tags[$k] = ['text' => $tag,
'text_color' => '#47ABD8',
'color' => '#EBF5FC'
];
}
$combo->tags = $tags;
$combo->tags[] = [
'text' => $combo->item_count . '个项目',
'text_color' => '#34C292',
'color' => '#E9F8F3',
];
}
return \Yz::Return(true, "查询完成", ['list' => $combos]); return \Yz::Return(true, "查询完成", ['list' => $combos]);
} }

@ -260,7 +260,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">09291029</view> <view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10061457</view>
</view> </view>
</view> </view>
</template> </template>

Loading…
Cancel
Save