This commit is contained in:
18631081161 2025-12-20 18:40:00 +08:00
parent 55bee29a4d
commit 84498e415b
2 changed files with 12 additions and 1 deletions

View File

@ -78,10 +78,13 @@
<el-table-column label="服务项目" min-width="160" show-overflow-tooltip> <el-table-column label="服务项目" min-width="160" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<div class="service-info"> <div class="service-info">
<span class="service-name">{{ row.service?.titleZh || '-' }}</span> <span class="service-name">{{ row.service?.titleZh || row.hotService?.name_zh || row.serviceType || '-' }}</span>
<el-tag size="small" type="info" v-if="row.service?.category"> <el-tag size="small" type="info" v-if="row.service?.category">
{{ row.service.category.nameZh }} {{ row.service.category.nameZh }}
</el-tag> </el-tag>
<el-tag size="small" type="warning" v-else-if="row.hotService">
热门服务
</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -1,4 +1,5 @@
const { Appointment, Service, User, Category } = require('../models'); const { Appointment, Service, User, Category } = require('../models');
const HotService = require('../models/HotService');
const { Op } = require('sequelize'); const { Op } = require('sequelize');
const logger = require('../config/logger'); const logger = require('../config/logger');
@ -61,6 +62,7 @@ const getAppointmentList = async (options = {}) => {
model: Service, model: Service,
as: 'service', as: 'service',
attributes: ['id', 'titleZh', 'titleEn', 'titlePt', 'image', 'price', 'categoryId'], attributes: ['id', 'titleZh', 'titleEn', 'titlePt', 'image', 'price', 'categoryId'],
required: false,
include: [ include: [
{ {
model: Category, model: Category,
@ -70,6 +72,12 @@ const getAppointmentList = async (options = {}) => {
}, },
], ],
}, },
{
model: HotService,
as: 'hotService',
attributes: ['id', 'name_zh', 'name_en', 'name_pt', 'image_url', 'service_type'],
required: false,
},
{ {
model: User, model: User,
as: 'user', as: 'user',