浏览代码

[Boutique] Abonnements : correctif

feature/souke
Guillaume Bourgeois 9 个月前
父节点
当前提交
4b0d5b3816
共有 2 个文件被更改,包括 11 次插入2 次删除
  1. +10
    -1
      producer/controllers/SubscriptionController.php
  2. +1
    -1
      producer/views/subscription/_form.php

+ 10
- 1
producer/controllers/SubscriptionController.php 查看文件

@@ -122,7 +122,7 @@ class SubscriptionController extends ProducerBaseController
}

/**
* Crée une commande récurrente.
* Crée un abonnement
*/
public function actionForm(int $id = 0)
{
@@ -131,6 +131,15 @@ class SubscriptionController extends ProducerBaseController
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id]));
}

$subscriptionModule = $this->getSubscriptionModule();
if($id) {
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id);
if(!$subscription) {
$this->setFlash('error', 'Abonnement introuvable');
return $this->redirect(['subscription/index']);
}
}

return $this->render('form', [
'idSubscription' => $id
]);

+ 1
- 1
producer/views/subscription/_form.php 查看文件

@@ -261,7 +261,7 @@ $orderModule = OrderModule::getInstance();
<?php if($idSubscription): ?>
<?php
$subscription = $subscriptionModule->findOneSubscriptionById($idSubscription);
$ordersIncomingSubscriptionArray = $orderModule->findOrdersIncomingBySubscription($subscription);
$ordersIncomingSubscriptionArray = $subscription ? $orderModule->findOrdersIncomingBySubscription($subscription) : null;
?>
<?php if($subscription && $ordersIncomingSubscriptionArray): ?>
<div class="alert alert-warning">

正在加载...
取消
保存