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


PHP models\Company类代码示例

本文整理汇总了PHP中app\models\Company的典型用法代码示例。如果您正苦于以下问题:PHP Company类的具体用法?PHP Company怎么用?PHP Company使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: actionCompany

 public function actionCompany()
 {
     $company = Company::find()->one();
     if (empty($company)) {
         $company = new Company();
         $company->vat = 0;
         $company->logo = '';
     }
     $post = Yii::$app->request->post();
     if (!empty($post)) {
         if (!empty($_FILES['Company']['name']['logo'])) {
             $tmp_name = $_FILES['Company']['tmp_name']['logo'];
             $name = $_FILES['Company']['name']['logo'];
             if (file_exists('upload/' . $name)) {
                 unlink('upload' . $name);
             }
             if (move_uploaded_file($tmp_name, 'upload/' . $name)) {
                 $company->logo = $name;
             }
         }
         $company->name = $post['Company']['name'];
         $company->tax_code = $post['Company']['tax_code'];
         $company->tel = $post['Company']['tel'];
         $company->website = $post['Company']['website'];
         $company->address = $post['Company']['address'];
         $company->vat = $post['Company']['vat'];
         if ($company->save()) {
             $session = new Session();
             $session->setFlash('message', 'บันทึกรายการแล้ว');
             return $this->redirect(['company']);
         }
     }
     return $this->render('//config/company', ['company' => $company]);
 }
开发者ID:kaniou,项目名称:yii2pos,代码行数:34,代码来源:ConfigController.php

示例2: actionCompany

 public function actionCompany()
 {
     $model = new Company();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             $model->is_sponsor = 0;
             $model->is_organisator = 0;
             $model->save();
             Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.');
             return $this->refresh();
         }
     }
     return $this->render('company', ['model' => $model]);
 }
开发者ID:unix-admin,项目名称:profitday,代码行数:14,代码来源:SiteController.php

示例3: createCompany

 private function createCompany($addressID)
 {
     $company = new Company();
     $company->created_at = date("Y-m-d H:i:s");
     $company->name = $this->email;
     $company->comment = "";
     $company->phone = "";
     $company->twenty_four_hours = 0;
     $company->active = 1;
     $company->status_d = 0;
     $company->address_id = $addressID;
     $company->save();
     return $company->id;
 }
开发者ID:Bibihelper,项目名称:Project2015,代码行数:14,代码来源:RegisterForm.php

示例4: testAssetAdd

 public function testAssetAdd()
 {
     $company = factory(Company::class, 'company')->make();
     $values = ['name' => $company->name];
     Company::create($values);
     $this->tester->seeRecord('companies', $values);
 }
开发者ID:dmeltzer,项目名称:snipe-it,代码行数:7,代码来源:CompanyTest.php

示例5: getCompaniesLogo

 private function getCompaniesLogo()
 {
     $organisators = Company::find()->where(['is_organisator' => '1'])->orderBy('order')->all();
     $organisatorsAndMembers = [];
     foreach ($organisators as $value) {
         $organisatorsAndMembers[$value->attributes['id']]['name'] = $value->attributes['name'];
         if ($value->attributes['logo_url'] != '') {
             $organisatorsAndMembers[$value->attributes['id']]['url'] = 'http://' . Yii::$app->request->serverName . $value->attributes['logo_url'];
         } else {
             $organisatorsAndMembers[$value->attributes['id']]['url'] = 'http://' . Yii::$app->request->serverName . '/files/logo/no_logo.jpg';
         }
         $organisatorsAndMembers[$value->attributes['id']]['intro'] = $value->attributes['intro_' . Yii::$app->language];
         $organisatorsAndMembers[$value->attributes['id']]['site'] = $value->attributes['site'];
     }
     $members = Company::find()->where(['is_sponsor' => '1'])->orderBy('order')->all();
     foreach ($members as $value) {
         $organisatorsAndMembers[$value->attributes['id']]['name'] = $value->attributes['name'];
         if ($value->attributes['logo_url'] != '') {
             $organisatorsAndMembers[$value->attributes['id']]['url'] = 'http://' . Yii::$app->request->serverName . $value->attributes['logo_url'];
         } else {
             $organisatorsAndMembers[$value->attributes['id']]['url'] = 'http://' . Yii::$app->request->serverName . '/files/logo/no_logo.jpg';
         }
         $organisatorsAndMembers[$value->attributes['id']]['intro'] = $value->attributes['intro_' . Yii::$app->language];
         $organisatorsAndMembers[$value->attributes['id']]['site'] = $value->attributes['site'];
     }
     return $organisatorsAndMembers;
 }
