Эх сурвалжийг харах

编辑广告时增加设备筛选过滤

linhaohong 1 жил өмнө
parent
commit
7a1f10e9d7

+ 6 - 0
AdminController/CampaignController.py

@@ -315,6 +315,12 @@ class CampaignView(View):
                                                         "OpenScreenAdvertise")[0]
                 campaign.pad_image_url = pad_image_url
 
+            # 不包含设备和包含设备不能重复
+            if device_type_names and ex_device_type_names:
+                intersection = list(set(device_type_names).intersection(set(ex_device_type_names)))
+                if intersection:
+                    return response.json(10, "设备包含和设备不包含不能重复")
+
             # 更改轮播广告图片
             if banner_files:
                 for sort in sort_files: