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


PHP Company::model方法代码示例

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


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

示例1: actionEdit

 public function actionEdit($id = false)
 {
     if ($id) {
         $model = Company::model()->findByPk($id);
     } else {
         $model = Company::getCompany();
     }
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'company-form') {
         echo UActiveForm::validate(array($model));
         Yii::app()->end();
     }
     if (isset($_POST['Company'])) {
         $model->attributes = $_POST['Company'];
         $model->fileupload = CUploadedFile::getInstance($model, 'fileupload');
         $model->iconupload = CUploadedFile::getInstance($model, 'iconupload');
         if ($model->validate()) {
             $model->save();
             Yii::app()->user->setFlash('companySuccessMessage', ProjectModule::t('Successfully updated'));
             //$this->redirect(array('/user/profile'));
         } else {
             Yii::app()->user->setFlash('companyErrorMessage', ProjectModule::t('Something wrong'));
         }
     }
     //Yii::app()->theme = 'admin';
     $this->render('edit', array('model' => $model, 'root' => User::model()->getUserRole() == 'root'));
 }
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:26,代码来源:CompanyController.php

示例2: up

 public function up()
 {
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->update($company->prefix . 'transactionType', array("name" => "Supplier Invoice"), "id=2");
     }
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:7,代码来源:m161112_102024_0006.php

示例3: run

 public function run($id = null, $page = 1, $size = 2)
 {
     $this->controller->pageTitle = "Profile";
     if (Yii::app()->request->isAjaxRequest) {
         if (!$id) {
             $id = Yii::app()->user->id;
         }
         $post = new CPost();
         $result = $post->getProfileList($id, $page, $size);
         echo CJSON::encode(array('code' => 200, 'mes' => 'success', 'data' => array('list' => $result['data'])));
     } else {
         if ($id) {
             $user = User::model()->with('companyid')->findByAttributes(array('id' => $id));
             $company = Company::model()->findByAttributes(array('ownerId' => $user['id']));
             $location = Hub::model()->findByAttributes(array('id' => $company['location']));
             $post = new CPost();
             $postlist = $post->getProfileList($id);
         } else {
             $id = Yii::app()->user->id;
             $user = User::model()->with('companyid')->findByAttributes(array('id' => $id));
             $company = Company::model()->findByAttributes(array('ownerId' => $user['id']));
             $location = Hub::model()->findByAttributes(array('id' => $company['location']));
             $post = new CPost();
             $postlist = $post->getProfileList($id);
         }
         $this->controller->render('profile', array('user' => $user, 'companylocation' => $location['location'], 'postlist' => $postlist['data']));
     }
 }
开发者ID:itliuchang,项目名称:test,代码行数:28,代码来源:ProfileAction.php

示例4: actionIndex

 public function actionIndex()
 {
     $criteria = new CDbCriteria();
     // 创建CDbCriteria对象
     $criteria->condition = "(style & 2) !=0";
     // 设置查询条件
     $cheap = Route::model()->findAll($criteria);
     $criteria->condition = '(style&4) !=0';
     $hot = Route::model()->findAll($criteria);
     $area = Area::model()->findAll();
     $criteria1 = new CDbCriteria();
     // 创建CDbCriteria对象
     $criteria1->select = "title";
     // 设置查询条件
     $criteria1->limit = 8;
     $diary = Diary::model()->findAll($criteria1);
     $continent = Continent::model()->findAll();
     $boat = Boat::model()->findAll();
     //var_dump($continent);
     $this->g_area = $area;
     $this->g_continent = $continent;
     $this->g_company = Company::model()->findAll();
     $year = date("Y");
     $month = date('n');
     $arr = array();
     for ($i = $month; $i <= 12; $i++) {
         array_push($arr, $year . '年' . $i . '月');
     }
     $year += 1;
     for ($i = 1; $i <= 12; $i++) {
         array_push($arr, $year . '年' . $i . '月');
     }
     $this->g_data = $arr;
     $this->render('index', array('hot' => $hot, 'cheap' => $cheap, 'area' => $area, 'diary' => $diary, 'continent' => $continent, 'boat' => $boat));
 }
开发者ID:rocketyang,项目名称:yii2,代码行数:35,代码来源:HomeController.php

示例5: run

 public function run($args)
 {
     $companies = Company::model()->findAll('frozen=:p AND telfin_id<>:t', array(':p' => '0', ':t' => ''));
     foreach ($companies as $company) {
         Company::setActive($company);
         Yii::app()->language = Company::getLanguage();
         //User::model()->refreshMetaData();
         /*AuthAssignment::model()->refreshMetaData();
         		ProfileField::model()->refreshMetaData();
         		Profile::model()->refreshMetaData();
         		Zakaz::model()->refreshMetaData();
         		ZakazParts::model()->refreshMetaData();
         		Events::model()->refreshMetaData();*/
         //self::executor();
         //self::manager();
         //echo '=)';
         Yii::app()->cdr->init('cron');
         CrmCdr::model()->refreshMetaData();
         // Проверим нет ли сохраненного токена в сессии
         // Работу с сессией вынес в прикладной код, потому что врапер может вызываться из командной строки
         //Yii::app()->cdr->cookie2token();
         // Обновим данные из Телфина
         Yii::app()->cdr->refresh();
         // Сохраним токен в сессии есть есть что сохранять
         //Yii::app()->cdr->token2cookie();
     }
 }
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:27,代码来源:TelfinCommand.php

