feat:完善项目信息
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/serve/orm"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
@ -62,6 +63,7 @@ func (c *Apply) Instance(tenantID uint64, title, contact string, page, pageSize
|
||||
list := make([]*ApplyInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
v.Image.Image = v.Analysis(config.SettingInfo.Domain)
|
||||
list = append(list, &ApplyInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
TenantID: v.GetEncodeTenantID(),
|
||||
@ -80,6 +82,8 @@ func (c *Apply) Detail(id uint64) (*ApplyDetailInfo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out.Image.Image = out.Analysis(config.SettingInfo.Domain)
|
||||
|
||||
return &ApplyDetailInfo{
|
||||
ID: out.GetEncodeID(),
|
||||
TenantID: out.GetEncodeTenantID(),
|
||||
@ -114,6 +118,7 @@ func (c *Apply) Handle(id uint64, remark string) error {
|
||||
return err
|
||||
}
|
||||
mActivityApplyLog := model.NewActivityApplyLog()
|
||||
mActivityApplyLog.UID = c.UID
|
||||
mActivityApplyLog.ApplyID = mActivityApply.ID
|
||||
mActivityApplyLog.Remark = remark
|
||||
return model2.Create(mActivityApplyLog.ActivityApplyLog, tx)
|
||||
|
@ -91,7 +91,7 @@ func (c *Instance) Index(tenantID uint64, title, contact, contactMobile string,
|
||||
_industry := make([]string, 0)
|
||||
|
||||
for _, v := range v.GetIndustryAttribute() {
|
||||
_industry = append(_industry, config.GetIndustryInfo(v, "-"))
|
||||
_industry = append(_industry, config.GetIndustryInfo(v, "-", "/"))
|
||||
}
|
||||
list = append(list, &InstanceInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
@ -226,11 +226,17 @@ func (c *Instance) Delete(id uint64) error {
|
||||
return model2.Delete(mActivityInstance.ActivityInstance)
|
||||
}
|
||||
|
||||
func (c *Instance) Joins(activityID uint64, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
func (c *Instance) Joins(activityID uint64, name string, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
mActivityJoin := model.NewActivityJoin()
|
||||
|
||||
where := []*model2.ModelWhere{model2.NewWhere("j.activity_id", activityID)}
|
||||
|
||||
if name != "" {
|
||||
where = append(where, model2.NewWhereLike("u_i.name", name))
|
||||
}
|
||||
var count int64
|
||||
|
||||
out, err := mActivityJoin.Join(page, pageSize, &count, model2.NewWhere("j.activity_id", activityID))
|
||||
out, err := mActivityJoin.Join(page, pageSize, &count, where...)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user