namespace backend\controllers; | namespace backend\controllers; | ||||
use common\models\User ; | use common\models\User ; | ||||
use common\helpers\GlobalParam ; | |||||
class DocumentController extends BackendController | class DocumentController extends BackendController | ||||
{ | { | ||||
if ($model->load(Yii::$app->request->post())) { | if ($model->load(Yii::$app->request->post())) { | ||||
$model->id_producer = Producer::getId() ; | |||||
$model->id_producer = GlobalParam::getCurrentProducerId() ; | |||||
$model->reference = $model->generateReference() ; | $model->reference = $model->generateReference() ; | ||||
if($model->save()) { | if($model->save()) { |
$model->setPassword($password); | $model->setPassword($password); | ||||
$model->save() ; | $model->save() ; | ||||
$producer = Producer::getCurrent(); | |||||
$producer = GlobalParam::getCurrentProducer() ; | |||||
Yii::$app->mailer->compose(); | Yii::$app->mailer->compose(); | ||||
$mail = Yii::$app->mailer->compose( | $mail = Yii::$app->mailer->compose( | ||||
['html' => 'newPasswordUserAdmin-html', 'text' => 'newPasswordUserAdmin-text'], ['user' => $model, 'producer' => $producer, 'password' => $password] | ['html' => 'newPasswordUserAdmin-html', 'text' => 'newPasswordUserAdmin-text'], ['user' => $model, 'producer' => $producer, 'password' => $password] |
$query = Invoice::find() | $query = Invoice::find() | ||||
->with($optionsSearch['with']) | ->with($optionsSearch['with']) | ||||
->joinWith($optionsSearch['join_with'], true) | ->joinWith($optionsSearch['join_with'], true) | ||||
->where(['invoice.id_producer' => Producer::getId()]) | |||||
->where(['invoice.id_producer' => GlobalParam::getCurrentProducerId()]) | |||||
->orderBy('invoice.reference DESC') | ->orderBy('invoice.reference DESC') | ||||
; | ; | ||||