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


PHP Company::get方法代码示例

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


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

示例1: login

 public function login()
 {
     $param['pageNo'] = 98;
     if ($alert = Session::get('alert')) {
         $param['alert'] = $alert;
     }
     $param['users'] = CompanyModel::get();
     return View::make('company.auth.login')->with($param);
 }
开发者ID:michaelotto126,项目名称:shokes,代码行数:9,代码来源:AuthController.php

示例2: anyUpdate

 public function anyUpdate(Request $request)
 {
     $arr_return = array('status' => 'error');
     $id = session('current_company') !== null ? session('current_company') : 0;
     $address_id = session('current_address') !== null ? session('current_address') : 0;
     if ($id) {
         $company = Company::find($id);
         $address = Address::getAddressByCompanyId($id);
         session(['current_company' => $company['id'], 'current_address' => $address['id']]);
     } else {
         $company = Company::get()->last();
         //$address = Address::get()->last();
         if ($company && $address) {
             session(['current_company' => $company->id, 'current_address' => $address->id]);
         } else {
             $company = new Company();
             $company->save();
             $address = new Address();
             $address->save();
             session(['current_company' => $company->id, 'current_address' => $address->id]);
         }
     }
     $company->name = $request->has('name') ? $request->input('name') : '';
     $company->phone = $request->has('phone') ? $request->input('phone') : '';
     $company->company_type_id = $request->has('company_type') ? $request->input('company_type') : 0;
     $company->fax = $request->has('fax') ? $request->input('fax') : '';
     $company->email = $request->has('email') ? $request->input('email') : '';
     $company->web = $request->has('web') ? $request->input('web') : '';
     $company->is_customer = $request->has('is_customer') ? 1 : 0;
     $company->is_distribute = $request->has('is_distribute') ? 1 : 0;
     $address->address = $request->has('address') ? $request->input('address') : '';
     $address->town_city = $request->has('town_city') ? $request->input('town_city') : '';
     $address->province_id = $request->has('province_id') ? $request->input('province_id') : 0;
     $address->country_id = $request->has('country_id') ? $request->input('country_id') : 0;
     if ($company->save()) {
         $arr_return['status'] = 'success';
         $arr_return['name'] = $company->name;
     } else {
         $arr_return['message'] = 'Saving fail';
     }
     if ($address->save()) {
         $arr_return['status'] = 'success';
         $arr_return['name'] = $address->name;
     } else {
         $arr_return['message'] = 'Saving fail';
     }
     return $arr_return;
 }
开发者ID:kamitori,项目名称:khuongnhi2,代码行数:48,代码来源:CompaniesController.php

示例3: getNewJob

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getNewJob()
 {
     $companies = Company::get();
     return view("jobs.new-job", ["companies" => $companies]);
 }
开发者ID:younggeeks,项目名称:twentyKitonga,代码行数:10,代码来源:JobsController.php

示例4: anyUpdateReceiptMonthCompany

	static public function anyUpdateReceiptMonthCompany(){
		$list_company = Company::get()->toArray();
		foreach ($list_company as $key2 => $value2) {
			$company_id = $value2['id'];
			echo $company_id;
			$list_distribute = ReceiptMonth::where("company_id","=",$company_id)
									  ->where('type_receipt','=','distribute')
									  ->orderBy('year','ASC')
									  ->orderBy('month','ASC')
									  ->get()->toArray();
			if(count($list_distribute)){
				foreach ($list_distribute as $key => $value) {
					if($key==0){
						$current = ReceiptMonth::where("id","=",$value['id'])->first();
						$current->con_lai = $current->sum_amount - $current->paid + $current->no_cu;
						$current->save();
					}else{
						$current = ReceiptMonth::where("id","=",$value['id'])->first();
						$current->no_cu = $list_distribute[$key-1]['con_lai'];
						$current->con_lai = $current->sum_amount - $current->paid + $current->no_cu;
						$current->save();
					}
				}
			}

			$list_customer = ReceiptMonth::where("company_id","=",$company_id)
									  ->where('type_receipt','=','customer')
									  ->orderBy('year','ASC')
									  ->orderBy('month','ASC')
									  ->get()->toArray();
			if(count($list_customer)){
				foreach ($list_customer as $key => $value) {
					if($key==0){
						$current = ReceiptMonth::where("id","=",$value['id'])->first();
						$current->con_lai = $current->sum_amount - $current->paid + $current->no_cu;
						$current->save();
					}else{
						$current = ReceiptMonth::where("id","=",$value['id'])->first();
						$current->no_cu = $list_customer[$key-1]['con_lai'];
						$current->con_lai = $current->sum_amount - $current->paid + $current->no_cu;
						$current->save();
					}
				}
			}
		}
		
		echo "Done!";
		die;
	}
开发者ID:kamitori,项目名称:khuongnhi2,代码行数:49,代码来源:ReceiptsController.php


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