|
@@ -77,7 +77,14 @@ func CompanyFreeze(companyId, productId int) (companyReportPermissionList []*Com
|
|
func CompanyLoss(companyId, productId int) (err error) {
|
|
func CompanyLoss(companyId, productId int) (err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
//客户产品状态变更
|
|
//客户产品状态变更
|
|
- sql := `UPDATE company_product SET status='流失',is_formal=0,loss_time=NOW(),modify_time=NOW(),lose_reason='冻结到期系统自动流失',try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
|
|
|
+ sql := `UPDATE company_product SET status='流失',is_formal=0,loss_time=NOW(),modify_time=NOW(),lose_reason='冻结到期系统自动流失',try_stage=1,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, 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()
|
|
_, err = o.Raw(sql, companyId, productId).Exec()
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|