本文整理汇总了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);
}
示例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;
}
示例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]);
}
示例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;
}