소스 검색

Refactoring CreditHistory #881

refactoring
Guillaume Bourgeois 1 년 전
부모
커밋
70ef63c454
4개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. +3
    -2
      common/models/CreditHistorySearch.php
  2. +4
    -4
      common/models/Product.php
  3. +1
    -1
      producer/controllers/CreditController.php
  4. +3
    -1
      producer/controllers/ProducerBaseController.php

+ 3
- 2
common/models/CreditHistorySearch.php 파일 보기

@@ -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'])

+ 4
- 4
common/models/Product.php 파일 보기

@@ -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;
}

+ 1
- 1
producer/controllers/CreditController.php 파일 보기

@@ -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();


+ 3
- 1
producer/controllers/ProducerBaseController.php 파일 보기

@@ -38,7 +38,9 @@ termes.

namespace producer\controllers;

class ProducerBaseController extends CommonController
use common\controllers\CommonController;

class ProducerBaseController extends CommonController
{

var $producer ;

Loading…
취소
저장