feat:完善信息,增加socket
This commit is contained in:
@ -88,14 +88,14 @@ func (*Manage) CompanyForm(c *gin.Context) {
|
||||
func (*Manage) CompanyExamine(c *gin.Context) {
|
||||
form := &struct {
|
||||
manageExamineForm
|
||||
Kind int `json:"kind" form:"kind" binding:"required"`
|
||||
Kind int `json:"kind" form:"kind"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForCompany
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), map[string]interface{}{"kind": form.Kind})
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), nil)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,9 @@ type (
|
||||
}
|
||||
// CompanyDetail 公司企业详细信息
|
||||
CompanyDetail struct {
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
InvitedCode string `json:"invited_code"`
|
||||
*model2.ManageCompany
|
||||
Industrys []*config.Industry `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
@ -60,7 +61,7 @@ func (c *Company) Instance(tenantID uint64, name string, status int, page, pageS
|
||||
}
|
||||
var count int64
|
||||
|
||||
out, err := mManageCompany.Companys(page, pageSize, &count)
|
||||
out, err := mManageCompany.Companys(page, pageSize, &count, where...)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -117,6 +118,7 @@ func (c *Company) Form(params *BasicParams, other *config.IdentityForCompany) er
|
||||
}
|
||||
}
|
||||
mManageCompany.TenantID = c.TenantID
|
||||
mManageCompany.Kind = model2.ManageCompanyKind(other.Kind)
|
||||
mManageCompany.Image = model2.Image{Image: params.Image}
|
||||
mManageCompany.Area = model2.Area{
|
||||
Province: params.Area.Province, City: params.Area.City, District: params.Area.District, Address: params.Area.Address,
|
||||
@ -172,10 +174,12 @@ func (c *Company) Detail(id uint64) (*CompanyDetail, error) {
|
||||
return &CompanyDetail{
|
||||
ID: out.GetEncodeID(),
|
||||
TenantID: out.GetEncodeTenantID(),
|
||||
InvitedCode: (&model2.Model{ID: out.InviterID}).GetEncodeID(),
|
||||
ManageCompany: out.ManageCompany,
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
Area: out.FormatBasic(),
|
||||
Directions: out.GetDirectionAttribute(),
|
||||
//Area: out.FormatBasic(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
1
app/api/admin/controller/manage/equipment.go
Normal file
1
app/api/admin/controller/manage/equipment.go
Normal file
@ -0,0 +1 @@
|
||||
package manage
|
@ -185,12 +185,14 @@ func (c *Examine) Launch(id uint64, identity, status int, remark string, params
|
||||
}
|
||||
return orm.GetDB().Transaction(func(tx *gorm.DB) error {
|
||||
values := map[string]interface{}{
|
||||
//"examine_status": status,
|
||||
"examine_status": status,
|
||||
"examine_remark": remark, "updated_at": time.Now()}
|
||||
|
||||
if identity == config.TenantUserIdentityForCompany {
|
||||
for k, v := range params {
|
||||
values[k] = v
|
||||
if params != nil && len(params) > 0 {
|
||||
if identity == config.TenantUserIdentityForCompany {
|
||||
for k, v := range params {
|
||||
values[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
if err = model2.Updates(data.IModel, values, tx); err != nil {
|
||||
|
@ -29,7 +29,7 @@ type (
|
||||
// ManageCompanyDetail 公司企业信息
|
||||
ManageCompanyDetail struct {
|
||||
*model.ManageCompany
|
||||
model.Area
|
||||
//model.Area
|
||||
}
|
||||
)
|
||||
|
||||
@ -37,7 +37,7 @@ type (
|
||||
func (m *ManageCompany) Company(id uint64) (*ManageCompanyDetail, error) {
|
||||
db := orm.GetDB().Table(m.TableName()+" AS c").
|
||||
Select("c.*").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON c.tenant_id = t.id", model.NewSysTenant().TableName())).
|
||||
//Joins(fmt.Sprintf("LEFT JOIN %s AS t ON c.tenant_id = t.id", model.NewSysTenant().TableName())).
|
||||
Where("c.id = ?", id)
|
||||
|
||||
out := new(ManageCompanyDetail)
|
||||
|
Reference in New Issue
Block a user