descomentar this consulta
This commit is contained in:
@@ -106,7 +106,7 @@ class ShowPromociones extends Component
|
|||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'nombre_comprarPromo' => 'required',
|
'nombre_comprarPromo' => 'required',
|
||||||
'celular_comprarPromo' => 'required',
|
'celular_comprarPromo' => 'nullable',
|
||||||
'email_comprarPromo' => 'required',
|
'email_comprarPromo' => 'required',
|
||||||
'cantidad_comprarPromo' => 'required|numeric|min:1',
|
'cantidad_comprarPromo' => 'required|numeric|min:1',
|
||||||
];
|
];
|
||||||
@@ -164,7 +164,7 @@ class ShowPromociones extends Component
|
|||||||
$usuario_tarifa = Usuario_promo::where('usuario_id', auth()->user()->id)->where('promocion_id', $id)->first();
|
$usuario_tarifa = Usuario_promo::where('usuario_id', auth()->user()->id)->where('promocion_id', $id)->first();
|
||||||
// dd($usuario_tarifa);
|
// dd($usuario_tarifa);
|
||||||
|
|
||||||
// $this->consulta = $consulta_verpromocion;
|
$this->consulta = $consulta_verpromocion;
|
||||||
|
|
||||||
//Si tiene tarifa personalizada toma el precio, si no tiene da el valor de la tarifa.
|
//Si tiene tarifa personalizada toma el precio, si no tiene da el valor de la tarifa.
|
||||||
$this->precioAhora = ($usuario_tarifa) ? $usuario_tarifa->precio : $consulta_verpromocion->tarifaPromo->first()->precio;
|
$this->precioAhora = ($usuario_tarifa) ? $usuario_tarifa->precio : $consulta_verpromocion->tarifaPromo->first()->precio;
|
||||||
@@ -237,6 +237,8 @@ class ShowPromociones extends Component
|
|||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
$intento++;
|
$intento++;
|
||||||
|
|
||||||
$this->validate();
|
$this->validate();
|
||||||
@@ -284,6 +286,9 @@ class ShowPromociones extends Component
|
|||||||
$historial->utilidad = $this->utilidad * $this->cantidad_comprarPromo;
|
$historial->utilidad = $this->utilidad * $this->cantidad_comprarPromo;
|
||||||
$historial->save();
|
$historial->save();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$utilidad_total = (int) $this->utilidad * (int) $this->cantidad_comprarPromo;
|
$utilidad_total = (int) $this->utilidad * (int) $this->cantidad_comprarPromo;
|
||||||
$this->historial = $historial;
|
$this->historial = $historial;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user