@@ -40,11 +40,12 @@ namespace common\models ; | |||
use common\helpers\GlobalParam; | |||
use common\models\CreditHistory ; | |||
use common\repositories\CreditHistoryRepository; | |||
class CreditHistorySearch extends CreditHistory | |||
{ | |||
public function rules() | |||
public function rules(): array | |||
{ | |||
return [ | |||
[['id_user', 'id_user_action', 'id_order', 'id_producer'], 'integer'], | |||
@@ -56,7 +57,7 @@ class CreditHistorySearch extends CreditHistory | |||
public function search($params) | |||
{ | |||
$optionsSearch = self::defaultOptionsSearch() ; | |||
$optionsSearch = CreditHistoryRepository::defaultOptionsSearch() ; | |||
$query = CreditHistory::find() | |||
->with($optionsSearch['with']) |
@@ -245,8 +245,9 @@ class Product extends ActiveRecordCommon | |||
// disponible par défaut | |||
if ($this->available_on_points_sale) { | |||
foreach ($this->productPointSale as $productPointSale) { | |||
if ($pointSale->id == $productPointSale->id_point_sale | |||
//&& $productPointSale->id_product == $this->id | |||
if (isset($pointSale->id) | |||
&& $productPointSale->id_point_sale | |||
&& $pointSale->id == $productPointSale->id_point_sale | |||
&& !$productPointSale->available) { | |||
return false; | |||
} | |||
@@ -256,8 +257,7 @@ class Product extends ActiveRecordCommon | |||
} // indisponible par défaut | |||
else { | |||
foreach ($this->productPointSale as $productPointSale) { | |||
if ($pointSale->id == $productPointSale->id_point_sale | |||
//&& $productPointSale->id_product == $this->id | |||
if (isset($pointSale->id) && $pointSale->id == $productPointSale->id_point_sale | |||
&& $productPointSale->available) { | |||
return true; | |||
} |
@@ -193,7 +193,7 @@ class CreditController extends ProducerBaseController | |||
public function actionStripeVerification() | |||
{ | |||
$creditHistoryService = \Yii::$app->logic->getCreditHistoryContainer()->getService(); | |||
$creditHistoryService = $this->getLogic()->getCreditHistoryContainer()->getService(); | |||
$producer = $this->getProducer(); | |||
$contactProducer = $producer->getMainContact(); | |||
@@ -38,7 +38,9 @@ termes. | |||
namespace producer\controllers; | |||
class ProducerBaseController extends CommonController | |||
use common\controllers\CommonController; | |||
class ProducerBaseController extends CommonController | |||
{ | |||
var $producer ; |