當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Supplier::where方法代碼示例

本文整理匯總了PHP中Supplier::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Supplier::where方法的具體用法?PHP Supplier::where怎麽用?PHP Supplier::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Supplier的用法示例。


在下文中一共展示了Supplier::where方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  * POST /supplier
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make(Input::all(), Supplier::$rules);
     if ($validator->fails()) {
         return Redirect::to('supplier')->withErrors($validator)->withInput(Input::all());
     } else {
         if (Supplier::where('id_supp', '=', Input::get('id_supp'))->exists()) {
             $supplier = Supplier::find(Input::get('id_supp'));
             $supplier->nm_supp = Input::get('nm_supp');
             $supplier->alamat = Input::get('alamat');
             $supplier->telp = Input::get('telp');
             $supplier->fax = Input::get('fax');
             $supplier->save();
             Session::flash('message', 'Successfully updated supplier!');
             return Redirect::to('supplier');
         } else {
             $supplier = new Supplier();
             $supplier->id_supp = Input::get('id_supp');
             $supplier->nm_supp = Input::get('nm_supp');
             $supplier->alamat = Input::get('alamat');
             $supplier->telp = Input::get('telp');
             $supplier->fax = Input::get('fax');
             $supplier->save();
             Session::flash('message', 'Successfully created supplier!');
             return Redirect::to('supplier');
         }
     }
 }
開發者ID:shimohira,項目名稱:supplier,代碼行數:34,代碼來源:SupplierController.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update()
 {
     $input = Input::all();
     $id = $input['rowId'];
     $data = array('supp_name' => $input['editSupName'], 'supp_type' => $input['editSupType'], 'supp_add' => $input['editSupAdd'], 'email' => $input['editSupEmail'], 'contact_f' => $input['editSupPhone'], 'contact_s' => $input['editSupPhone2'], 'supp_mgm' => $input['editSupMgm']);
     $update = Supplier::where('id', '=', $id)->update($data);
     if ($update) {
         return json_encode(array('error' => 0, 'success' => 1));
     } else {
         return json_encode(array('error' => 1, 'success' => 0));
     }
 }
開發者ID:rana7cse,項目名稱:motoshop,代碼行數:18,代碼來源:SupplierController.php

示例3: getIndex

 public function getIndex()
 {
     $edate = Supplierformdate::where('event', '=', Session::get('event'))->first();
     $currdate = strtotime(date('Y-m-d'));
     $evdate = strtotime($edate->opendate);
     $diff = abs(($currdate - $evdate) / (60 * 60 * 24));
     //dd($diff);
     if ($currdate >= $evdate) {
         $userdetails = array('name' => Auth::user()->name, 'event' => Auth::user()->event);
         $suppliers = Supplier::where('event', '=', Session::get('event'))->with(array('supplierranks' => function ($query) {
             $query->where('userid', '=', Session::get('userid'));
         }))->get();
         // $suppliers = Supplier::where('event','=',Session::get('event'))->with('supplierranks')->get()->sortBy('order');
         // $suppliers = Supplier::all()->sortBy('order');
         return View::make('rankingform.rankingform')->with(array('userdetails' => $userdetails, 'suppliers' => $suppliers));
     } else {
         $opendate = date('d-M-Y', $evdate);
         return View::make('rankingform.rankingformnotavailable')->with('opendate', $opendate);
     }
 }
開發者ID:harshithanaiduk,項目名稱:ideconnect_2016,代碼行數:20,代碼來源:RankingformController.php

示例4: fire


//.........這裏部分代碼省略.........
                     $email_prefix = $first_name . '.' . $email_last_name;
                 } elseif ($this->option('email_format') == 'firstname') {
                     $email_last_name .= str_replace(' ', '', $last_name);
                     $email_prefix = $first_name;
                 }
             }
             $user_username = $email_prefix;
             // Generate an email based on their name if no email address is given
             if ($user_email == '') {
                 if ($first_name == 'Unknown') {
                     $status_id = 7;
                 }
                 $email = strtolower($email_prefix) . '@' . $this->option('domain');
                 $user_email = str_replace("'", '', $email);
             }
         }
         $this->comment('Full Name: ' . $user_name);
         $this->comment('First Name: ' . $first_name);
         $this->comment('Last Name: ' . $last_name);
         $this->comment('Username: ' . $user_username);
         $this->comment('Email: ' . $user_email);
         $this->comment('License Name: ' . $user_license_name);
         $this->comment('Serial No: ' . $user_license_serial);
         $this->comment('Licensed To Name: ' . $user_licensed_to_name);
         $this->comment('Licensed To Email: ' . $user_licensed_to_email);
         $this->comment('Seats: ' . $user_license_seats);
         $this->comment('Reassignable: ' . $user_license_reassignable);
         $this->comment('Supplier: ' . $user_license_supplier);
         $this->comment('Maintained: ' . $user_license_maintained);
         $this->comment('Notes: ' . $user_license_notes);
         $this->comment('Purchase Date: ' . $user_license_purchase_date);
         $this->comment('------------- Action Summary ----------------');
         if ($user_username != '') {
             if ($user = User::where('username', $user_username)->whereNotNull('username')->first()) {
                 $this->comment('User ' . $user_username . ' already exists');
             } else {
                 // Create the user
                 $user = Sentry::createUser(array('first_name' => $first_name, 'last_name' => $last_name, 'email' => $user_email, 'username' => $user_username, 'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10), 'activated' => true, 'permissions' => array('admin' => 0, 'user' => 1), 'notes' => 'User importerd through license importer'));
                 // Find the group using the group id
                 $userGroup = Sentry::findGroupById(3);
                 // Assign the group to the user
                 $user->addGroup($userGroup);
                 $this->comment('User ' . $first_name . ' created');
             }
         } else {
             $user = new User();
             $user->user_id = NULL;
         }
         // Check for the supplier match and create it if it doesn't exist
         if ($supplier = Supplier::where('name', $user_license_supplier)->first()) {
             $this->comment('Supplier ' . $user_license_supplier . ' already exists');
         } else {
             $supplier = new Supplier();
             $supplier->name = e($user_license_supplier);
             $supplier->user_id = 1;
             if ($supplier->save()) {
                 $this->comment('Supplier ' . $user_license_supplier . ' was created');
             } else {
                 $this->comment('Something went wrong! Supplier ' . $user_license_supplier . ' was NOT created');
             }
         }
         // Add the license
         $license = new License();
         $license->name = e($user_license_name);
         if ($user_license_purchase_date != '') {
             $license->purchase_date = $user_license_purchase_date;
開發者ID:naiwungmusic,項目名稱:snipe-it,代碼行數:67,代碼來源:LicenseImportCommand.php

示例5: getUploadsuppliers

 public function getUploadsuppliers()
 {
     $event = Session::get('uploadsupplierevent');
     $evedate = Supplierformdate::where('event', '=', $event)->first();
     return View::make('admin.uploadsuppliers')->with(array('suppliers' => Supplier::where('event', '=', $event)->get(), 'evedate' => $evedate));
 }
開發者ID:harshithanaiduk,項目名稱:ideconnect_2016,代碼行數:6,代碼來源:AdminController.php

示例6: suppliers

 public function suppliers()
 {
     $term = \Input::get('term');
     $suppliers = Supplier::where('supplier_name', 'like', "%{$term}%")->get()->lists('supplier_name', 'id');
     return response()->json($suppliers);
 }
開發者ID:AlexAustralia,項目名稱:printflow,代碼行數:6,代碼來源:AccountsController.php


注:本文中的Supplier::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。