开发者ID:unix-admin,项目名称:profitday,代码行数:27,代码来源:LogoWidget.php

示例6: run

 public function run()
 {
     DB::table('companies')->delete();
     $collection = [['company' => 'UAM'], ['company' => 'ADC'], ['company' => 'Boeing'], ['company' => 'Southwest'], ['company' => 'Jet Blue'], ['company' => 'Robert Half']];
     foreach ($collection as $record) {
         Company::create($record);
     }
 }
开发者ID:RHT-Memphis,项目名称:adc,代码行数:8,代码来源:CompaniesTableSeeder.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $objs = factory(Company::class, 10)->make();
     Company::truncate();
     foreach ($objs as $var) {
         Company::create($var->toArray());
     }
 }
开发者ID:guduchango,项目名称:limoncello,代码行数:13,代码来源:CompaniesTableSeeder.php

示例8: run

 public function run()
 {
     DB::table('companies')->delete();
     $collection = [['company' => 'Dagobah Charters', 'dba' => 'DCY', 'domain' => 'dagobah.com', 'folder_name' => snake_case('Dagobah Charters'), 'tier' => '2', 'corporation_type' => 'Limited Liability Corporation', 'admin_id' => 4], ['company' => 'Aerospace Disassembly Consortium', 'dba' => 'ADC', 'domain' => 'aero-eco.com', 'folder_name' => snake_case('Aerospace Disassembly Consortium'), 'tier' => '1', 'corporation_type' => 'Tennessee', 'admin_id' => 9], ['company' => 'Universal Asset Management', 'dba' => 'UAM', 'main_phone' => '9016824064', 'domain' => 'uaminc.com', 'folder_name' => snake_case('Universal Asset Management'), 'tier' => '2', 'corporation_type' => 'Tennessee', 'admin_id' => 6], ['company' => 'Braniff Airlines', 'dba' => 'Braniff', 'domain' => 'braniff.com', 'folder_name' => snake_case('Braniff Airlines'), 'tier' => '3', 'corporation_type' => 'Limited Liability Corporation', 'admin_id' => 3], ['company' => 'Starfleet Academy', 'dba' => 'SFA', 'main_phone' => '4155551212', 'domain' => 'sfa.org', 'folder_name' => snake_case('Starfleet Academy'), 'tier' => '4', 'reply_to' => 'jon.gravois@sfa.com', 'mail_domain' => 'sfa.org', 'website' => 'http://acad.sfa.org/', 'corporation_type' => 'San Francisco', 'admin_id' => 2]];
     foreach ($collection as $record) {
         Company::create($record);
     }
 }
开发者ID:wyrover,项目名称:aeroeco,代码行数:8,代码来源:CompaniesTableSeeder.php

示例9: run

 public function run()
 {
     DB::table('companies')->delete();
     $collection = [['company' => 'Dagobah Charters', 'dba' => 'DCY', 'domain' => 'dagobah.com', 'tier' => '2', 'corporation_type' => 'Limited Liability Corporation'], ['company' => 'Aerospace Disassembly Consortium', 'dba' => 'ADC', 'domain' => 'aero-eco.com', 'tier' => '1', 'corporation_type' => 'Tennessee'], ['company' => 'Universal Asset Management', 'dba' => 'UAM', 'domain' => 'uaminc.com', 'tier' => '2', 'corporation_type' => 'Tennessee'], ['company' => 'Braniff Airlines', 'dba' => 'Braniff', 'domain' => 'braniff.com', 'tier' => '3', 'corporation_type' => 'Limited Liability Corporation'], ['company' => 'Starfleet Academy', 'dba' => 'SFA', 'domain' => 'sfa.org', 'tier' => '4', 'reply_to' => 'jon.gravois@rhsps.com', 'website' => 'http://acad.sfi.org/', 'corporation_type' => 'San Francisco']];
     foreach ($collection as $record) {
         Company::create($record);
     }
 }
开发者ID:RHT-Memphis,项目名称:aeroeco,代码行数:8,代码来源:CompaniesTableSeeder.php

