|
@@ -78,11 +78,16 @@ func (m *defaultAppsModel) Delete(ctx context.Context, id string) (int64, error)
|
|
|
func (m *defaultAppsModel) FindAll(ctx context.Context, teamId primitive. ObjectID, apptype string, keyword *string) ([]*Apps, error) {
|
|
|
var data []*Apps
|
|
|
|
|
|
+ k := ""
|
|
|
+ if keyword != nil {
|
|
|
+ k = *keyword
|
|
|
+ }
|
|
|
+
|
|
|
err := m.conn.Find(ctx, &data, bson.M{
|
|
|
"teamId": teamId,
|
|
|
"type": apptype,
|
|
|
"name": bson.M{
|
|
|
- "$regex": keyword, // 用你想要匹配的模式替换 searchPattern
|
|
|
+ "$regex": k, // 用你想要匹配的模式替换 searchPattern
|
|
|
"$options": "i", // 可选:i 表示不区分大小写
|
|
|
},
|
|
|
})
|