xjconline преди 1 месец
родител
ревизия
2b0988cfd5
променени са 6 файла, в които са добавени 32 реда и са изтрити 0 реда
  1. 1 0
      src/common/models.py
  2. 8 0
      src/manage/controls.py
  3. 1 0
      src/manage/urls_backstage.py
  4. 19 0
      src/manage/views.py
  5. 3 0
      src/weixin/controls.py
  6. BIN
      templates/wzb/wanzhubei.apk

+ 1 - 0
src/common/models.py

@@ -30,6 +30,7 @@ class UserInfo(models.Model):
     unionid = models.CharField(u"微信unionid", max_length=64, blank=True,null=True)
     app_openid = models.CharField(u"微信openid", max_length=64, blank=True,null=True)
     intro = models.TextField(u"用户简介", blank=True, null=True)
+    forbid_status = models.SmallIntegerField(u"1/forbid,0/unforbid",default=0)
 
     ctime = models.DateTimeField(u"创建时间", auto_now_add=True)
 

+ 8 - 0
src/manage/controls.py

@@ -1455,3 +1455,11 @@ def get_stock_list(**kwargs):
         return len(data),data
 
 
+
+def signup_forbid(**kwargs):
+    """
+    """
+    _id = kwargs.get("id")
+    forbid_status = 1-cm.UserInfo.objects.filter(id=_id).first().forbid_status
+    cm.UserInfo.objects.filter(id=_id).update(forbid_status=forbid_status)
+

+ 1 - 0
src/manage/urls_backstage.py

@@ -72,6 +72,7 @@ urlpatterns = [
     url(r'^article/spider$', views.ArticleSpiderView.as_view()),
     url(r'^player/record/download/top3img$', views.DownloadTop3ImageView.as_view()),
     url(r'^stock/updateUserStock$', views.UpdateUserStockView.as_view()),
+    url(r'^user/signup/forbid$', views.SignupForbidView.as_view()),
 
 ]
 

+ 19 - 0
src/manage/views.py

@@ -1974,3 +1974,22 @@ class UpdateUserStockView(cv.AdminView):
         except Exception as e:
             cv.tracefail()
             return cv.to_fail(e)
+
+
+class SignupForbidView(cv.AdminView):
+    def put(self,request):
+        """#forbid signup(平台管理后台)
+        @id:"1"
+        """
+        qdata = request.json
+        need_params = ["id"]
+        mse = ccf.check_params(*need_params,**qdata)
+        if mse:
+            raise ce.TipException(mse)
+        try:
+            vals = ccf.get_need_params(*need_params,**qdata)
+            rst = ctl.signup_forbid(**vals)
+            return cv.to_suc(rst)
+        except Exception as e:
+            cv.tracefail()
+            return cv.to_fail(e)

+ 3 - 0
src/weixin/controls.py

@@ -2169,6 +2169,9 @@ def do_wx_pay(request):
     pay_type = qdata.get("pay_type")
     opmode_group = qdata.get("opmode_group")
 
+    if user.get("forbid_status") == 1:
+        raise ce.TipException(u"您暂时不能报名,请联系客服!")
+
     if not signup_name:
         signup_name = user_name
 

BIN
templates/wzb/wanzhubei.apk