Przeglądaj źródła

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

renzheng 9 lat temu
rodzic
commit
a1d118c19f

+ 109 - 0
common/src/qfw/util/credit/credit.go

@@ -0,0 +1,109 @@
+// 积分
+package credit
+
+import (
+	"fmt"
+	"qfw/util"
+	mogo "qfw/util/mongodb"
+	"qfw/util/rpc"
+	"strconv"
+	"strings"
+)
+
+var Rc rpc.RpcCall
+var Replay *int
+var CreditA map[string]uint64
+var SysConfig map[string]interface{}
+
+const (
+	A_ZC   = "a1" //注册
+	A_RZ   = "a2" //认证
+	A_CJMP = "a3" //创建名片
+	A_BYX  = "a4" //绑定邮箱
+	A_BSJ  = "a5" //绑定手机
+	A_SCMP = "a6" //收藏名片
+	A_SCFW = "a7" //收藏服务
+	A_SYJY = "a8" //使用剑鱼
+
+	B_QD   = "b1" //签到
+	B_FFW  = "b2" //发服务
+	B_FXQ  = "b3" //发需求
+	B_FXFW = "b4" //分享服务
+	C_JY   = "c1" //交易
+	C_PJ   = "c2" //评价
+	C_TG   = "c3" //推广用户
+
+	D_WXCZ  = "d1" //微信充值
+	E_EWMZR = "e1" //二维码转入
+	A_JY    = "A1" //剑鱼
+	A_ZZ    = "B1" //转赠
+)
+
+func init() {
+	util.ReadConfig(&SysConfig)
+	tmp := strings.Split(SysConfig["credit_a"].(string), ",")
+	CreditA = make(map[string]uint64)
+	for _, v := range tmp {
+		if len(v) > 1 {
+			n, _ := strconv.Atoi(v[1:])
+			CreditA[v] = uint64(n)
+		}
+	}
+
+	Rc = rpc.RpcCall{Addr: SysConfig["creditRpc"].(string)}
+}
+
+//一次性任务积分
+func InCreditA(userId, code string, credit_a int) (bool, int, error) {
+	result := false
+	if len(userId) < 1 {
+		return result, credit_a, nil
+	}
+	if !AIsHasDo(code, credit_a) {
+		param := make(map[string]interface{})
+		err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: 0, OtherParam: param}, Replay)
+		if err == nil {
+			result, credit_a = UpuserCreditA(code, userId, credit_a)
+		}
+		return result, credit_a, err
+	}
+	return result, credit_a, nil
+}
+
+//日常任务积分
+func InCreditB(userId, code string) (bool, error) {
+	b := false
+	if len(userId) < 1 {
+		return b, nil
+	}
+	param := make(map[string]interface{})
+	err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: 0, OtherParam: param}, Replay)
+	if err == nil {
+		b = true
+	}
+	return b, err
+}
+
+//更新用户一次性积分状态
+func UpuserCreditA(code, userId string, credit_a int) (bool, int) {
+	var ret uint64
+	if tmp, ok := CreditA[code]; ok {
+		ret = 1 << (tmp - 1)
+	}
+	n_credit_a := uint64(credit_a) + ret
+	b := mogo.Update("user", `{"_id":"`+userId+`"}`, `{"$set":{"credit_a":`+fmt.Sprint(int(n_credit_a))+`}}`, true, false)
+	return b, int(n_credit_a)
+}
+
+//判断一次性积分是否完成
+func AIsHasDo(code string, num int) bool {
+	b := false
+	var ret uint64
+	if tmp, ok := CreditA[code]; ok {
+		ret = 1 << (tmp - 1)
+	}
+	if uint64(num)&ret > 0 {
+		b = true
+	}
+	return b
+}

+ 0 - 1
core/src/main.go

