add menu
This commit is contained in:
parent
63646dc011
commit
8933b14b9c
|
@ -4564,9 +4564,9 @@ def apitool(req):
|
|||
if req.GET.get('company'):
|
||||
objs = objs.filter(usecomp__partid=req.GET.get('company'))
|
||||
for i in objs:
|
||||
menulist = i.menulink.split(',')
|
||||
menulist = i.menulist
|
||||
menulist.append(menu)
|
||||
if menu == '30':
|
||||
if menu == 30:
|
||||
company = Partment.objects.get(partid=req.GET.get('company'))
|
||||
objs = Map.objects.filter(usecomp=company)
|
||||
if objs.exists():
|
||||
|
@ -4574,8 +4574,7 @@ def apitool(req):
|
|||
else:
|
||||
Map.objects.create(
|
||||
name='默认地图', pic='/static/safesite/mystatic/images/snc.jpg', usecomp=company, default=1)
|
||||
newlist = list(set(menulist))
|
||||
i.menulink = ','.join(newlist)
|
||||
i.menulist = list(set(menulist))
|
||||
i.save()
|
||||
return JsonResponse({"code": 1})
|
||||
elif a == 'correction':
|
||||
|
|
Loading…
Reference in New Issue