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


PHP Service::find方法代码示例

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


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

示例1: change_template

 public function change_template()
 {
     App::import('Model', 'Service');
     $mService = new Service();
     $service = $mService->find('first', array('conditions' => array('Service.id' => $this->request->data['idService'])));
     echo json_encode($service['Service']);
     die;
 }
开发者ID:manorms,项目名称:MyHouse,代码行数:8,代码来源:ExpensesController.php

示例2: createModel

 public function createModel()
 {
     $model = new Service();
     $criteria = new CDbCriteria();
     $criteria->select = new CDbExpression('MAX(sort) as sort');
     $max = $model->find($criteria);
     $model->sort = $max->sort + 10;
     return $model;
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:9,代码来源:ServiceBackendController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($encadrantId = null, $serviceId = null)
 {
     if (is_null($serviceId)) {
         return Encadrant_Service_Etudiant::join('Service', 'Service.id_Service', '=', 'Encadrant_Service_Etudiant.id_Stage')->select('Service.*')->where('Encadrant_Service_Etudiant.id_Enseignant', '=', $encadrantId)->distinct()->get();
     } else {
         $service = Service::find($serviceId);
         return is_null($stage) ? response()->json(['error' => 'stage Note not found'], HttpResponse::HTTP_NOT_FOUND) : $service;
     }
 }
开发者ID:S4M37,项目名称:Project_GangOfThree,代码行数:15,代码来源:StageController.php

示例4: getInfos

 /**
  * Infos pop-up clic marqueur bus
  */
 public function getInfos()
 {
     $infoBus = Service::find(Input::get('service'));
     $ligne = $infoBus->ligne;
     $service = $infoBus->service;
     $heure = date('H:i:s');
     $arretSuivant = Horaire::getNextArret($heure, $service);
     return Response::json($arretSuivant);
 }
开发者ID:Adelinegen,项目名称:Linea,代码行数:12,代码来源:PlanController.php

示例5: edit

 public static function edit($id)
 {
     $service = Service::find($id);
     //        $offeredServices = OfferedServices::findByService($id);
     $employees = Employee::all();
     //
     $employeeList = OfferedServicesController::getEmployees($id, $employees);
     View::make('service/edit.html', array('attributes' => $service, 'employeeList' => $employeeList, 'employees' => $employees));
 }
开发者ID:Zonsu,项目名称:Tsoha-Bootstrap,代码行数:9,代码来源:service_controller.php

示例6: connectServiceWithLocation

 /**
  * Creates a relation between a specific Advisor and a specific Location
  *
  * @var array
  */
 public function connectServiceWithLocation($services, $advisor_id, $location_id)
 {
     foreach ($services as $service_id) {
         $advisor = Advisor::find($advisor_id);
         $advisor->services()->attach($service_id);
         $service = Service::find($service_id);
         $service->locationsWithAdvisor()->attach($location_id, ['advisor_id' => $advisor_id]);
     }
     return $services;
 }
开发者ID:hvent90,项目名称:service-booker,代码行数:15,代码来源:Service.php

示例7: getInfo

 /**
  * 获取服务信息
  *
  * @return object
  */
 public static function getInfo($id, $key = 'name')
 {
     if (!$id) {
         return '<font color="grey">无此服务</font>';
     }
     $service = Service::find($id);
     if (empty($service)) {
         return '<font color="grey">无此服务</font>';
     }
     return $service->{$key};
 }
开发者ID:astronautyan,项目名称:O2OMobile_PHP,代码行数:16,代码来源:Service.php

示例8: myserviceToHtml

 /**
  * 我的服务转换为html
  *
  * @return string
  */
 public function myserviceToHtml()
 {
     if (!$this->services_id) {
         return '<font color="grey">无</font>';
     }
     $services = Service::find($this->services_id);
     if (empty($services)) {
         return '<font color="grey">无此服务</font>';
     }
     $class = 'badge-default';
     $text = $services->name;
     return "<span class=\"badge {$class}\">{$text}</span>";
 }
开发者ID:astronautyan,项目名称:O2OMobile_PHP,代码行数:18,代码来源:MyService.php

示例9: addToCart

 function addToCart()
 {
     if (!Input::get('option')) {
         return Redirect::to('order');
     }
     if (!Input::get('cycle')) {
         return Redirect::to('order');
     }
     $option = ServiceOption::find(Input::get('option'));
     $service = Service::find($option->service_id);
     $cycle = BillingCycle::find(Input::get('cycle'));
     Cart::insert(array('id' => $option->id, 'name' => $service->name . ' ' . $option->option_name, 'price' => $option->base_price, 'quantity' => $cycle->cycle));
     return Redirect::to('order');
 }
开发者ID:carriercomm,项目名称:saaspanel,代码行数:14,代码来源:OrderController.php

示例10: sandbox

 public static function sandbox()
 {
     $service = Service::find(1);
     $services = Service::all();
     $employees = Employee::all();
     $employee = Employee::find(1);
     $service2 = new Service(array('name' => 'aasdd', 'price' => "2", 'description' => "asfafaf"));
     $errors = $service2->errors();
     Kint::dump($employee);
     Kint::dump($employees);
     Kint::dump($service);
     Kint::dump($services);
     Kint::dump($errors);
     //        View::make('helloworld.html');
 }
开发者ID:Zonsu,项目名称:Tsoha-Bootstrap,代码行数:15,代码来源:hello_world_controller.php

示例11: update

 private function update($tabla)
 {
     switch ($tabla) {
         case 'Service':
             $service = Service::update($service_id, array('driver_id' => $driver_id, 'status_id' => "2", 'car_id' => $driver_tmp->car_id));
             $this->servicio = Service::find($this->servicio_id);
             $this->validar($service);
             break;
         case 'Driver':
             $driver = Driver::update($this->driver_id, array("available" => "0"));
             $this->conductor = Driver::find($this->conductor_id);
             $this->validar($driver);
             break;
     }
 }
开发者ID:hammer92,项目名称:Gravility.local,代码行数:15,代码来源:CodingController.php

示例12: saveModel

 /**
  * [saveModel - saves ou model info to the DB]
  * @param  boolean $service [description]
  * @return [Eloquent model] [service eloquent model]
  */
 protected function saveModel($service = false)
 {
     if (Input::get('id')) {
         $service = Service::find(Input::get('id'));
     }
     if (!$service) {
         $service = new Service();
     }
     $load_company_model = $service->companies;
     $service->name = Input::get('name');
     $service->category_id = Input::get('category_id');
     $service->status_id = Input::get('status_id');
     $service->invoice_periods_id = Input::get('invoice_periods_id');
     $service->default_monthly_costs = Input::get('default_monthly_costs');
     $service->comment = Input::get('comment');
     $service->save();
     return $service;
 }
开发者ID:strikles,项目名称:php,代码行数:23,代码来源:AdminServiceController.php

示例13: delete

 public function delete()
 {
     if (Request::ajax()) {
         $data['response'] = 'error';
         $data['content'] = "Item cannot be deleted.";
         $id = Input::get('service_id');
         $package = Package::where('service_id', '=', $id)->count();
         if ($package == 0) {
             $service = Service::find($id);
             $service->delete();
             $data['response'] = 'ok';
             $data['content'] = "Item was successfully deleted.";
         }
         $response = Response::make(json_encode($data), 200);
         $response->header('Content-Type', 'text/json');
         return $response;
     }
 }
开发者ID:jacobDaeHyung,项目名称:PHPLaravelGymManagementSystem,代码行数:18,代码来源:ServicesController.php

示例14: generalAction

 /**
  *
  */
 public function generalAction()
 {
     $dataRequest = $this->request->getJsonPost();
     $fields = array("key", "platform");
     if ($this->_checkFields($dataRequest, $fields)) {
         if ($this->_validKey()) {
             $services = Service::find();
             $return = array();
             $categories = array();
             foreach ($services as $item) {
                 $categories = array();
                 foreach ($item->ServiceCategory as $item2) {
                     $categories[] = array("id" => $item->getId(), "name" => utf8_encode($item2->getName()), "description" => utf8_encode($item2->getDescription()), "image" => $item2->getImage(), "video" => $item2->getVideo());
                 }
                 $return[] = array("id" => $item->getId(), "name" => utf8_encode($item->getName()), "description" => utf8_encode($item->getDescription()), "image" => $item->getImage(), "categories" => $categories);
             }
             $this->setJsonResponse(ControllerBase::SUCCESS, ControllerBase::FAILED_MESSAGE, array("status" => $this->strings->getString("http", "success"), "message" => $this->strings->getString("platform", "success"), "data" => $return));
         }
     }
 }
开发者ID:phalcondroid,项目名称:spapp_phalcon,代码行数:23,代码来源:ApiController.php

示例15: getTimeSlot

 public function getTimeSlot($service_id)
 {
     Activity::log(['contentId' => $service_id, 'contentType' => 'Outlet', 'action' => 'getTimeSlot', 'description' => 'getTimeSlot of Service', 'details' => 'Service Id: ' . $service_id, 'updated' => false]);
     $service = Service::find($service_id);
     $outlet = Outlet::find($service->outlet_id);
     $startTime = explode(':', $outlet->startTime);
     $endTime = explode(':', $outlet->endTime);
     if (count($startTime) < 2 || count($endTime) < 2) {
         return array();
     }
     $start = mktime($startTime[0], $startTime[1], 0, 8, 12, 2014);
     $end = mktime($endTime[0], $endTime[1], 0, 8, 12, 2014);
     $hourArray = array();
     $count = 1;
     $hourArray[] = $start;
     while ($start < $end && $count < 1000) {
         $date = $start + $service->time_operate * 60;
         $hourArray[] = $date;
         $start = $date;
         $count++;
     }
     return $hourArray;
 }
开发者ID:EricBui0512,项目名称:FYP,代码行数:23,代码来源:OutletRepository.php


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