feat: 个人中心发布
This commit is contained in:
@@ -35,13 +35,14 @@ func (p *MyPlant) AfterCreate(tx *gorm.DB) (err error) {
|
||||
for _, v := range p.CarePlans {
|
||||
dueDate := today.AddDate(0, 0, v.Period)
|
||||
task := CareTask{
|
||||
UserId: p.UserId,
|
||||
PlantId: p.Id,
|
||||
PlanId: v.Id,
|
||||
Name: v.Name,
|
||||
Icon: v.Icon,
|
||||
DueDate: dueDate,
|
||||
Status: 1,
|
||||
UserId: p.UserId,
|
||||
PlantId: p.Id,
|
||||
PlanId: v.Id,
|
||||
Name: v.Name,
|
||||
Icon: v.Icon,
|
||||
TargetAction: v.TargetAction,
|
||||
DueDate: dueDate,
|
||||
Status: 1,
|
||||
}
|
||||
err = tx.Create(&task).Error
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user