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


PHP Region::find方法代码示例

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


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

示例1: prepareMailData

 protected function prepareMailData()
 {
     $product = Tree::find($this->getPreparedItem('id_catalog'));
     $city = City::find($this->getPreparedItem('id_city'));
     if ($city) {
         $region = Region::find($city->id_region);
     }
     //$occupation = Occupation::find($this->getPreparedItem('id_occupation'));
     $this->setMessageSubject('Заявка на услугу: ' . $product->title_ru);
     $this->appendMessageBody("<html><body>");
     $this->appendMessageBody("<p><b>Заявка на услугу:</b> " . $product->title_ru . "</p>");
     $this->appendMessageBody("<p><b>Фамилия:</b> " . $this->getPreparedItem('last_name') . "</p>");
     $this->appendMessageBody("<p><b>Имя:</b> " . $this->getPreparedItem('first_name') . "</p>");
     $this->appendMessageBody("<p><b>Отчество:</b> " . $this->getPreparedItem('patronymic_name') . "</p>");
     //$this->appendMessageBody("<p><b>Занятость:</b> ". $occupation->title_ru ."</p>");
     $this->appendMessageBody("<p><b>Email:</b> " . $this->getPreparedItem('email') . "</p>");
     $this->appendMessageBody("<p><b>Контактный телефон:</b> " . $this->getPreparedItem('phone_number') . "</p>");
     if (isset($region) && $region) {
         $this->appendMessageBody("<p><b>Область:</b> " . $region->title_ru . "</p>");
     }
     $this->appendMessageBody("<p><b>Город:</b> " . $city->title_ru . "</p>");
     $this->appendMessageBody("<p><b>Клиент банка:</b> " . ($this->getPreparedItem('is_bank_client') ? 'Да' : 'Нет') . "</p>");
     if ($this->getPreparedItem('partner_code')) {
         $this->appendMessageBody("<p><b>Код партнера:</b> " . $this->getPreparedItem('partner_code') . "</p>");
     }
     $this->appendMessageBody("<html><body>");
 }
开发者ID:OlesKashchenko,项目名称:SkillsProject1,代码行数:27,代码来源:ApplyFormSmallBusinessEquiring.php

示例2: editAction

 public function editAction($dealerId = NULL)
 {
     $this->view->setVar("title", "Редагування дилера");
     $user = $this->session->get("user");
     $methodistBrands = \BrandsMethodists::find("user_id=" . $user->id)->toArray();
     $methodistActivities = \ActivitiesMethodists::find("user_id=" . $user->id)->toArray();
     $dealer = $dealerId ? \Dealers::findFirst($dealerId) : new \Dealers();
     if ($dealerId and !$dealer->id) {
         // не найден такой диллер
         $this->view->pick("dealer/not-found");
         return;
     }
     $city = $dealer->City;
     $this->view->regionId = $city ? $city->Region->id : NULL;
     $dealerBrands = $dealer->id ? $dealer->DealersBrands->toArray() : array();
     $dealerActivities = $dealer->id ? \DealersActivities::find("dealer_id=" . $dealer->id)->toArray() : array();
     $this->view->dealers = \Dealers::find(array('order' => 'title'));
     $this->view->regions = \Region::find();
     $this->view->regionFirst = $this->view->regions[0];
     $this->view->cities = \City::find();
     $this->view->staffListGroup = \StafflistGroup::find();
     $this->view->brands = BrandsService::getForChosenEntity(\Brands::find()->toArray(), $methodistBrands, $dealerBrands);
     $this->view->activities = ActivitiesService::getForChosenEntity(\Activities::find()->toArray(), $methodistActivities, $dealerActivities);
     $this->view->dealerStatuses = \DealerStatuses::find();
     $controllers = \Users::query()->rightJoin("UserGroups")->where("UserGroups.group_id = 3")->execute();
     $this->view->controllers = $controllers;
     $this->view->dealerControllers = $dealer->DealersControllers;
     $this->view->dealer = $dealer;
     $this->view->saved = $this->request->get("saved");
 }
开发者ID:sergeytkachenko,项目名称:angular-gulp-phalcon,代码行数:30,代码来源:DealerController.php

