|
|
|
|
|
|
|
|
'id_user' => User::getCurrentId() |
|
|
'id_user' => User::getCurrentId() |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
$json['user'] = false; |
|
|
|
|
|
|
|
|
if($user && !$userProducer) { |
|
|
|
|
|
$userProducer = Producer::addUser($user->id, $producer->id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$json['user'] = false; |
|
|
if ($userProducer) { |
|
|
if ($userProducer) { |
|
|
$json['user'] = [ |
|
|
$json['user'] = [ |
|
|
'address' => $user->address, |
|
|
'address' => $user->address, |
|
|
|
|
|
|
|
|
$product->getAttributes(), |
|
|
$product->getAttributes(), |
|
|
[ |
|
|
[ |
|
|
'unit_coefficient' => Product::$unitsArray[$product->unit]['coefficient'], |
|
|
'unit_coefficient' => Product::$unitsArray[$product->unit]['coefficient'], |
|
|
'prices' => $product->getPriceArray($userProducer->user, $pointSaleCurrent), |
|
|
|
|
|
|
|
|
'prices' => $product->getPriceArray($user, $pointSaleCurrent), |
|
|
'productDistribution' => $product['productDistribution'], |
|
|
'productDistribution' => $product['productDistribution'], |
|
|
'productPointSale' => $product['productPointSale'], |
|
|
'productPointSale' => $product['productPointSale'], |
|
|
] |
|
|
] |