示例10: run

 public function run()
 {
     $faker = Faker\Factory::create();
     foreach (range(1, 30) as $index) {
         Company::create(['company_name' => $faker->company]);
         $this->command->info('Company table seeded!');
     }
 }
开发者ID:jingoldby,项目名称:dbproject,代码行数:8,代码来源:CompanyTableSeeder.php

示例11: trialRegister

 public function trialRegister(Request $request)
 {
     $errors = [];
     $data = [];
     $email = $request->input('email');
     $password = $request->input('password');
     $password2 = $request->input('password2');
     $country_id = $request->input('country_id');
     $company = $request->input('company');
     $dba = $request->input('dba');
     $firstname = $request->input('firstname');
     $lastname = $request->input('lastname');
     $phone = $request->input('phone');
     $can_sell = $request->input('can_sell');
     $terms_agree = $request->input('terms_agree');
     $contact_please = $request->input('contact_please');
     if (!$email) {
         $errors['email'] = 'Email is required.';
     }
     if (!$password) {
         $errors['password'] = 'Password is required.';
     }
     if (!$password2) {
         $errors['password2'] = 'Confirmation of password is required.';
     }
     if (!$company) {
         $errors['company'] = 'Company legal name is required.';
     }
     if (!$dba) {
         $errors['dba'] = 'Company common name is required.';
     }
     if (!$firstname) {
         $errors['firstname'] = 'First Name is required.';
     }
     if (!$lastname) {
         $errors['lastname'] = 'Last Name is required.';
     }
     if (!$phone) {
         $errors['phone'] = 'Phone Number is required.';
     }
     if (!empty($errors)) {
         $data['success'] = false;
         $data['errors'] = $errors;
     } else {
         // process form
         $newco = Company::create(['company' => $company, 'dba' => $dba, 'country_id' => $country_id, 'terms_agree' => $terms_agree, 'contact_please' => $contact_please, 'can_sell' => $can_sell, 'main_phone' => $phone, 'tier' => 2, 'folder_name' => snake_case($company)]);
         $newuser = User::create(['firstname' => $firstname, 'lastname' => $lastname, 'email' => $email, 'password' => bcrypt($password), 'company_id' => $newco->id, 'can_sell' => $can_sell]);
         $updCo = $newco->fill(['admin_id' => $newuser->id])->save();
         $updU = $newuser->fill(['manager_id' => $newuser->id])->save();
         $data['success'] = true;
         $data['message'] = 'Success';
         $data['user_id'] = $newuser->id;
         $data['company_id'] = $newco->id;
     }
     // end if
     return $this->respond($data);
 }
开发者ID:wyrover,项目名称:aeroeco,代码行数:57,代码来源:AjaxController.php

示例12: run

 public function run()
 {
     DB::table('companies')->truncate();
     $faker = Faker\Factory::create('pt_BR');
     for ($i = 0; $i < 1000; $i++) {
         $company = ['name' => $faker->company, 'city' => $faker->city, 'phone' => $faker->phoneNumber];
         Company::create($company);
     }
 }
开发者ID:romeugodoi,项目名称:palestra-async,代码行数:9,代码来源:CompaniesTableSeeder.php

示例13: saveInfo

 public function saveInfo()
 {
     $company = Company::findOne($this->id);
     if ($company) {
         $company->setComment($this->info);
         return true;
     }
     return false;
 }
开发者ID:Bibihelper,项目名称:Project2015,代码行数:9,代码来源:CompanyInfoForm.php

示例14: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => min(InvoiceDesign::all()->random()->id, 10), 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     User::create(['email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:medea61,项目名称:invoiceninja,代码行数:10,代码来源:UserTableSeeder.php

示例15: run

 public function run()
 {
     $person = DB::table('people')->where('first_name', 'James')->where('last_name', 'Sample')->first();
     $company = Company::where('name', 'Sample Company')->first();
     $group_type = GroupType::where('name', 'employee')->first();
     $group = Group::where('name', 'e80-helpdesk')->first();
     if (isset($person)) {
         CompanyPerson::create(['person_id' => $person->id, 'company_id' => $company->id, 'group_type_id' => $group_type->id, 'group_id' => $group->id]);
     }
 }
开发者ID:pinkynrg,项目名称:convergence2.0,代码行数:10,代码来源:DatabaseSeeder.php


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