@@ -11,7 +11,6 @@ import (
 	_ "qfw/front"
 	_ "qfw/manage"
 	_ "qfw/member"
-	_ "qfw/member/credit"
 	_ "qfw/member/message"
 	_ "qfw/microwebsite"
 	_ "qfw/mobile"

+ 0 - 5
core/src/qfw/coreconfig/SysConfig.go

@@ -23,12 +23,7 @@ type config struct {
 	ChatServer      string      `json:"chatServer"`
 	ChatRpc         string      `json:"chatRpc"`
 	ElasticPoolSize int         `json:"elasticPoolSize"`
-<<<<<<< HEAD
-	CreditRpc       string      `json:"creditRpc"`
-	CreditA         string      `json:"credit_a"`
-=======
 	DomainName      string      `json:"domainName"`
->>>>>>> release
 }
 type smtp struct {
 	Addr     string `json:"addr"`

+ 6 - 1
core/src/qfw/manage/auditing.go

@@ -15,6 +15,7 @@ import (
 	"qfw/coreutil"
 	"qfw/member"
 	"qfw/util"
+	credit "qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/mongodb"
 	. "qfw/util/msg"
@@ -781,7 +782,11 @@ func (s *SystemManage) Updateaudit() error {
 			flag = "false"
 			msg = "审核失败!"
 		}
-
+		//认证送积分
+		if flag == "true" {
+			_, credit_a, _ := credit.InCreditA(s_submitid, credit.A_RZ, util.IntAll((*f)["credit_a"]))
+			s.Session().UpdateByCustomField("id", s_submitid, "credit_a", credit_a)
+		}
 		s.Write(`{"flag":"` + flag + `","msg":"` + msg + `"}`)
 	}
 	return nil

+ 0 - 81
core/src/qfw/member/credit/credit.go

@@ -1,81 +0,0 @@
-// credit
-package credit
-
-import (
-	"fmt"
-	"github.com/go-xweb/xweb"
-	. "gopkg.in/mgo.v2/bson"
-	"log"
-	. "qfw/coreconfig"
-	"qfw/util"
-	mogo "qfw/util/mongodb"
-	"qfw/util/rpc"
-	"strconv"
-	"strings"
-)
-
-var Rc rpc.RpcCall
-var Replay *int
-var CreditA map[string]uint64
-
-func init() {
-	util.ReadConfig(&SysConfig)
-	tmp := strings.Split(SysConfig.CreditA, ",")
-	CreditA = make(map[string]uint64)
-	for _, v := range tmp {
-		n, _ := strconv.Atoi(v[1:])
-		CreditA[v] = uint64(n)
-	}
-	Rc = rpc.RpcCall{Addr: SysConfig.CreditRpc}
-	//添加模块解析
-	xweb.AddAction(&Credit{})
-}
-
-type Credit struct {
-	*xweb.Action
-	increditAjaxRqe xweb.Mapper `xweb:"/member/incredit"` //增加积分
-}
-
-//增加积分
-func (c *Credit) IncreditAjaxRqe() error {
-	result := false
-	userId := c.GetSession("userId").(string)
-	num := c.GetSession("credit_a").(uint64)
-	code := c.GetString("code")
-	b := AIsHasDo(code, num)
-	if !b {
-		param := make(map[string]interface{})
-		err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: int(num), OtherParam: param}, Replay)
-		if err == nil {
-			num, r := UpuserCreditA(code, userId, uint64(num))
-			c.Session().Set("credit_a", num)
-			result = r
-		} else {
-			log.Println(err)
-		}
-	}
-	c.ServeJson(M{"result": result})
-	return nil
-}
-
-func AIsHasDo(code string, num uint64) bool {
-	b := false
-	var ret uint64
-	if tmp, ok := CreditA[code]; ok {
-		ret = 1 << (tmp - 1)
-	}
-	if num&ret > 0 {
-		b = true
-	}
-	return b
-}
-
-func UpuserCreditA(code, userId string, num uint64) (uint64, bool) {
-	var ret uint64
-	if tmp, ok := CreditA[code]; ok {
-		ret = 1 << (tmp - 1)
-	}
-	num = num + ret
-	b := mogo.Update("user", `{"_id":"`+userId+`"}`, `{"$set":{"credit_a":`+fmt.Sprint(num)+`}}`, true, false)
-	return num, b
-}

