feat:优化项目信息
This commit is contained in:
11
app/api/enterprise/model/order_instance.go
Normal file
11
app/api/enterprise/model/order_instance.go
Normal file
@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type OrderInstance struct {
|
||||
*model.OrderInstance
|
||||
}
|
||||
|
||||
func NewOrderInstance() *OrderInstance {
|
||||
return &OrderInstance{model.NewOrderInstance()}
|
||||
}
|
11
app/api/enterprise/model/order_log.go
Normal file
11
app/api/enterprise/model/order_log.go
Normal file
@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
|
||||
type OrderLog struct {
|
||||
*model.OrderLog
|
||||
}
|
||||
|
||||
func NewOrderLog() *OrderLog {
|
||||
return &OrderLog{model.NewOrderLog()}
|
||||
}
|
@ -39,11 +39,26 @@ func (m *UserExpert) Expert(uid uint64) (*UserExpertInfo, error) {
|
||||
Select("u.id AS user_expert_id", "c.*").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON u.expert_id = c.id", model.NewManageExpert().TableName())).
|
||||
Where("u.uid = ?", uid).
|
||||
Order("u.id "+model.OrderModeToDesc).
|
||||
Where("u.is_deleted = ? AND u.invalid_status = ?", model.DeleteStatusForNot, model.InvalidStatusForNot).
|
||||
Scan(out).Error
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ExpertBasic 专家信息
|
||||
func (m *UserExpert) ExpertBasic(uid uint64) (*UserExpertInfo, error) {
|
||||
out := new(UserExpertInfo)
|
||||
|
||||
err := orm.GetDB().Table(m.TableName()+" AS u").
|
||||
Select("u.id AS user_expert_id", "c.name", "c.mobile").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS c ON u.expert_id = c.id", model.NewManageExpert().TableName())).
|
||||
Where("u.uid = ?", uid).
|
||||
Where("u.is_deleted = ? AND u.invalid_status = ?", model.DeleteStatusForNot, model.InvalidStatusForNot).
|
||||
Order("u.id " + model.OrderModeToDesc).
|
||||
Scan(out).Error
|
||||
return out, err
|
||||
}
|
||||
|
||||
func NewUserExpert() *UserExpert {
|
||||
return &UserExpert{model.NewUserExpert()}
|
||||
}
|
||||
|
Reference in New Issue
Block a user