示例6: init

 public function init()
 {
     /*
               if(!isset(Yii::app()->user->Company)){
               Yii::app()->user->setState('Company',0);
               } */
     Yii::log("Selected Company ID: " . Yii::app()->user->Company, 'info', 'app');
     if (Yii::app()->user->Company == 0) {
         if (Yii::app()->controller->id != 'company') {
             //print "'".Yii::app()->controller->id."'";
             $this->redirect(Yii::app()->createAbsoluteUrl('company/index'));
             Yii::app()->end();
         } else {
             Yii::app()->db->setActive(false);
             Yii::app()->db->connectionString = Yii::app()->dbMain->connectionString;
             Yii::app()->db->tablePrefix = Yii::app()->dbMain->tablePrefix;
             Yii::app()->db->username = Yii::app()->dbMain->username;
             Yii::app()->db->password = Yii::app()->dbMain->password;
             Yii::app()->db->setActive(true);
         }
     } else {
         //hasAccess!
         $this->company = Company::model()->findByPk(Yii::app()->user->Company);
         Company::model()->loadComp($this->company);
     }
     //*/
     return parent::init();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:28,代码来源:RightsController.php

示例7: run

 /**
  * Запуск виджета
  */
 public function run()
 {
     $insurences = array();
     $deliveries = array();
     $customes = array();
     if ($this->insurence_count != 0) {
         $criteria = new CDbCriteria();
         $criteria->condition = 't.insurance_desc !="0"';
         $criteria->limit = 5;
         $insurences_all = Company::model()->findAll($criteria);
         $cnt = count($insurences_all) - 1;
         if ($cnt <= $this->insurence_count) {
             $insurences = $insurences_all;
         } else {
             for ($i = 0; $i <= $this->insurence_count; $i++) {
                 $random = rand(0, $cnt - $i);
                 $insurences[] = $insurences_all[$random];
                 unset($insurences_all[$random]);
                 $insurences_all = array_values($insurences_all);
             }
         }
     }
     if ($this->delivery_count != 0) {
         $criteria = new CDbCriteria();
         $criteria->condition = 't.delivery_desc !="0"';
         $criteria->limit = 5;
         $deliveries_all = Company::model()->findAll($criteria);
         $cnt = count($deliveries_all) - 1;
         if ($cnt <= $this->delivery_count) {
             $deliveries = $deliveries_all;
         } else {
             for ($i = 0; $i <= $this->delivery_count; $i++) {
                 //echo $cnt;die();
                 $random = rand(0, $cnt - $i);
                 $deliveries[] = $deliveries_all[$random];
                 unset($deliveries_all[$random]);
                 $deliveries_all = array_values($deliveries_all);
             }
         }
     }
     if ($this->customes_count != 0) {
         $criteria = new CDbCriteria();
         $criteria->condition = 't.customs_desc !="0"';
         $criteria->limit = 5;
         $customes_all = Company::model()->findAll($criteria);
         $cnt = count($customes_all) - 1;
         if ($cnt <= $this->customes_count) {
             $customes = $customes_all;
         } else {
             for ($i = 0; $i <= $this->customes_count; $i++) {
                 $random = rand(0, $cnt - $i);
                 $customes[] = $customes_all[$random];
                 unset($customes_all[$random]);
                 $customes_all = array_values($customes_all);
             }
         }
     }
     $this->render('index', ['insurences' => $insurences, 'deliveries' => $deliveries, 'customes' => $customes]);
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:62,代码来源:RecommendationCompanyWidget.php

示例8: down

 public function down()
 {
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->update($company->prefix . 'docStatus', array("action" => "1"), "num=2 AND doc_type=4");
     }
     return true;
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:8,代码来源:m171114_102025_0008.php

示例9: down

 public function down()
 {
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->dropColumn($company->prefix . 'files', 'hidden');
     }
     return true;
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:8,代码来源:m171114_102024_0007.php

示例10: actionViewCompDetails

 public function actionViewCompDetails($c_id)
 {
     $model = Company::model()->findByPk($c_id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $this->render('viewCompDetails', array('model' => $model));
 }
开发者ID:shobhit6993,项目名称:Placement-Portal,代码行数:8,代码来源:OfferController.php

示例11: down

 public function down()
 {
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->delete($company->prefix . 'paymentType', "id=7");
     }
     return true;
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:8,代码来源:m301116_101214_0018.php

示例12: actionCreatedetail

 public function actionCreatedetail()
 {
     $sodetail = new Sodetail();
     if (Yii::app()->request->isAjaxRequest) {
         echo CJSON::encode(array('status' => 'success', 'currencyid' => Company::model()->getcurrencyid(), 'currencyname' => Company::model()->getcurrencyname(), 'divcreate' => $this->renderPartial('_formdetail', array('model' => $sodetail), true)));
         Yii::app()->end();
     }
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:8,代码来源:SoheaderController.php

示例13: up

 public function up()
 {
     return true;
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->alterColumn($company->prefix . 'transactions', "valuedate", 'TIMESTAMP NOT NULL DEFAULT "0000-00-00 00:00:00"');
         $this->alterColumn($company->prefix . 'transactions', "date", "TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
     }
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:9,代码来源:m301116_071214_0016.php

示例14: up

 public function up()
 {
     //return false;
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->addColumn($company->prefix . 'docs', 'refnum_ext', 'varchar(255) AFTER `refnum`');
         //*/
     }
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:9,代码来源:m271114_102025_0012.php

示例15: up

 public function up()
 {
     //return false;
     //$this->update( 'menu', array("url"=>"newUpdate"), "id=64");
     $companys = Company::model()->findAll();
     foreach ($companys as $company) {
         $this->dropColumn($company->prefix . 'transactions', 'due_date');
     }
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:9,代码来源:m301118_211214_0022.php


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