コード例 #1
0
 public function postActivate()
 {
     $values = Request::all();
     $data = fil_product::find($values['id']);
     if ($data == null) {
         return Response::json(array('success' => false, 'data' => 'Producto a restaurar no encontrado'));
     }
     $data->pro_status = 'activo';
     if (!$data->save()) {
         return Response::json(array('success' => false, 'data' => 'Error al restaurar el producto'));
     }
     $response = Response::json(array('success' => true, 'data' => 'Producto restaurado exitosamente'));
     return $response;
 }
コード例 #2
0
 public function postLoadPriceProduct()
 {
     $values = Request::all();
     $product = fil_product::find($values['pro_id']);
     if ($product == null) {
         return Response::json(array('success' => false, 'data' => 'Error al leer los productos'));
     }
     $data = null;
     if ($product->pro_type == 'transmisión') {
         $data = $product->serviceProyection->spy_outlay;
     } else {
         $data = $product->serviceProduction->spr_outlay;
     }
     $response = Response::json(array('success' => true, 'data' => $data, 'type' => $product->pro_type));
     return $response;
 }