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


PHP Store::where方法代碼示例

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


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

示例1: edit

 public function edit($id)
 {
     $param['pageNo'] = 3;
     $param['agent'] = AgentModel::find($id);
     $param['stores'] = StoreModel::where('company_id', Session::get('company_id'))->get();
     return View::make('company.agent.edit')->with($param);
 }
開發者ID:victory21th,項目名稱:QM-Laravel,代碼行數:7,代碼來源:AgentController.php

示例2: index

 public function index()
 {
     $param['stores'] = StoreModel::where('company_id', Session::get('company_id'))->paginate(10);
     $param['pageNo'] = 2;
     if ($alert = Session::get('alert')) {
         $param['alert'] = $alert;
     }
     return View::make('company.store.index')->with($param);
 }
開發者ID:victory21th,項目名稱:QM-Laravel,代碼行數:9,代碼來源:StoreController.php

示例3: function

| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', ['before' => 'auth', function () {
    $store = Auth::user();
    $api = new TiendaNube\API($store->tiendanube_id, $store->access_token, 'Awesome App (contact@awesome.com)');
    $response = $api->get("products");
    return View::make('hello')->with('products', $response->body)->with('lang', $response->main_language);
}]);
Route::get('/auth', function () {
    //Obtain access token
    $code = Input::get('code');
    $auth = new TiendaNube\Auth(Config::get('tiendanube.client_id'), Config::get('tiendanube.client_secret'));
    $store_info = $auth->request_access_token($code);
    //Create or edit existing store with the provided access token
    $store = Store::where('tiendanube_id', $store_info['store_id'])->first();
    if ($store == null) {
        $store = new Store();
        $store->tiendanube_id = $store_info['store_id'];
    }
    $store->access_token = $store_info['access_token'];
    $store->save();
    //Login and redirect to homepage
    Auth::login($store);
    return Redirect::to('/');
});
開發者ID:thinh83,項目名稱:sample-php-app,代碼行數:31,代碼來源:routes.php

示例4: delete_store

 public function delete_store()
 {
     $id = Request::segment(4);
     Store::where('id', $id)->delete();
     Department::where('store_id', $id)->delete();
     Shelf::where('store_id', $id)->delete();
     Product::where('store_id', $id)->delete();
     StoreLocation::where('store_id', $id)->delete();
     $message = "Successfully deleted the store";
     $type = "success";
     return Redirect::to('/admin/stores')->with('type', $type)->with('message', $message);
 }
開發者ID:sohelrana820,項目名稱:mario-gomez,代碼行數:12,代碼來源:AdminController.php

示例5: agent

 public function agent()
 {
     $param['pageNo'] = 9;
     $startDate = Input::has('startDate') ? Input::get('startDate') : '';
     $endDate = Input::has('endDate') ? Input::get('endDate') : '';
     if ($startDate == '' || $endDate == '') {
         $endDate = date('Y-m-d');
         $startDate = substr($endDate, 0, 8) . "01";
     }
     $storeId = Input::has('storeId') ? Input::get('storeId') : '';
     $companyId = Session::get('company_id');
     $prefix = DB::getTablePrefix();
     $sqlGroup = "SELECT agent_id, COUNT(*) AS cnt, SUM(TIME_TO_SEC(TIMEDIFF(end_time, start_time))) AS activeTime\n                       FROM " . $prefix . "process\n                      WHERE end_time != ''\n                        AND (DATE(created_at) BETWEEN DATE('{$startDate}') AND DATE('{$endDate}'))\n                      GROUP BY agent_id";
     $sql = "SELECT t1.id, t1.name, t1.email, t1.phone\n                  FROM " . $prefix . "agent t1, " . $prefix . "store t2\n                 WHERE t1.store_id = t2.id\n                   AND t2.company_id = {$companyId}";
     if ($storeId != '') {
         $sql .= " AND t1.store_id = {$storeId}";
     }
     $sql = "SELECT t1.*, IFNULL(t2.cnt, 0) AS cnt, IFNULL(t2.activeTime, 0) as activeTime \n                  FROM ({$sql}) t1\n                  LEFT JOIN ({$sqlGroup}) t2 ON t1.id = t2.agent_id";
     $param['agents'] = DB::select($sql);
     $param['storeId'] = $storeId;
     $param['startDate'] = $startDate;
     $param['endDate'] = $endDate;
     $param['stores'] = StoreModel::where('company_id', Session::get('company_id'))->get();
     return View::make('company.dashboard.agent')->with($param);
 }
開發者ID:victory21th,項目名稱:QM-Laravel,代碼行數:25,代碼來源:DashboardController.php

示例6: storeExists

 private function storeExists($store)
 {
     return Store::where('name', '=', $store->name)->get()->count() > 0;
 }
開發者ID:fashionforhome,項目名稱:fressen4home,代碼行數:4,代碼來源:ImportStoreCommand.php


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