当前位置: 首页>>代码示例>>PHP>>正文


PHP Cliente::select方法代码示例

本文整理汇总了PHP中Cliente::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Cliente::select方法的具体用法?PHP Cliente::select怎么用?PHP Cliente::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cliente的用法示例。


在下文中一共展示了Cliente::select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 function login(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $data = json_decode($request->getBody(), true);
     $cont = 0;
     $std = 0;
     $roles = array();
     $dataCliente = Cliente::select("email", "nombres", "apellidos")->where('email', '=', $data['usuario'])->where('pass', '=', $data['pass'])->first();
     if ($dataCliente != null) {
         $cont++;
         array_push($roles, "cliente");
     }
     $dataEmpresa = Empresa::select("email", "nombre", "foto")->where('email', '=', $data['usuario'])->where('pass', '=', $data['pass'])->first();
     if ($dataEmpresa != null) {
         $cont++;
         array_push($roles, "empresa");
     }
     $dataUsuario = Usuario::select("id", "nombres", "apellidos", "idSucursal", "idCategoria")->where('id', '=', $data['usuario'])->where('pass', '=', $data['pass'])->first();
     if ($dataUsuario != null) {
         $cont++;
         array_push($roles, "usuario");
     }
     if ($cont > 0) {
         $response = $response->withStatus(200);
         $std = 1;
     } else {
         $response = $response->withStatus(404);
     }
     $response->getBody()->write(json_encode(array("std" => $std, "roles" => $roles)));
     return $response;
 }
开发者ID:giocni93,项目名称:BuscaloApi,代码行数:31,代码来源:UsuarioControl.php

示例2: general

 public function general()
 {
     $totalClientes = Cliente::select(DB::raw("count(*) as total"))->first();
     $totalClientesDeudores = Cliente::select(DB::raw("count(*) as total"))->where('saldo', '>', 0)->first();
     $totalClientesDeudoresPasados = Cliente::select(DB::raw("count(*) as total"))->where('saldo', '>', 1000)->where('saldo', '>', 0)->first();
     $totalDeuda = Cliente::select(DB::raw('sum(saldo) as total'))->where('saldo', '>', 0)->first();
     $data['totalClientes'] = $totalClientes->total;
     $data['totalClientesDeudores'] = $totalClientesDeudores->total;
     $data['totalClientesDeudoresPasados'] = $totalClientesDeudoresPasados->total;
     $data['totalDeuda'] = $totalDeuda->total;
     return View::make('reportes.general', compact('data'));
 }
开发者ID:nelug,项目名称:ControlDePlanilla,代码行数:12,代码来源:ReporteController.php

示例3: exportarEmail

 public function exportarEmail()
 {
     Excel::create('Clientes' . date('Ymd'), function ($excel) {
         $excel->sheet('Clientes', function ($sheet) {
             $clientes = Cliente::select('email')->distinct()->get();
             $datos = array(array('Email'));
             foreach ($clientes as $cliente) {
                 array_push($datos, array($cliente->email));
             }
             $sheet->fromModel($datos, null, 'A1', false, false);
             $sheet->row(1, function ($row) {
                 // call cell manipulation methods
                 $row->setFontWeight('bold');
             });
         });
     })->download('xls');
 }
开发者ID:tatu-carreta,项目名称:mariasanti_v2,代码行数:17,代码来源:ClienteController.php

示例4: getIdPushByPeticionCliente

 public function getIdPushByPeticionCliente($id)
 {
     $data = Cliente::select("cliente.email", "cliente.idPush", "peticion.nombre as nombrePeticion")->join("peticion", "cliente.email", "=", "peticion.idCliente")->where("peticion.id", "=", $id)->first();
     return $data;
 }
开发者ID:giocni93,项目名称:BuscaloApi,代码行数:5,代码来源:ClienteControl.php

示例5: validarcorreo

 function validarcorreo(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $response = $response->withStatus(200);
     $correo = $request->getAttribute("email");
     $data = Cliente::select("email")->where('email', '=', $correo)->first();
     if ($data != null) {
         $respuesta = json_encode(array("std" => 1, "msg" => "Este correo ya esta registrado"));
     } else {
         $respuesta = json_encode(array("std" => 0, "msg" => "Este correo esta disponible"));
     }
     $response->getBody()->write($respuesta);
     return $response;
 }
开发者ID:giocni93,项目名称:Apiturno,代码行数:14,代码来源:ClienteControl.php

示例6: postReservaAnonimo

 public function postReservaAnonimo(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $data = json_decode($request->getBody(), true);
     //VALIDAR SI EL CLIENTE EXISTE
     $cli = Cliente::select("id")->where("email", "=", $data["email"])->first();
     $idCliente = "";
     if ($cli == null) {
         try {
             $cliente = new Cliente();
             $cliente->email = $data['email'];
             $cliente->nombres = $data['nombres'];
             $cliente->apellidos = $data['apellidos'];
             $cliente->telefono = "";
             $cliente->pass = sha1($data['email']);
             $cliente->estado = "ACTIVO";
             $cliente->save();
             $idCliente = $cliente->id;
         } catch (Exception $err) {
         }
     } else {
         $idCliente = $cli->id;
     }
     //INSERTAR TURNO
     try {
         $turno = new Turno();
         $turno->idCliente = $idCliente;
         $turno->idEmpleado = $data['idEmpleado'];
         $turno->idSucursal = $data['idSucursal'];
         $turno->idServicio = $data['idServicio'];
         $turno->tiempo = 0;
         $turno->turno = 0;
         $turno->turnoReal = 0;
         $turno->tipoTurno = 1;
         $turno->estadoTurno = "SOLICITADO";
         $turno->estado = "ACTIVO";
         $turno->reserva = "A";
         $turno->fechaReserva = $data['fechaReserva'];
         $turno->horaReserva = $data['horaReserva'];
         $horaInicial = $data['horaReserva'];
         for ($i = 0; $i < $data["cupos"]; $i++) {
             $segundos_horaInicial = strtotime($horaInicial);
             $segundos_minutoAnadir = $data["minutos"] * 60;
             $nuevaHora = date("H:i", $segundos_horaInicial + $segundos_minutoAnadir);
             $horaInicial = $nuevaHora;
         }
         $turno->horaFinalReserva = $nuevaHora;
         $turno->save();
         $respuesta = json_encode(array('msg' => "Guardado correctamente", "std" => 1, "numeroTurno" => $turnoSiguiente));
         $response = $response->withStatus(200);
         //ENVIAR NOTIFICACION AL EMPLEADO Y AL ADMINISTRADOR DE LA SUCURSAL
     } catch (Exception $err) {
         $respuesta = json_encode(array('msg' => "error al pedir el turno", "std" => 0, "err" => $err->getMessage()));
         $response = $response->withStatus(404);
     }
     $response->getBody()->write($respuesta);
     return $response;
 }
开发者ID:giocni93,项目名称:Apiturno,代码行数:58,代码来源:TurnoControl.php


注:本文中的Cliente::select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。