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


PHP Activity::where方法代码示例

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


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

示例1: index

 public function index()
 {
     $points = Point::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('pointable_type', '=', 'Activity')->groupBy('pointable_type')->groupBy('pointable_id')->get();
     $activities = Activity::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->get();
     $menu = 'academic';
     return View::make('points.index', compact('points', 'activities', 'menu'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:7,代码来源:PointsController.php

示例2: it_associates_special_user_key_if_isset

 /** @test */
 function it_associates_special_user_key_if_isset()
 {
     $this->assertCount(0, chronicle()->getAllRecords());
     $quote = $this->getQuote(42);
     $this->assertCount(1, chronicle()->getAllRecords());
     $this->assertEquals(Activity::where('subject_id', $quote->id)->first()->user_id, 42);
 }
开发者ID:kenarkose,项目名称:chronicle,代码行数:8,代码来源:RecordsActivityTest.php

示例3: testIndex

 public function testIndex()
 {
     $Activity1 = new \App\activity();
     $Activity1->description = 'Test';
     $Activity1->date = '2015-10-05';
     $Activity1->time = '00:00:00';
     $Activity1->plant_id = \App\Plant::where("name", "=", "TestActivityPlant")->first()->id;
     $Activity1->weather = 'few cloud';
     $Activity2 = new \App\activity();
     $Activity2->description = 'Test2';
     $Activity2->date = '2015-10-05';
     $Activity2->time = '00:00:00';
     $Activity2->plant_id = \App\Plant::where("name", "=", "TestActivityPlant")->first()->id;
     $Activity2->weather = 'rain';
     if (Activity::where("plant_id", "=", \App\Plant::where("name", "=", "TestActivityPlant")->first()->id)->count() <= 2) {
         $Activity1->save();
         $Activity2->save();
     }
     $Activity1->toArray();
     $ActivityController = new \App\Http\Controllers\activityController();
     $farmID = array('farmID' => \App\Farm::where("name", "=", "TestActivityFarm")->first()->id);
     $request = new \Illuminate\Http\Request();
     $request->replace($farmID);
     $test = $ActivityController->index($request);
     print_r($test[0] == $Activity2);
     $this->assertEquals($test[0], $Activity2->toArray());
     $this->assertEquals($test[1], $Activity1->toArray());
     $request->replace(null);
     $test2 = $ActivityController->index($request);
     $this->assertEquals(null, $test2);
 }
开发者ID:bossgame1234,项目名称:MS4SF,代码行数:31,代码来源:ActivityControllerTest.php

示例4: index

 public function index()
 {
     // total_income, billed_clients, invoice_sent and active_clients
     $select = DB::raw('COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients,
                     SUM(CASE WHEN invoices.invoice_status_id >= ' . INVOICE_STATUS_SENT . ' THEN 1 ELSE 0 END) invoices_sent,
                     COUNT(DISTINCT clients.id) active_clients,
                     AVG(invoices.amount) as invoice_avg');
     $metrics = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->leftJoin('invoices', 'clients.id', '=', 'invoices.client_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->groupBy('accounts.id')->first();
     $select = DB::raw('SUM(clients.paid_to_date) as value');
     $totalIncome = DB::table('accounts')->select($select)->leftJoin('clients', 'accounts.id', '=', 'clients.account_id')->where('accounts.id', '=', Auth::user()->account_id)->where('clients.is_deleted', '=', false)->groupBy('accounts.id')->first();
     $activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)->orderBy('created_at', 'desc')->take(6)->get();
     $pastDue = Invoice::scope()->where('due_date', '<', date('Y-m-d'))->where('balance', '>', 0)->where('is_recurring', '=', false)->where('is_quote', '=', false)->where('is_deleted', '=', false)->orderBy('due_date', 'asc')->take(6)->get();
     $upcoming = Invoice::scope()->where('due_date', '>=', date('Y-m-d'))->where('balance', '>', 0)->where('is_recurring', '=', false)->where('is_quote', '=', false)->where('is_deleted', '=', false)->orderBy('due_date', 'asc')->take(6)->get();
     $data = ['totalIncome' => Utils::formatMoney($totalIncome ? $totalIncome->value : 0, Session::get(SESSION_CURRENCY)), 'billedClients' => $metrics ? $metrics->billed_clients : 0, 'invoicesSent' => $metrics ? $metrics->invoices_sent : 0, 'activeClients' => $metrics ? $metrics->active_clients : 0, 'invoiceAvg' => Utils::formatMoney($metrics ? $metrics->invoice_avg : 0, Session::get(SESSION_CURRENCY)), 'activities' => $activities, 'pastDue' => $pastDue, 'upcoming' => $upcoming];
     return View::make('dashboard', $data);
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:16,代码来源:DashboardController.php

示例5: postParticipate

 /**
  * 参加活动
  */
 public function postParticipate()
 {
     $shopID = base64_decode(Input::get('shop_id'));
     $headerShop = AuthController::checkShop($shopID);
     $retCode = SUCCESS;
     $retMsg = "";
     $activityID = Input::get('activity_id');
     $activity = Activity::where('wy_activity_id', $activityID)->first();
     //活动对应表中需要增加时间控制
     $shopActivitity = ShopActivity::where('wy_shop_id', $shopID)->where('wy_activity_id', $activityID)->first();
     if (empty($shopActivitity)) {
         $shopActivitity = new ShopActivity();
         $shopActivitity->wy_shop_id = $shopID;
         $shopActivitity->wy_activity_id = $activityID;
         $shopActivitity->wy_enable = ACTIVITY_ENABLE_1;
         if (!empty($activity)) {
             $shopActivitity->wy_money = $activity->wy_activity_cutmoney;
         }
         $result = $shopActivitity->save();
         if ($result) {
             $retMsg = Lang::get('messages.10018');
         } else {
             $retCode = -15004;
             $retMsg = Lang::get('errormessages.-15004');
             $context = array("errorCode" => $retCode, "userID" => Auth::id(), "shopID" => $shopID, "activityID" => $activityID);
             Log::error($retMsg, $context);
         }
     } else {
         if (!empty($activity)) {
             $result = ShopActivity::where('wy_shop_id', $shopID)->where('wy_activity_id', $activityID)->update(array('wy_enable' => ACTIVITY_ENABLE_1, 'wy_money' => $activity->wy_activity_cutmoney));
         } else {
             $result = ShopActivity::where('wy_shop_id', $shopID)->where('wy_activity_id', $activityID)->update(array('wy_enable' => ACTIVITY_ENABLE_1));
         }
         if ($result) {
             $retMsg = Lang::get('messages.10018');
         } else {
             $retCode = -15005;
             $retMsg = Lang::get('errormessages.-15005');
             $context = array("errorCode" => $retCode, "userID" => Auth::id(), "shopID" => $shopID, "activityID" => $activityID);
             Log::error($retMsg, $context);
         }
     }
     $sendMsgArray = array("ret_code" => $retCode, "msg" => $retMsg);
     return Response::json($sendMsgArray);
 }
开发者ID:antinglizi,项目名称:admin,代码行数:48,代码来源:ActivityController.php

示例6: getActivity

 public function getActivity($activity_id)
 {
     return \Activity::where('_id', $activity_id)->first();
 }
开发者ID:jesposito,项目名称:learninglocker,代码行数:4,代码来源:EloquentActivityRepository.php

示例7: foreach

<?php

include 'config.php';
$activity = Activity::where('date_end', '=', '0000-00-00 00:00:00')->get();
$message = [];
if (isset($_GET['delete'])) {
    $del_activities = Activity::where('date_end', '!=', '0000-00-00 00:00:00')->get();
    foreach ($del_activities as $del_activity) {
        $del_activity->delete();
    }
    $message['type'] = "success";
    $message['message'] = "Old activities deleted";
}
echo $template->view()->make('activities')->with('activities', $activity)->with('message', $message)->render();
开发者ID:Goldtrak,项目名称:FOS-Streaming-v1,代码行数:14,代码来源:activities.php

示例8: foreach

<?php

include 'config.php';
$message = [];
if (isset($_GET['delete_all'])) {
    $del_activities = Activity::all();
    foreach ($del_activities as $del_activity) {
        $del_activity->delete();
    }
    $message['type'] = "success";
    $message['message'] = "Old activities deleted";
}
if (isset($_GET['delete'])) {
    $de_activity = Activity::find($_GET['delete']);
    $de_activity->delete();
    $mssage['type'] = "success";
    $message['message'] = "Activity deleted";
}
$activity = Activity::where('date_end', '=', '0000-00-00 00:00:00')->get();
echo $template->view()->make('activities')->with('activities', $activity)->with('message', $message)->render();
开发者ID:addonBrasil,项目名称:FOS-Streaming-v1,代码行数:20,代码来源:activities.php

示例9: activityDelete

 public function activityDelete()
 {
     $activity = Input::get('activity');
     $deleteRow = Activity::where('activity_id', '=', $activity);
     $deleted = $deleteRow->delete();
     if ($deleted) {
         return Redirect::route('dashboard');
     }
 }
开发者ID:nimeshmora,项目名称:CRM-DMA-Recruitment,代码行数:9,代码来源:ActivityController.php


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