Просмотр исходного кода

chore: auto bump version and changelog [skip ci]

iwt 3 месяцев назад
Родитель
Сommit
5e64ec5074

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityRegistrationService.java

@@ -115,7 +115,11 @@ public class ActivityRegistrationService {
         if (size == null || size < 1) size = 10;
         LambdaQueryWrapper<ActivityRegistration> wrapper = new LambdaQueryWrapper<>();
         if (userId != null) wrapper.eq(ActivityRegistration::getUserId, userId);
-        if (childId != null) wrapper.eq(ActivityRegistration::getChildId, childId);
+        if (childId != null) {
+            // 手动录入的报名 child_id 为 NULL,也属于该用户,需一并返回
+            wrapper.and(w -> w.eq(ActivityRegistration::getChildId, childId)
+                .or().isNull(ActivityRegistration::getChildId));
+        }
         wrapper.orderByDesc(ActivityRegistration::getRegisteredAt);
         Page<ActivityRegistration> pageResult = registrationMapper.selectPage(new Page<>(page, size), wrapper);
         List<Map<String, Object>> records = pageResult.getRecords().stream().map(reg -> {

+ 1 - 0
cfc-frontend/pages/activity/index.vue

@@ -62,6 +62,7 @@
             />
             <view class="card-info">
               <text class="card-title">{{ act.title }}</text>
+              <text class="card-meta" v-if="act.registrantName">报名人:{{ act.registrantName }}</text>
               <text class="card-meta">{{ act.startTime }}</text>
               <text class="card-meta" v-if="act.location">📍 {{ act.location }}</text>
               <view class="card-bottom">

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-e25de96a3b35e433c224fd593ee565b6eef9439d
+8e2b6420c6fe0d14c918895b02b8b9839c044143

+ 6 - 2
cfc-web/src/views/admin/ActivityRegistrationReview.vue

@@ -6,7 +6,7 @@
         <el-select v-model="activityId" placeholder="选择活动" @change="loadList" style="width: 200px;" clearable>
           <el-option v-for="a in activityList" :key="a.id" :label="a.title" :value="a.id" />
         </el-select>
-         <el-input v-model="keyword" placeholder="搜索用户/孩子ID..." prefix-icon="el-icon-search" style="width:200px" clearable @keyup.enter.native="loadList" @clear="loadList" />
+         <el-input v-model="keyword" placeholder="搜索报名人/手机号/用户ID..." prefix-icon="el-icon-search" style="width:220px" clearable @keyup.enter.native="loadList" @clear="loadList" />
          <el-select v-model="statusFilter" placeholder="状态筛选" @change="loadList" style="width: 130px;" clearable>
           <el-option label="全部状态" value="" />
           <el-option label="待审核" value="pending" />
@@ -21,6 +21,8 @@
       <el-table-column prop="id" label="ID" width="60" />
       <el-table-column prop="userId" label="用户ID" width="70" />
       <el-table-column prop="childId" label="孩子ID" width="70" />
+      <el-table-column prop="registrantName" label="报名人" width="100" />
+      <el-table-column prop="registrantPhone" label="手机号" width="120" />
       <el-table-column prop="status" label="状态" width="90">
         <template slot-scope="{ row }">
           <el-tag :type="row.status === 'approved' ? 'success' : row.status === 'rejected' ? 'danger' : 'warning'">
@@ -81,7 +83,9 @@ export default {
       var kw = this.keyword.toLowerCase()
       return this.list.filter(function(item) {
         return (item.userId && String(item.userId).includes(kw)) ||
-               (item.childId && String(item.childId).includes(kw))
+               (item.childId && String(item.childId).includes(kw)) ||
+               (item.registrantName && String(item.registrantName).toLowerCase().includes(kw)) ||
+               (item.registrantPhone && String(item.registrantPhone).includes(kw))
       })
     }
   },