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


PHP Service::model方法代码示例

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


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

示例1: run

 public function run()
 {
     $id = Yii::app()->request->getParam('id');
     $name = Yii::app()->request->getParam('name');
     $email = Yii::app()->request->getParam('email');
     $phone = Yii::app()->request->getParam('phone');
     $website = Yii::app()->request->getParam('website');
     $logo = Yii::app()->request->getParam('logo');
     $background = Yii::app()->request->getParam('background');
     $location = Yii::app()->request->getParam('location');
     $hub = Yii::app()->request->getParam('hub');
     $service = Yii::app()->request->getParam('service');
     $facebook = Yii::app()->request->getParam('facebook');
     $linkedin = Yii::app()->request->getParam('linkedin');
     $introduction = Yii::app()->request->getParam('content');
     $data = array('name' => $name, 'email' => $email, 'phone' => $phone, 'website' => $website, 'logo' => $logo, 'background' => $background, 'location' => $location, 'hubId' => $hub, 'serviceid' => $service, 'facebookid' => $facebook, 'linkedinid' => $linkedin, 'introduction' => $introduction);
     $proxy = new BCompany();
     $dp = new BHub();
     $dc = Service::model()->findAll('status!=0');
     if (Yii::app()->request->isAjaxRequest) {
         $result = $proxy->updateCompany($data, $id);
         echo CJSON::encode($result);
     } else {
         $result = $proxy->getCompanyInfo($id);
         $hub = $dp->getHubList($start, 10);
         if ($result['code'] == 200) {
             $this->controller->render('edit', array('data' => $result['data'], 'hub' => $hub['data'], 'service' => $dc));
         } else {
             throw new CHttpException($result['code'], $result['message']);
         }
     }
 }
开发者ID:itliuchang,项目名称:test,代码行数:32,代码来源:EditAction.php

示例2: getOrganName

 public static function getOrganName()
 {
     $organName = Yii::app()->user->getState('organName');
     if ($organName) {
         return $organName;
     }
     //先获取角色身份(生产商/经销商/修理厂)
     $organName = "";
     // $userid = Yii::app()->user->id;
     $userid = Commonmodel::getOrganID();
     $model = self::getIdentity($userid);
     if ($model['identity'] == 1) {
         $organ = MakeOrgan::model()->find('userID=:userid', array(':userid' => $userid));
         $organName = $organ['name'];
     } else {
         if ($model['identity'] == 2) {
             $organ = Dealer::model()->find('userID=:userid', array(':userid' => $userid));
             $organName = $organ['organName'];
         } else {
             if ($model['identity'] == 3) {
                 $organ = Service::model()->find('userId=:userid', array(':userid' => $userid));
                 $organName = $organ['serviceName'];
             }
         }
     }
     Yii::app()->user->setState('organName', $organName);
     return $organName;
 }
开发者ID:zwq,项目名称:unpei,代码行数:28,代码来源:Commonmodel.php

示例3: loadModel

 public function loadModel($id)
 {
     if (($model = Service::model()->findByPk($id)) === null) {
         throw new CHttpException(404, 'Страница не найдена');
     }
     return $model;
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:7,代码来源:ServiceBackendController.php

示例4: run

 public function run()
 {
     $start = Yii::app()->request->getParam('start');
     $dp = new BHub();
     $dc = Service::model()->findAll('status!=0');
     $hub = $dp->getHubList($start, 10);
     $this->controller->render('edit', array('hub' => $hub['data'], 'service' => $dc));
 }
开发者ID:itliuchang,项目名称:test,代码行数:8,代码来源:CreateAction.php

示例5: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $this->_operate($model, 'update');
     $listGames = Games::model()->findAll();
     $listService = Service::model()->findAll();
     $this->render('update', array('model' => $model, 'listGames' => $listGames, 'listService' => $listService));
 }
开发者ID:renlong567,项目名称:YiiYurenGithub,代码行数:13,代码来源:GameserviceController.php