示例3: processRegion

 public function processRegion($patientquery, $visitquery, $value, $title = "")
 {
     if ($value != "all") {
         $title .= " From " . Region::find($value)->region . " Region ";
         $patientquery->whereIn('id', PatientReport::where('region', $value)->get()->lists('patient_id') + array('0'));
         $visitquery->whereIn('id', PatientInfo::where('region', $value)->get()->lists('visit_id') + array('0'));
     }
     return array($patientquery, $visitquery, $title);
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:9,代码来源:BaseController.php

示例4: sendSibelForm

 protected function sendSibelForm()
 {
     // fixme:
     $city = City::find($this->getPreparedItem('id_city'));
     if ($city) {
         $region = Region::find($city->id_region);
         $area = Area::find($region->id_area);
     }
     $client = new SibelClient();
     $client->setLastName($this->preparedData['last_name']);
     $client->setFirstName($this->preparedData['first_name']);
     $client->setMiddleName($this->preparedData['patronymic_name']);
     $client->setPhone($this->preparedData['phone_number']);
     $client->setProject($this->getSibelProject());
     $client->setCreatedDate(date('Y-m-d H:i:s'));
     if (isset($area) && $area && $city) {
         $client->setDescription($area->title_ru);
         $client->setComment($city->title_ru);
     }
     $orderCode = $client->registerShortApplication();
     $this->preparedData['sibel_request'] = $client->getXml();
     $this->preparedData['sibel_response'] = $orderCode;
 }
开发者ID:OlesKashchenko,项目名称:SkillsProject1,代码行数:23,代码来源:ApplyFormSmallBusinessDeposit.php

示例5: check_region1

 public function check_region1($id)
 {
     if ($id == "all") {
         return Form::select('district', array('all' => 'all') + District::lists('district', 'id'), '', array('class' => 'form-control', 'required' => 'requiered'));
     } else {
         return Form::select('district', array('all' => 'all') + Region::find($id)->district()->lists('district', 'id'), '', array('class' => 'form-control', 'required' => 'requiered'));
     }
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:8,代码来源:PatientController.php

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $simulation = Simulation::find($id);
     if (Input::has('caption')) {
         $simulation->Caption = Input::get('caption');
     }
     $simulation->save();
     if (Input::has('Combination_Id')) {
         $simulation->Combination_Id = Input::get('Combination_Id');
         $simulation->save();
         $this->rebuild($simulation->Id);
     }
     foreach ($simulation->Parameters as $parameter) {
         if (Input::has('parameters-' . $parameter->Id)) {
             $parameter->pivot->ValueSet = Input::get('parameters-' . $parameter->Id);
             $parameter->pivot->save();
         }
     }
     if (Input::get('new-parameter-name') && Input::get('new-parameter-value') != '') {
         $parameter = Parameter::whereName(Input::get('new-parameter-name'))->first();
         if ($parameter) {
             $simulation->Parameters()->attach($parameter, ["ValueSet" => Input::get('new-parameter-value')]);
             $simulation->save();
         }
     }
     foreach ($simulation->SimulationNeedles as $simulationNeedle) {
         foreach ($simulationNeedle->Parameters as $parameter) {
             if (Input::has('needle-parameters-' . $simulationNeedle->Id . '-' . $parameter->Id)) {
                 $parameter->pivot->ValueSet = Input::get('needle-parameters-' . $simulationNeedle->Id . '-' . $parameter->Id);
                 $parameter->pivot->save();
             }
         }
         $newparameterprefix = 'needle-' . $simulationNeedle->Id . '-new-parameter-';
         if (Input::get($newparameterprefix . 'name') && Input::get($newparameterprefix . 'value') != '') {
             $parameter = Parameter::whereName(Input::get($newparameterprefix . 'name'))->first();
             if ($parameter) {
                 $simulationNeedle->Parameters()->attach($parameter, ["ValueSet" => Input::get($newparameterprefix . 'value')]);
                 $simulationNeedle->save();
             }
         }
     }
     if (Input::get('removing')) {
         if (Input::get('simulation-needle-id')) {
             $simulationNeedle = SimulationNeedle::find(Input::get('simulation-needle-id'));
             $simulationNeedle->delete();
         }
         if (Input::get('region-remove-id')) {
             $region = Region::find(Input::get('region-remove-id'));
             if (Input::get('region-remove-location')) {
                 $simulation->Regions()->newPivotStatementForId($region->Id)->where('Location', '=', Input::get('region-remove-location'))->delete();
             } else {
                 $simulation->Regions()->newPivotStatementForId($region->Id)->whereNull('Location')->delete();
             }
         }
     } else {
         if (Input::get('needle-id')) {
             $needle = Needle::find(Input::get('needle-id'));
             $simulationNeedle = new SimulationNeedle();
             $simulationNeedle->Simulation_Id = $simulation->Id;
             $simulationNeedle->Needle_Id = $needle->Id;
             $target = json_decode(Input::get('needle-target'));
             $simulationNeedle->Target_Id = PointSet::create(['X' => $target[0], 'Y' => $target[1], 'Z' => $target[2]])->Id;
             $entry = json_decode(Input::get('needle-entry'));
             $simulationNeedle->Entry_Id = PointSet::create(['X' => $entry[0], 'Y' => $entry[1], 'Z' => $entry[2]])->Id;
             $simulationNeedle->save();
         }
         if (Input::get('region-id')) {
             $region = Region::find(Input::get('region-id'));
             $simulation->Regions()->attach($region, ['Location' => Input::get('region-location')]);
             $simulation->save();
         }
     }
     return Redirect::route('simulation.edit', $id);
 }
开发者ID:philtweir,项目名称:glossia-scratch-test-site,代码行数:80,代码来源:SimulationController.php


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