+ 11 - 5
core/src/qfw/member/membermanager.go

@@ -20,6 +20,7 @@ import (
 	"qfw/coreconfig"
 	. "qfw/coreutil"
 	. "qfw/util"
+	credit "qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/mongodb"
 	msg "qfw/util/msg"
@@ -85,7 +86,6 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 		if len(s_action) == 2 { //已经认证过
 			return
 		}
-		fmt.Println("222222222222222222222", s_action)
 		entName := ObjToString((*ent)["EntName"])
 		email := ObjToString((*ent)["Nb_email"])
 		t := time.Now().Local().Unix()
@@ -427,7 +427,7 @@ func (m *Member) RegisterComplete() error {
 //登录
 func (m *Member) Login() {
 	var status string = "n"
-	var info, freeze string
+	var info, freeze, code string
 	s_pwd := m.GetString("s_pwd") //密码
 	if s_pwd != "" {              //密码为空不可登录
 		var loginType string            //登录类型
@@ -448,6 +448,7 @@ func (m *Member) Login() {
 			} else {
 				//获取绑定企业信息
 				if r["s_enterpriseid"] != nil && r["s_enterpriseid"].(string) != "" {
+					code = r["s_enterpriseid"].(string)
 					//enter := *FindOne("enterprise", `M{"_id":"`+r["s_enterpriseid"].(string)+`"}`)
 					enter := *FindById("enterprise", r["s_enterpriseid"].(string), nil)
 					if enter != nil && enter["OpLocDistrict"] != nil {
@@ -472,7 +473,7 @@ func (m *Member) Login() {
 	} else {
 		info = "p_error" //密码错误
 	}
-	m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\"}")
+	m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\",\"code\":\"" + code + "\"}")
 }
 
 //找回密码之后直接登录
@@ -875,12 +876,16 @@ func (m *Member) Bindmail() error {
 				}
 				bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
 				if bol {
+					//绑邮箱送积分
+					credit.InCreditA(usid, credit.A_BYX, IntAll(m.GetSession("credit_a")))
 					//邮箱绑定认证
 					if contype == "1" {
 						r := *FindById("enterprise", entid, nil)
 						ac := ObjToString(r["s_action"])
 						if len(r) > 0 && ac == "" {
 							autoAuth(usid, uname, avatar, entid, proid)
+							//认证送积分
+							credit.InCreditA(usid, credit.A_RZ, IntAll(m.GetSession("credit_a")))
 							//发系统消息
 							msg := &msg.Msg{
 								Msgtype:   1,
@@ -1047,6 +1052,8 @@ func (m *Member) Updatephone() error {
 				if bol {
 					result = "y"
 					encryPhone = newPhone
+					//绑定手机送积分
+					credit.InCreditA(ObjToString(m.GetSession("userId")), credit.A_BSJ, IntAll(m.GetSession("credit_a")))
 					UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
 				} else {
 					result = "n"
@@ -1121,8 +1128,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
 		setSessMap["identType"] = IntAll(r["i_identificationtype"])
 		setSessMap["identWay"] = IntAll(r["i_identificationway"])
 		setSessMap["opLocDistrict"] = r["opLocDistrict"]
-		setSessMap["credit_a"] = uint64(IntAll(r["credit_a"]))
-
+		setSessMap["credit_a"] = IntAll(r["credit_a"])
 		if r["s_phone"] == nil || r["s_phone"].(string) == "" {
 			setSessMap["phone"] = ""
 		} else {

+ 9 - 1
core/src/qfw/member/yellowpage.go

@@ -15,6 +15,7 @@ import (
 	"qfw/coreutil"
 	"qfw/redpackage"
 	"qfw/util"
+	credit "qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/fsw"
 	"qfw/util/mongodb"
@@ -230,8 +231,11 @@ func (yp *Yellowpage) Dosave() error {
 	if !flag {
 		status = "n"
 		info = "保存信息失败"
+	} else { //首次创建企业名片,送积分
+		userId := util.ObjToString(yp.GetSession("userId"))
+		_, credit_a, _ := credit.InCreditA(userId, credit.A_CJMP, util.IntAll(yp.GetSession("credit_a")))
+		yp.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
 	}
-
 	return yp.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\"}")
 }
 
@@ -424,6 +428,10 @@ func (yp *Yellowpage) AddService() error {
 		_id := mongodb.Save("service", doc)
 		doc["_id"] = _id
 		tempFlag = len(_id) > 0
+		//发服务送积分
+		if tempFlag {
+			//credit.InCreditB(util.ObjToString(userid), credit.B_FFW)
+		}
 	}
 	currentuser := mongodb.FindById("user", yp.GetSession("userId").(string), nil)
 	log.Println(currentuser)

+ 10 - 2
core/src/qfw/swordfish/swordfishmanage.go

@@ -2,6 +2,8 @@ package swordfish
 
 import (
 	"gopkg.in/mgo.v2/bson"
+	"qfw/util"
+	credit "qfw/util/credit"
 	"qfw/util/mongodb"
 	"qfw/util/redis"
 	"time"
@@ -31,6 +33,7 @@ func (s *SwordFish) RssSet() error {
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 func (s *SwordFish) RsssetAjaxReq() error {
+	userId := s.GetSession("userId").(string)
 	var flag = "n"
 	msgset := make(map[string]interface{})
 	//投标公告
@@ -49,9 +52,14 @@ func (s *SwordFish) RsssetAjaxReq() error {
 	}
 	//更新数据库
 	msgset["l_modifydate"] = time.Now().Unix()
-	if mongodb.Update("user", `{"_id":"`+s.GetSession("userId").(string)+`"}`, &map[string]interface{}{"$set": map[string]interface{}{"o_msgset": msgset}}, false, false) {
+	if mongodb.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": map[string]interface{}{"o_msgset": msgset}}, false, false) {
 		flag = "y"
 	}
+	//使用剑鱼送积分
+	if flag == "y" {
+		_, credit_a, _ := credit.InCreditA(userId, credit.A_JY, util.IntAll(s.GetSession("credit_a")))
+		s.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
+	}
 	s.ServeJson(map[string]interface{}{
 		"flag": flag,
 	})
@@ -60,7 +68,7 @@ func (s *SwordFish) RsssetAjaxReq() error {
 
 //跳转到用户中心剑鱼信息列表
 func (s *SwordFish) Infolist() error {
-	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset:1"}`)
+	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
 	s.T["msgset"] = ms
 	return s.Render("/swordfish/infolist.html", &s.T)
 }

+ 0 - 3
core/src/web/staticres/css/dev-qfw.css

@@ -48,9 +48,6 @@ a{
 	margin-left: 20px;
 	margin-right: 20px;
 }
-.text-primary {
-	color: #dd4814 !important;
-}
 .text-bold{
 	font-weight:700;
 }

+ 44 - 3
core/src/web/staticres/css/qfw.css

@@ -462,11 +462,53 @@ a.new_red:hover, a.new_red:active {
 	display: table-cell;
 }
 
-/*==========覆盖bootstrap样式===========*/
+/*==========覆盖bootstrap样式 start===========*/
 [class*="col-"] {
 	padding-left: 0px !important;
 }
-
+.btn{
+	padding-top: 6px;
+	padding-bottom: 6px;
+}
+.btn-primary,.btn-primary:hover,.btn-primary:focus,.btn-primary:active{
+	background-color: #FF5A5F;
+	border-color: #FF5A5F;
+}
+.btn-sm, .btn-group-sm > .btn{
+	padding-top: 3px;
+	padding-bottom: 3px;
+}
+.btn-xs, .btn-group-xs > .btn{
+	padding-top: 0px;
+	padding-bottom: 0px;
+}
+.text-primary {
+	color: #FF5A5F !important;
+}
+.modal-content{
+	border-radius: 4px;
+	border-top-left-radius: 5px;
+	border-top-right-radius: 5px;
+}
+.modal-header{
+	background-color: #FF5A5F;
+	color: #FFFFFF;
+	border-top-left-radius: 4px;
+	border-top-right-radius: 4px;
+	padding-left: 20px;
+	padding-right: 10px;
+	font-size: 16px;
+}
+.modal-header .close{
+	opacity: 1;
+	text-shadow: none;
+	font-weight: normal;
+	color: #FFFFFF;
+}
+.modal-header .close:focus, .modal-header .close:hover{
+	opacity: 1;
+}
+/*==========覆盖bootstrap样式 end===========*/
 .lineb {
 	display: inline-block;
 }
@@ -504,7 +546,6 @@ span.highlight {
 	color: #dd4814;
 	font-weight: bold;
 }
-
 /*字体图标*/
 @font-face {
 	font-family: 'qimingxing';

+ 10 - 0
core/src/web/staticres/wxswordfish/style.css

@@ -322,6 +322,11 @@ img{
 	-o-animation-timing-function:ease-in;
 	-o-animation-iteration-count:1;
 	-o-animation-play-state:running;
+	webkit-transform: translateZ(0);
+	-moz-transform: translateZ(0);
+	-ms-transform: translateZ(0);
+	-o-transform: translateZ(0);
+	transform: translateZ(0);
 }
 @-webkit-keyframes slidedown {
 	0%{
@@ -351,6 +356,11 @@ img{
 	-o-animation-timing-function:ease-in;
 	-o-animation-iteration-count:1;
 	-o-animation-play-state:running;
+	webkit-transform: translateZ(0);
+	-moz-transform: translateZ(0);
+	-ms-transform: translateZ(0);
+	-o-transform: translateZ(0);
+	transform: translateZ(0);
 }
 
 @-webkit-keyframes slideup {

+ 5 - 5
core/src/web/templates/common/login.html

@@ -140,7 +140,7 @@ function setTimes(num,n){
 						//登陆成功
 						clearInterval(t);
 						compulsoryreRresh = true;
-						afterLoginSkip();
+						afterLoginSkip(data);
 						$("img.login-logo").css("marginLeft",180);
 						$("div.modal-content").animate({
 						    width:'550px'
@@ -217,7 +217,7 @@ $(function (){
 			}else{
 				//注册页面登录之后
 				$("#loginStatus").trigger("login");
-				afterLoginSkip();
+				afterLoginSkip(data);
 			}
 			//
 			if($("#loginModal [name='rememberMe']").is(':checked')==true){
@@ -242,7 +242,7 @@ $(function (){
 		
 	});
 });
-function afterLoginSkip(){
+function afterLoginSkip(data){
 	switch(loginBackType){
 		case -1:
 			window.location.href = window.location.href;
@@ -266,14 +266,14 @@ function afterLoginSkip(){
 			window.location.href = "/member/show/memberindex";
 			break;
 		case 8://录入产品服务信息
-			if(data.code==null){
+			if(data.code==null || data.code == ""){
 				window.location.href = '/member/show/memberindex';
 			}else{
 				window.location.href = '/member/yellowpage/show/showService/'+data.code;
 			}
 			break;
 		case 9://录入企业信息
-			if(data.code==null){
+			if(data.code==null || data.code == ""){
 				window.location.href = '/member/show/memberindex';
 			}else{
 				window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;

+ 1 - 5
core/src/web/templates/member/microwebsite.html

@@ -127,11 +127,7 @@ $(function(){
 	});
 	$(".step-1 span").click(function(){
 		if(isPreview){
-			if(this.id == "editService"){
-				loginModalShow(8);
-			}else{
-				loginModalShow(9);
-			}
+			loginModalShow();
 			return;
 		}
 		$(".step-1 span").removeClass("selected");

+ 2 - 2
core/src/web/templates/service/appointment.html

@@ -4,8 +4,8 @@
   	<div class="modal-dialog" role="document">
 		<div class="modal-content">
 		  	<div class="modal-header">
-				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  onClick="qxdx()">&times;</span></button>
-				<h4 class="modal-title text-muted" id="appointmentModalLabel"><b class="m-demandtable">免费预约</b></h4>
+				<span data-dismiss="modal" aria-label="Close" onClick="qxdx()" class="close bootstrap-glyphicon glyphicon-remove-circle"></span>
+				<span class="modal-title" id="appointmentModalLabel">免费预约</span>
 			</div>
 			<div id="reg_b">
 		  	<div class="text-muted d_tck_n">{{.T.sinfo.s_enterprisename}}</div>

+ 25 - 21
core/src/web/templates/swordfish/infolist.html

@@ -8,6 +8,30 @@
 	var lasttime=1,s_words,a_visitedindex,a_publishtime,le,f_id,a_interest;
 $(function(){
 	$(".b-nav>ul>li:eq(3)").addClass("b-nav-active");
+	var s_words = [];
+	var a_interest = [];
+	if({{.T.msgset.o_msgset.bid.a_key}}){
+		s_words={{.T.msgset.o_msgset.bid.a_key}};
+	}
+	if({{.T.msgset.o_msgset.tender.a_key}}){
+		a_interest={{.T.msgset.o_msgset.tender.a_key}};
+	}
+	if(s_words.length!=0){
+		$("#okeywords").append(s_words.join(" ; ").replace(/\+/gm," "));
+	}else{
+		$("#zhaob").addClass("hide");
+	}
+	if(a_interest.length!=0){
+		$("#ointerest").append(a_interest.join(" ; ").replace(/\+/gm," "));
+	}else{
+		$("#zhongb").addClass("hide");
+	}
+	if(s_words.length==0 && a_interest.length==0){
+		$("#zhongb").before("关键词");
+	}
+	if(s_words.length!=0 && a_interest.length!=0){
+		$("#zhongb").append(",");
+	}
 	//
 	$.ajax({    
 		type:'post',        
@@ -38,27 +62,7 @@ $(function(){
 				a_publishtime=temp["a_publishtime"];
 				f_id=temp["_id"];
 			}
-			if({{.T.msgset.o_msgset.bid.a_key}}){
-				s_words={{.T.msgset.o_msgset.bid.a_key}};
-			}
-			if({{.T.msgset.o_msgset.tender.a_key}}){
-				a_interest={{.T.msgset.o_msgset.tender.a_key}};
-			}
-			$("#conlist").append('<div id="ycwords">'+str+'</div>');
-			if(s_words.length!=0){
-				$("#okeywords").append(s_words.join(" ; ").replace(/\+/gm," "));
-			}else{
-				$("#zhaob").addClass("hide");
-			}
-			if(a_interest.length!=0){
-				$("#ointerest").append(a_interest.join(" ; ").replace(/\+/gm," "));
-			}else{
-				$("#zhongb").addClass("hide");
-			}
-			if(s_words.length!=0 && a_interest.length!=0){
-				$("#zhongb").append(",");
-			}
-			
+			$("#conlist").append('<div id="ycwords">'+str+'</div>');			
 			//信息条总数
 			le=$(".tslist").length;
 			//

+ 7 - 0
weixin/src/qfw/weixin/dao/userdao.go

@@ -8,6 +8,7 @@ import (
 	"log"
 	"math/rand"
 	"qfw/util"
+	credit "qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/mongodb"
 	"strconv"
@@ -40,6 +41,12 @@ func AddUser(openid, unionid, bindweixin, userphoto string) (err error, flag int
 		data["i_identificationway"] = 0
 		data["s_m_openid"] = openid //微信手机端openid
 		if len(Save("user", data)) > 0 {
+			//注册送积分
+			m := FindOne("user", `{"s_m_openid":"`+openid+`"}`)
+			if m != nil {
+				id := fmt.Sprintf("%x", string((*m)["_id"].(ObjectId)))
+				credit.InCreditA(id, credit.A_ZC, 0)
+			}
 			return nil, 1
 		} else {
 			return errors.New("保存用户失败"), 0