From 274b44fa5b934eace2fc6dbcdccbb96a032545d8 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期四, 24 八月 2023 11:18:38 +0800 Subject: [PATCH] fix --- model/client.go | 6 +++++- model/request/client.go | 2 +- docs/swagger.yaml | 4 +++- docs/docs.go | 2 +- docs/swagger.json | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index e7b3a29..e0aaaee 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -15235,7 +15235,7 @@ "type": "integer" }, "search_map": { - "description": "鎼滅储鏉′欢: map[string]interface{}{\"name\": \"xxx\"}; {\"name\": \"瀹㈡埛鍚嶇О\", \"phone\": \"鎵嬫満鍙风爜\", \"detail_address\":\"璇︾粏鍦板潃\", \"next_visit_time\":\"涓嬪洖鍥炶鏃ユ湡\", \"member_name\": \"閿�鍞礋璐d汉\", \"client_status\": \"瀹㈡埛鐘舵�乗", \"client_level\": \"閲嶈绾у埆\"}", + "description": "鎼滅储鏉′欢: map[string]interface{}{\"name\": \"xxx\"}; {\"name\": \"瀹㈡埛鍚嶇О\", \"phone\": \"鎵嬫満鍙风爜\", \"detail_address\":\"璇︾粏鍦板潃\", \"next_visit_time\":\"涓嬪洖鍥炶鏃ユ湡\", \"member_name\": \"閿�鍞礋璐d汉\", \"client_status\": \"瀹㈡埛鐘舵�乗", \"client_level\": \"閲嶈绾у埆\",\"legal_representative\": \"娉曞畾浠h〃浜篭", \"registration_time\": \"娉ㄥ唽鏃堕棿\", \"business_scope\": \"缁忚惀鑼冨洿\", \"remark\": \"澶囨敞\"}", "type": "object", "additionalProperties": true } diff --git a/docs/swagger.json b/docs/swagger.json index b107890..1bc71e6 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -15223,7 +15223,7 @@ "type": "integer" }, "search_map": { - "description": "鎼滅储鏉′欢: map[string]interface{}{\"name\": \"xxx\"}; {\"name\": \"瀹㈡埛鍚嶇О\", \"phone\": \"鎵嬫満鍙风爜\", \"detail_address\":\"璇︾粏鍦板潃\", \"next_visit_time\":\"涓嬪洖鍥炶鏃ユ湡\", \"member_name\": \"閿�鍞礋璐d汉\", \"client_status\": \"瀹㈡埛鐘舵�乗", \"client_level\": \"閲嶈绾у埆\"}", + "description": "鎼滅储鏉′欢: map[string]interface{}{\"name\": \"xxx\"}; {\"name\": \"瀹㈡埛鍚嶇О\", \"phone\": \"鎵嬫満鍙风爜\", \"detail_address\":\"璇︾粏鍦板潃\", \"next_visit_time\":\"涓嬪洖鍥炶鏃ユ湡\", \"member_name\": \"閿�鍞礋璐d汉\", \"client_status\": \"瀹㈡埛鐘舵�乗", \"client_level\": \"閲嶈绾у埆\",\"legal_representative\": \"娉曞畾浠h〃浜篭", \"registration_time\": \"娉ㄥ唽鏃堕棿\", \"business_scope\": \"缁忚惀鑼冨洿\", \"remark\": \"澶囨敞\"}", "type": "object", "additionalProperties": true } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 647faa9..67c7ecf 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -3444,7 +3444,9 @@ additionalProperties: true description: '鎼滅储鏉′欢: map[string]interface{}{"name": "xxx"}; {"name": "瀹㈡埛鍚嶇О", "phone": "鎵嬫満鍙风爜", "detail_address":"璇︾粏鍦板潃", "next_visit_time":"涓嬪洖鍥炶鏃ユ湡", "member_name": - "閿�鍞礋璐d汉", "client_status": "瀹㈡埛鐘舵��", "client_level": "閲嶈绾у埆"}' + "閿�鍞礋璐d汉", "client_status": "瀹㈡埛鐘舵��", "client_level": "閲嶈绾у埆","legal_representative": + "娉曞畾浠h〃浜�", "registration_time": "娉ㄥ唽鏃堕棿", "business_scope": "缁忚惀鑼冨洿", "remark": + "澶囨敞"}' type: object type: object request.GetContactList: diff --git a/model/client.go b/model/client.go index 084854d..3ecdfb6 100644 --- a/model/client.go +++ b/model/client.go @@ -74,7 +74,7 @@ for key, value := range slf.SearchMap { switch v := value.(type) { case string: - if key == "name" || key == "number" || key == "detail_address" { + if key == "name" || key == "number" || key == "detail_address" || key == "remark" { db = db.Where(key+" LIKE ?", "%"+v+"%") } @@ -112,6 +112,10 @@ db = db.Joins("Member").Where("Member.username LIKE ?", "%"+v+"%") } + if key == "legal_representative" || key == "registration_time" || key == "business_scope" { + db = db.Joins("Business").Where("Business."+key+" LIKE ?", "%"+v+"%") + } + case int: if key == "id" || key == "client_type_id" || key == "client_status_id" || key == "member_id" { db = db.Where(key+" = ?", v) diff --git a/model/request/client.go b/model/request/client.go index 540f3f3..437f2f6 100644 --- a/model/request/client.go +++ b/model/request/client.go @@ -31,7 +31,7 @@ type GetClientList struct { PageInfo - SearchMap map[string]interface{} `json:"search_map"` // 鎼滅储鏉′欢: map[string]interface{}{"name": "xxx"}; {"name": "瀹㈡埛鍚嶇О", "phone": "鎵嬫満鍙风爜", "detail_address":"璇︾粏鍦板潃", "next_visit_time":"涓嬪洖鍥炶鏃ユ湡", "member_name": "閿�鍞礋璐d汉", "client_status": "瀹㈡埛鐘舵��", "client_level": "閲嶈绾у埆"} + SearchMap map[string]interface{} `json:"search_map"` // 鎼滅储鏉′欢: map[string]interface{}{"name": "xxx"}; {"name": "瀹㈡埛鍚嶇О", "phone": "鎵嬫満鍙风爜", "detail_address":"璇︾粏鍦板潃", "next_visit_time":"涓嬪洖鍥炶鏃ユ湡", "member_name": "閿�鍞礋璐d汉", "client_status": "瀹㈡埛鐘舵��", "client_level": "閲嶈绾у埆","legal_representative": "娉曞畾浠h〃浜�", "registration_time": "娉ㄥ唽鏃堕棿", "business_scope": "缁忚惀鑼冨洿", "remark": "澶囨敞"} } type DeleteClient struct { -- Gitblit v1.8.0