• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP models\Company类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Company类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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' => '[email protected]', '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' => '[email protected]', '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


示例16: create

 /**
  * Create new review for a company.
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
  */
 public function create(Requests\CreateReviewRequest $request)
 {
     try {
         $company = Company::findOrFail($request->input('company-id'));
         $review = new Review($request->except('company-id'));
         $company->reviews()->save($review);
         return redirect()->back()->with(['message' => 'Отзыв будет опубликован после модерации.']);
     } catch (\Exception $e) {
         return response()->view('errors.' . '503');
     }
 }
开发者ID:danilchican,项目名称:CallForMaster,代码行数:17,代码来源:ReviewsController.php


示例17: update

 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Company::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }
开发者ID:RHT-Memphis,项目名称:aeroeco,代码行数:11,代码来源:CompaniesController.php


示例18: actionDelete

 public function actionDelete()
 {
     $id = $_GET['id'];
     //$arr=Company::findOne($id);
     //echo $arr['_id'];die;
     if (Company::findOne($id)->delete()) {
         echo $this->success("删除成功", "index.php?r=company", '1');
     } else {
         echo $this->error("删除失败", "index.php?r=company", '1');
     }
 }
开发者ID:Greasi,项目名称:yizuniuke,代码行数:11,代码来源:CompanyController.php


示例19: __construct

 public function __construct()
 {
     $this->middleware('auth');
     $user_types = UserType::lists("name", "id");
     $states = State::lists("name", "id");
     $users_count = User::with("state")->latest()->get()->count();
     $universities_count = University::latest()->get()->count();
     $sos_count = SosModel::latest()->get()->count();
     $students_count = Student::latest()->get()->count();
     $companies_count = Company::latest()->get()->count();
     \View::share(compact("users_count", "universities_count", "sos_count", "states", "user_types", "students_count", "companies_count"));
 }
开发者ID:joaonzangoII,项目名称:find_my_campuses_friend,代码行数:12,代码来源:UniversitiesController.php


示例20: up

 public function up()
 {
     $companys = Company::find()->All();
     foreach ($companys as $company) {
         //update payment,config
         $this->insert($company->prefix . 'paymentType', ['id' => 8, 'name' => 'PayPal', 'value' => '\\app\\components\\payments\\Cash', 'oppt_account_id' => 12]);
         $this->insert($company->prefix . 'accounts', ["id" => 12, "type" => 4, 'name' => 'PayPal', 'src_tax' => 0]);
         $this->update($company->prefix . 'files', ['parent_type' => '\\app\\models\\docs'], ['parent_type' => "Docs"]);
         $this->update($company->prefix . 'files', ['parent_type' => '\\app\\models\\Accounts'], ['parent_type' => "Accounts"]);
     }
     return true;
 }
开发者ID:chaimvaid,项目名称:linet3,代码行数:12,代码来源:m150430_162555_paypal.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP models\Contact类代码示例发布时间:2022-05-23
下一篇:
PHP models\Client类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap