用户申请入驻
This commit is contained in:
@@ -3559,3 +3559,16 @@ func UpdateStorePushClient(ctx *jxcontext.Context, storeID int, cID string) (err
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CreateStoreAudit(ctx *jxcontext.Context, storeAudit *model.StoreAudit) (err error) {
|
||||||
|
var (
|
||||||
|
db = dao.GetDB()
|
||||||
|
)
|
||||||
|
storeAudits, err := dao.GetStoreAudit(db, model.StoreAuditStatusOnline, storeAudit.UserID, "")
|
||||||
|
if len(storeAudits) > 0 {
|
||||||
|
return fmt.Errorf("您已申请过入驻,请不要重复申请!")
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULDEntity(storeAudit, ctx.GetUserName())
|
||||||
|
dao.CreateEntity(db, storeAudit)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
@@ -837,3 +837,31 @@ func GetStorePushClient(db *DaoDB, storeID int, cID string) (storePushClient []*
|
|||||||
}
|
}
|
||||||
return storePushClient, err
|
return storePushClient, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetStoreAudit(db *DaoDB, auditStatus int, userID, keyword string) (storeAudit []*model.StoreAudit, err error) {
|
||||||
|
sql := `
|
||||||
|
SELECT *
|
||||||
|
FROM store_audit
|
||||||
|
WHERE deleted_at = ?
|
||||||
|
`
|
||||||
|
sqlParams := []interface{}{
|
||||||
|
utils.DefaultTimeValue,
|
||||||
|
}
|
||||||
|
if auditStatus != model.StoreStatusAll {
|
||||||
|
sql += " AND audit_status = ?"
|
||||||
|
sqlParams = append(sqlParams, auditStatus)
|
||||||
|
}
|
||||||
|
if userID != "" {
|
||||||
|
sql += " AND user_id = ?"
|
||||||
|
sqlParams = append(sqlParams, userID)
|
||||||
|
}
|
||||||
|
if keyword != "" {
|
||||||
|
sql += " AND (user_id LIKE ? OR name LIKE ? OR tel1 LIKE ? OR tel2 LIKE ? OR address LIKE ?)"
|
||||||
|
sqlParams = append(sqlParams, "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%")
|
||||||
|
}
|
||||||
|
err = GetRows(db, &storeAudit, sql, sqlParams)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return storeAudit, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -852,7 +852,7 @@ func (c *StoreController) CreateStoreAudit() {
|
|||||||
c.callCreateStoreAudit(func(params *tStoreCreateStoreAuditParams) (retVal interface{}, errCode string, err error) {
|
c.callCreateStoreAudit(func(params *tStoreCreateStoreAuditParams) (retVal interface{}, errCode string, err error) {
|
||||||
store := &model.StoreAudit{}
|
store := &model.StoreAudit{}
|
||||||
if err = utils.UnmarshalUseNumber([]byte(params.Payload), store); err == nil {
|
if err = utils.UnmarshalUseNumber([]byte(params.Payload), store); err == nil {
|
||||||
// retVal, err = cms.CreateStore(params.Ctx, store, params.Ctx.GetUserName())
|
err = cms.CreateStoreAudit(params.Ctx, store)
|
||||||
}
|
}
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1773,6 +1773,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "CreateStoreAudit",
|
||||||
|
Router: `/CreateStoreAudit`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "CreateStorePriceScore",
|
Method: "CreateStorePriceScore",
|
||||||
|
|||||||
Reference in New Issue
Block a user