Ver código fonte

[backend] Cron init distributions : correction bug id_producer = 0

dev
Guillaume Bourgeois 5 anos atrás
pai
commit
bc80a37cd3
1 arquivos alterados com 4 adições e 1 exclusões
  1. +4
    -1
      common/models/Distribution.php

+ 4
- 1
common/models/Distribution.php Ver arquivo

if($idProducer) { if($idProducer) {
$paramsDistribution['distribution.id_producer'] = (int) $idProducer ; $paramsDistribution['distribution.id_producer'] = (int) $idProducer ;
} }
else {
$idProducer = Producer::getId() ;
}
$distribution = Distribution::searchOne($paramsDistribution) ; $distribution = Distribution::searchOne($paramsDistribution) ;
$distribution = new Distribution; $distribution = new Distribution;
$distribution->date = $date; $distribution->date = $date;
$distribution->delivery = 1; $distribution->delivery = 1;
$distribution->id_producer = Producer::getId();
$distribution->id_producer = $idProducer ;
$distribution->save(); $distribution->save();
} }
} }

Carregando…
Cancelar
Salvar