示例6: actionShow

 public function actionShow($alias)
 {
     $model = Service::model()->published()->with(array('slides' => array('scopes' => 'published', 'order' => 'slides.sort ASC')))->findByAlias($alias);
     if (!$model) {
         throw new CHttpException(404);
     }
     $this->render('show', array('model' => $model));
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:8,代码来源:ServiceController.php

示例7: run

 public function run()
 {
     $models = Service::model()->published()->findAll(array('order' => 't.sort ASC'));
     if (empty($models)) {
         return;
     }
     $this->render($this->view, array('models' => $models));
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:8,代码来源:ServicesWidget.php

示例8: getAvailableServices

 public static function getAvailableServices()
 {
     $services = Service::model()->findAll("type <> '{ServiceHelper::TYPE_SMALL_BUSINESS}'");
     $result = array(null => 'Отсутствует');
     foreach ($services as $service) {
         $result[$service->id] = $service->title;
     }
     return $result;
 }
开发者ID:shnellpavel,项目名称:bcgroup_lk,代码行数:9,代码来源:MethodOfCollectionDataHelper.php

示例9: actionSave

 public function actionSave()
 {
     $services = Service::model()->findAllByAttributes(['status' => 0]);
     foreach ($services as $service) {
         $traffic = new Traffic();
         $traffic->attributes = ['uid' => $service->uid, 'email' => $service->email, 'date' => date('Y-m-d', strtotime('yesterday')), 'traffic' => $service->used];
         $traffic->save();
     }
     echo "Success";
 }
开发者ID:syxoasis,项目名称:wakfu-sae,代码行数:10,代码来源:CronController.php

示例10: traffic

 public function traffic()
 {
     $traffic = Service::model()->sum('traffic');
     $serv1 = Service::model()->findByPk(1);
     $serv2 = Service::model()->findByPk(2);
     $traffic -= $serv1->traffic + $serv2->traffic;
     $used = Service::model()->sum('left');
     $left = $traffic - $used;
     $this->response(200, 'success', [['name' => '收益', 'value' => ['总额' => round($traffic / 100 / 1024 * 0.8, 2), '销售' => round($used / 100 / 1024 * 0.8, 2), '库存' => round($left / 100 / 1024 * 0.8, 2)]], ['name' => '已使用', 'value' => $used / 100], ['name' => '未使用', 'value' => $left / 100]]);
 }
开发者ID:syxoasis,项目名称:wakfu-sae,代码行数:10,代码来源:StatisticsAction.php

示例11: run

 public function run($id)
 {
     $community = new CCommunity();
     $result = $community->getCompanyListByService($id);
     $title = Service::model()->findByAttributes(array('id' => $id))->name;
     $this->controller->pageTitle = $title;
     if ($result['code'] == 200) {
         $this->controller->bodyCss = 'whitecolor';
         $this->controller->render('servicescompany', array('list' => $result['data']));
     }
 }
开发者ID:itliuchang,项目名称:test,代码行数:11,代码来源:ServicesCompanyAction.php

示例12: actionDetail

 public function actionDetail($alias)
 {
     $model = $this->loadModelByPKID($alias);
     $this->pageTitle = 'List of Service with type: ' . $model->s_name;
     $models = Service::model()->findAll('s_service_type_id = :s_service_type_id and s_store_id = :s_store_id', array(':s_service_type_id' => $model->pk_s_id, ':s_store_id' => $model->s_store_id));
     if (Yii::app()->request->isAjaxRequest) {
         $this->renderPartial($this->view . 'detail', array('model' => $model, 'models' => $models));
     } else {
         $this->render($this->view . 'detail', array('model' => $model, 'models' => $models));
     }
 }
开发者ID:hson91,项目名称:posnail,代码行数:11,代码来源:ServiceTypeController.php

示例13: getAvailableServices

 public static function getAvailableServices()
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("type <> '{ServiceHelper::TYPE_SMALL_BUSINESS}'");
     $criteria->order = 'title ASC';
     $services = Service::model()->findAll($criteria);
     $res = array(null => 'Отсутствует');
     foreach ($services as $service) {
         $res[$service->id] = $service->title;
     }
     return $res;
 }
开发者ID:shnellpavel,项目名称:bcgroup_lk,代码行数:12,代码来源:SurveyPurposeHelper.php

示例14: actionIndex

 public function actionIndex($alias = '')
 {
     // Загружаем страницу "Услуги"
     Yii::import("application.modules.page.models.Page");
     $page = Page::model()->with(array('slides' => array('scopes' => 'published')))->findByPath("services");
     // Список услуг
     $criteria = new CDbCriteria();
     $criteria->order = 't.sort ASC';
     $models = Service::model()->published()->findAll($criteria);
     // Вывод в шаблон
     $this->render('index', array('models' => $models, 'page' => $page));
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:12,代码来源:ServiceController.php

示例15: run

 public function run()
 {
     $query = $this->request->getQuery('Service', []);
     $model = Service::model();
     $model->attributes = $query;
     $condition = $this->createSearchCriteria($query);
     $pager = new CPagination($model->count($condition));
     $pager->setPageSize(20);
     $condition['offset'] = $pager->getOffset();
     $condition['limit'] = $pager->getLimit();
     $condition['order'] = 'status asc, uid asc';
     $data = $model->findAll($condition);
     $this->render('pac', ['data' => new RedArrayDataProvider($data), 'pager' => $pager, 'model' => $model]);
 }
开发者ID:syxoasis,项目名称:wakfu-sae,代码行数:14,代码来源:PacAction.php


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