|
@@ -476,9 +476,10 @@ func GetFormula(pastureid string) error {
|
|
|
logging.Info("create SnowIds err", err)
|
|
|
}
|
|
|
|
|
|
- _, err = tx.Exec("insert into feedtemplet(id,pastureid,ccid,tcode,backup1,backup2,tname,fttypeid,fttype) values(?,?,null,?,?,?,?,1,'饲喂配方') "+
|
|
|
+ _, err = tx.Exec("insert into feedtemplet(id,pastureid,ccid,tcode,backup1,backup2,tname,fttypeid,fttype) values(?,?,
|
|
|
+ (select ccid from feedtemplet where pastureid = ? limit 1),?,?,?,?,1,'饲喂配方') "+
|
|
|
" ON DUPLICATE KEY UPDATE tcode=?,backup2= ?",
|
|
|
- ids, pastureid, ftId, ftId, modifiedAt, ftName, ftId, modifiedAt)
|
|
|
+ ids, pastureid,pastureid, ftId, ftId, modifiedAt, ftName, ftId, modifiedAt)
|
|
|
|
|
|
if err != nil {
|
|
|
return err
|
|
@@ -520,7 +521,7 @@ func GetFormula(pastureid string) error {
|
|
|
" (select id from feed where pastureid=? and backup1=? limit 1),?,?,?,(if(?='',0,?)),?,?) ",
|
|
|
ids, pastureid, pastureid, ftName, pastureid, fId, fName, fodderWeight, mixNo, autosecond, autosecond, autosecond, fName)
|
|
|
if err != nil {
|
|
|
- logging.Info("3333333333", err)
|
|
|
+ logging.Info(err)
|
|
|
return err
|
|
|
}
|
|
|
_, err = tx.Exec("call updateFPbyFTChange((select id from feedtemplet where pastureid=? and tname=? limit 1),?,(select fttypeid from feedtemplet where pastureid=? and tname=? limit 1),1)", pastureid, ftName, pastureid, pastureid, ftName)
|