|
@@ -114,21 +114,14 @@ class TenantViewSet(CustomModelViewSet):
|
|
|
|
|
|
instance.status = status
|
|
instance.status = status
|
|
instance.reject_reason = reject_reason
|
|
instance.reject_reason = reject_reason
|
|
|
|
+
|
|
|
|
+ if not instance.wxapp_img:
|
|
|
|
+ applet = WechatApplet.objects.filter(authorizer_appid=settings.WEAPP['appid']).first()
|
|
|
|
+ filename = applet.getWXAppCode(instance.company_no)
|
|
|
|
+ instance.wxapp_img = "{0}{1}".format(settings.MEDIA_URL, filename)
|
|
instance.save()
|
|
instance.save()
|
|
BizLog.objects.addnew(None, request.user, BizLog.INSERT, u'审核企业[%s]状态为[%s],id=%d' % (instance.company_name, status, instance.id))
|
|
BizLog.objects.addnew(None, request.user, BizLog.INSERT, u'审核企业[%s]状态为[%s],id=%d' % (instance.company_name, status, instance.id))
|
|
|
|
|
|
- tenant = Tenant.objects.filter(id=pk).first()
|
|
|
|
- if tenant:
|
|
|
|
- company_no = tenant.company_no
|
|
|
|
- else:
|
|
|
|
- raise CustomError('获取企业信息失败,请刷新重试!')
|
|
|
|
- if not tenant.wxapp_img:
|
|
|
|
- applet = WechatApplet.objects.filter(authorizer_appid=settings.WEAPP['appid']).first()
|
|
|
|
- filename = applet.getWXAppCode(company_no)
|
|
|
|
- tenant.wxapp_img = "{0}{1}".format(settings.MEDIA_URL, filename)
|
|
|
|
- tenant.save()
|
|
|
|
-
|
|
|
|
- return response_ok(tenant.wxapp_img)
|
|
|
|
except CustomError as e:
|
|
except CustomError as e:
|
|
return response_error(e.get_error_msg())
|
|
return response_error(e.get_error_msg())
|
|
except Exception as e:
|
|
except Exception as e:
|