Procházet zdrojové kódy

Merge branch 'dev'

master
Guillaume před 3 roky
rodič
revize
0f7c825513
2 změnil soubory, kde provedl 13 přidání a 8 odebrání
  1. +13
    -8
      producer/controllers/OrderController.php
  2. +0
    -0
      producer/runtime/.gitignore

+ 13
- 8
producer/controllers/OrderController.php Zobrazit soubor

@@ -170,7 +170,8 @@ class OrderController extends ProducerBaseController
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$order = new Order;
$idProducer = $this->getProducer()->id;
$producer = $this->getProducer() ;
$idProducer = $producer->id;

$posts = Yii::$app->request->post();

@@ -205,6 +206,10 @@ class OrderController extends ProducerBaseController
'email' => $posts['user']['email']
]) ;

if($user) {
$producer->addUser($user->id, $idProducer) ;
}

if(!$user) {
$user = new User ;
$user->id_producer = 0;
@@ -219,16 +224,15 @@ class OrderController extends ProducerBaseController
$user->phone = $posts['user']['phone'];
$user->save() ;

// liaison etablissement / user
$userProducer = new UserProducer();
$userProducer->id_user = $user->id;
$userProducer->id_producer = $idProducer;
$userProducer->credit = 0;
$userProducer->active = 1;
$userProducer->save();
// liaison producer / user
$producer->addUser($user->id, $idProducer) ;

// mail bienvenue
$user->sendMailWelcome($password);
}
else {
$producer->addUser($user->id, $idProducer) ;
}
}

$order = new Order;
@@ -593,6 +597,7 @@ class OrderController extends ProducerBaseController

$distributionsArray = Distribution::searchAll([
'active' => 1
'id_producer' => $producer->id
], [
'conditions' => ['date > :date'],
'params' => [':date' => $dateMini],

+ 0
- 0
producer/runtime/.gitignore Zobrazit soubor


Načítá se…
Zrušit
Uložit