|
@@ -1,6 +1,7 @@
|
|
package entity
|
|
package entity
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "database/sql"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"log"
|
|
"log"
|
|
qutil "qfw/util"
|
|
qutil "qfw/util"
|
|
@@ -56,16 +57,26 @@ func (e *entnicheStruct) PayCallBack(param *CallBackParam) bool {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- filter_id = util.Mysql.Insert("entniche_info", map[string]interface{}{
|
|
|
|
- "name": entname,
|
|
|
|
- "industry": industry,
|
|
|
|
- "phone": phone,
|
|
|
|
- "admin_name": adminname,
|
|
|
|
- "quota": qutil.IntAll(filter["personnum"]),
|
|
|
|
- "status": 1,
|
|
|
|
- "createtime": nowFormat,
|
|
|
|
- "startdate": now.Unix(),
|
|
|
|
- "enddate": enddate.Unix(),
|
|
|
|
|
|
+ util.Mysql.ExecTx("商机管理支付成功", func(tx *sql.Tx) bool {
|
|
|
|
+ filter_id = util.Mysql.InsertByTx(tx, "entniche_info", map[string]interface{}{
|
|
|
|
+ "name": entname,
|
|
|
|
+ "industry": industry,
|
|
|
|
+ "phone": phone,
|
|
|
|
+ "admin_name": adminname,
|
|
|
|
+ "quota": qutil.IntAll(filter["personnum"]),
|
|
|
|
+ "status": 1,
|
|
|
|
+ "createtime": nowFormat,
|
|
|
|
+ "startdate": now.Unix(),
|
|
|
|
+ "enddate": enddate.Unix(),
|
|
|
|
+ })
|
|
|
|
+ dept_id := util.Mysql.InsertByTx(tx, "entniche_department", map[string]interface{}{
|
|
|
|
+ "pid": 0,
|
|
|
|
+ "name": entname,
|
|
|
|
+ "ent_id": filter_id,
|
|
|
|
+ "createtime": nowFormat,
|
|
|
|
+ "timestamp": nowFormat,
|
|
|
|
+ })
|
|
|
|
+ return filter_id > 0 && dept_id > 0
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|