作者 陈志颖

feat:修改手机号

不能预览此文件类型
... ... @@ -472,13 +472,13 @@ func (service SyncEmployeeService) changePhone(data ChangePhoneData) error {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
// 更新高管手机号
if err = uDao.UpdateUserPhone(data.OldPhone, data.NewPhone); err != nil {
// 更新合伙人手机号
if err = pDao.UpdatePartnerPhone(data.OldPhone, data.NewPhone); err != nil {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
// 更新合伙人手机号
if err = pDao.UpdatePartnerPhone(data.OldPhone, data.NewPhone); err != nil {
// 更新高管手机号
if err = uDao.UpdateUserPhone(data.OldPhone, data.NewPhone); err != nil {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
... ...
... ... @@ -2,11 +2,11 @@ package constant
import "os"
var POSTGRESQL_DB_NAME = "partner_test"
var POSTGRESQL_DB_NAME = "partner_dev"
var POSTGRESQL_USER = "postgres"
var POSTGRESQL_PASSWORD = "1993618jack" // eagle1010 1993618jack
var POSTGRESQL_HOST = "127.0.0.1" // 114.55.200.59 127.0.0.1
var POSTGRESQL_PORT = "5432" // 31543 5432
var POSTGRESQL_PASSWORD = "eagle1010" // eagle1010 1993618jack
var POSTGRESQL_HOST = "114.55.200.59" // 114.55.200.59 127.0.0.1
var POSTGRESQL_PORT = "31543" // 31543 5432
var DISABLE_CREATE_TABLE = false
var DISABLE_SQL_GENERATE_PRINT = false
... ...
... ... @@ -2,7 +2,6 @@ package dao
import (
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
... ... @@ -36,8 +35,8 @@ func (dao UsersDao) UpdateUserPhone(oldPhone string, newPhone string) error {
tx := dao.transactionContext.PgTx
m := &models.Users{}
_, err := tx.Model(m).
Set("phone", newPhone).
Where("phone = ?", oldPhone).
Set("phone=?", newPhone).
Where("phone=?", oldPhone).
Update()
return err
}
... ...
... ... @@ -8,8 +8,6 @@ import (
//外部调用,企业平台,总后台调用
func init() {
nsPlatform := beego.NewNamespace("/platform",
// TODO 增加修改手机号动作
beego.NSRouter("/api/business/index", &controllers.SyncDataController{}, "Post:SyncData"),
//同步企业相关数据
beego.NSRouter("/action", &controllers.SyncDataController{}, "post:SyncData"),
//更换公司管理员
... ... @@ -20,6 +18,9 @@ func init() {
//beego.NSRouter("/company/info", &controllers.SyncDataController{}, "post:GetCompanyInfo"),
)
// 修改手机号,企业平台调用
beego.Router("/api/business/index", &controllers.SyncDataController{}, "Post:SyncData")
beego.AddNamespace(nsPlatform) //企业平台调用
beego.AddNamespace(nsUcenter) //统一用户中心调用
}
... ...