|
|
@@ -74,8 +74,8 @@ class OrderController extends ProducerBaseController |
|
|
|
|
|
|
|
public function actionOrder($id = 0, $date = '') |
|
|
|
{ |
|
|
|
|
|
|
|
$params = []; |
|
|
|
$producer = $this->getProducer() ; |
|
|
|
|
|
|
|
if ($id) { |
|
|
|
$order = Order::searchOne([ |
|
|
@@ -91,7 +91,7 @@ class OrderController extends ProducerBaseController |
|
|
|
if (strlen($date)) { |
|
|
|
$distribution = Distribution::searchOne([ |
|
|
|
'date' => $date, |
|
|
|
'id_producer' => GlobalParam::getCurrentProducerId() |
|
|
|
'id_producer' => $producer->id |
|
|
|
]); |
|
|
|
|
|
|
|
if($distribution) { |
|
|
@@ -112,12 +112,14 @@ class OrderController extends ProducerBaseController |
|
|
|
*/ |
|
|
|
public function actionHistory($type = 'incoming') |
|
|
|
{ |
|
|
|
$producer = $this->getProducer() ; |
|
|
|
|
|
|
|
$query = Order::find() |
|
|
|
->with('productOrder', 'pointSale', 'creditHistory') |
|
|
|
->joinWith('distribution', 'distribution.producer') |
|
|
|
->where([ |
|
|
|
'id_user' => Yii::$app->user->id, |
|
|
|
'distribution.id_producer' => GlobalParam::getCurrentProducerId() |
|
|
|
'distribution.id_producer' => $producer->id |
|
|
|
]) |
|
|
|
->params([':date_today' => date('Y-m-d')]); |
|
|
|
|