|
@@ -435,12 +435,19 @@ func ApplyReceive(companyId, productId, sysUserId, companyApprovalId, applyUserI
|
|
|
endDate := time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
|
|
|
|
|
|
//更新用户产品状态
|
|
|
- sql := `UPDATE company_product SET status='试用',approve_status='已审批', start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
|
|
|
+ sql := `UPDATE company_product SET status='试用',approve_status='已审批', start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW(),todo_status="无任务",todo_create_time=null,todo_approve_time=null,todo_modify_time=null,todo_end_time=null WHERE company_id=? AND product_id=? `
|
|
|
_, err = o.Raw(sql, startDate, endDate, sellerItem.AdminId, sellerItem.RealName, sellerItem.GroupId, sellerItem.DepartmentId, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 将进行中的任务给作废掉
|
|
|
+ sql = `UPDATE company_todo SET status="已作废",modify_time=NOW() WHERE company_id=? AND product_id=? and status="进行中" `
|
|
|
+ _, err = o.Raw(sql, companyId, productId).Exec()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//更新用户状态
|
|
|
sql = `UPDATE company SET type=2,last_updated_time=NOW() WHERE company_id=? `
|
|
|
_, err = o.Raw(sql, companyId).Exec()
|