本文整理汇总了PHP中Status::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::all方法的具体用法?PHP Status::all怎么用?PHP Status::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::all方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id)
{
$user = User::with('AssigmentRole')->with('Neighbors')->findOrFail($id);
$status = Status::all();
$roles = Role::all();
return View::make('dashboard.users.edit', ['row' => $user, 'status' => $status, 'roles' => $roles]);
}
示例2: getStatuses
public function getStatuses()
{
$allStatuses = Status::all();
$statuses = [];
foreach ($allStatuses as $thisStatus) {
$statuses[$thisStatus->id] = $thisStatus->title;
}
return $statuses;
}
示例3: scopeGetList
/**
* Get list status
* @return array
*/
public function scopeGetList()
{
$status = Status::all();
$data = array();
foreach ($status as $stt) {
$data[$stt->id] = $stt->name;
}
return $data;
}
示例4: getIndex
public function getIndex()
{
if (Request::ajax()) {
$this->init();
$status = Status::all();
$all_messages = DB::table('gcm_messages_state')->leftJoin('gcm_messages', 'gcm_messages_state.message_id', '=', 'gcm_messages.id')->leftJoin('gcm_users', 'gcm_messages_state.user_id', '=', 'gcm_users.id')->leftJoin('gcm_status', 'gcm_messages_state.state', '=', 'gcm_status.id')->select('gcm_messages_state.id', 'gcm_messages_state.message_id', 'gcm_messages.message', 'gcm_messages_state.user_id', 'gcm_users.name as gcm_users_name', 'gcm_messages_state.state', 'gcm_status.name as gcm_status_name', 'gcm_messages_state.state_text', 'gcm_messages_state.created_at as gcm_messages_state_created_at')->whereRaw('gcm_messages_state.created_at >= "' . $this->from_date . '" and gcm_messages_state.created_at <= "' . $this->to_date . '" and gcm_messages_state.state like ' . $this->state)->orderBy('gcm_messages_state.created_at', 'desc')->paginate($this->count);
return Response::json(View::make('push.notif.reports', array('messages' => $all_messages, 'status' => $status))->render());
}
$all_messages = DB::table('gcm_messages_state')->leftJoin('gcm_messages', 'gcm_messages_state.message_id', '=', 'gcm_messages.id')->leftJoin('gcm_users', 'gcm_messages_state.user_id', '=', 'gcm_users.id')->leftJoin('gcm_status', 'gcm_messages_state.state', '=', 'gcm_status.id')->select('gcm_messages_state.id', 'gcm_messages_state.message_id', 'gcm_messages.message', 'gcm_messages_state.user_id', 'gcm_users.name as gcm_users_name', 'gcm_messages_state.state', 'gcm_status.name as gcm_status_name', 'gcm_messages_state.state_text', 'gcm_messages_state.created_at as gcm_messages_state_created_at')->orderBy('gcm_messages_state.created_at', 'desc')->paginate($this->count);
$status = Status::all();
return View::make('push.notif.notif_state')->with('messages', $all_messages)->with('status', $status);
}
示例5: getStatus
public function getStatus()
{
$new_status_id = '';
$used_status_id = '';
$statuses = Status::all();
foreach ($statuses as $status) {
if ($status->status == 'Used') {
$used_status_id = $status->id;
} else {
if ($status->status == 'New') {
$new_status_id = $status->id;
}
}
}
$status = array();
$status['new_id'] = $new_status_id;
$status['used_id'] = $used_status_id;
return $status;
}
示例6: index
//.........这里部分代码省略.........
$location_info = 'change location';
if (!empty($zip_code)) {
$locations = Location::where('zip_code', '=', $zip_code);
if ($locations->count()) {
$location = Location::where('zip_code', '=', $zip_code)->first();
$city = $location->city;
$state = $location->state;
if (!empty($city) && !empty($state)) {
if ($distance == 0) {
$search_location = 'Within ' . 'unlimited miles from ' . $city . ', ' . $state;
$location_info = 'unlimited miles from ' . $city . ', ' . $state . ' (change)';
} else {
$search_location = 'Within ' . $distance . ' miles from ' . $city . ', ' . $state;
$location_info = $distance . ' miles from ' . $city . ', ' . $state . ' (change)';
}
if (strlen($title) > 0) {
$title = $title . ' near ' . $city . ', ' . $state;
}
}
}
}
$results = $this->executeSearch();
$aggregations = $this->executeAggregations();
$selected_filters = $this->findSelectedFilters($aggregations);
$remaining_filters = $this->findRemainingFilters();
$search_filter = '';
foreach ($selected_filters as $filter) {
$search_filter = $search_filter . '<strong -class->' . $filter['name'] . ':' . '</strong>';
foreach ($filter['values'] as $value) {
$search_filter = $search_filter . $value['title'] . ',';
}
$search_filter = substr($search_filter, 0, -1) . ' ';
}
$paid = $aggregations['paid'];
$page = Input::get('page', '1');
$from = ($page - 1) * 10;
$featured = -1;
$standard = -1;
if ($paid > 0 && $page == 1) {
$featured = 0;
}
if ($from == $paid) {
$standard = 0;
} else {
if ($paid - $from < 9) {
$standard = $paid - $from;
}
}
$new_status_id = '';
$used_status_id = '';
$statuses = Status::all();
foreach ($statuses as $status) {
if ($status->status == 'Used') {
$used_status_id = $status->id;
} else {
if ($status->status == 'New') {
$new_status_id = $status->id;
}
}
}
$tab = array();
$tab['all_link'] = '';
$tab['new_link'] = $new_status_id;
$tab['used_link'] = $used_status_id;
$all_count = 0;
$new_count = 0;
$used_count = 0;
$status_aggs = $aggregations['status'];
if (array_key_exists($new_status_id, $status_aggs)) {
$new_count = $status_aggs[$new_status_id]['count'];
}
if (array_key_exists($used_status_id, $status_aggs)) {
$used_count = $status_aggs[$used_status_id]['count'];
}
$all_count = $new_count + $used_count;
$tab['all_count'] = '(' . $all_count . ')';
$tab['new_count'] = '(' . $new_count . ')';
$tab['used_count'] = '(' . $used_count . ')';
$tab['all_class'] = 'inactive';
$tab['new_class'] = 'inactive';
$tab['used_class'] = 'inactive';
$selected_status = Input::get('status', '');
if ($selected_status == $new_status_id) {
$tab['new_class'] = 'active';
} else {
if ($selected_status == $used_status_id) {
$tab['used_class'] = 'active';
} else {
$tab['all_class'] = 'active';
}
}
$save_search_popup = 'saveSearchModalGuest';
$save_vehicle_popup = 'saveVehicleModalGuest';
if (Auth::check()) {
$save_search_popup = 'saveSearchModalUser';
$save_vehicle_popup = 'saveVehicleModalUser';
}
$data = array('zip_code' => $zip_code, 'distance' => $distance, 'search_text' => $search_text, 'title' => $title, 'location_info' => $location_info, 'total' => $results['total'], 'selected_filters' => $selected_filters, 'remaining_filters' => $remaining_filters, 'results' => $results['results'], 'aggregations' => $aggregations, 'standard' => $standard, 'featured' => $featured, 'tab' => $tab, 'save_search_popup' => $save_search_popup, 'save_vehicle_popup' => $save_vehicle_popup, 'search_title' => $search_title, 'search_location' => $search_location, 'search_filter' => $search_filter);
$this->layout->contents = View::make('search/search', $data);
}
示例7: adsParameter
public function adsParameter()
{
$make_input = Input::get('make', '');
$model_input = Input::get('model', '');
$body_input = Input::get('body', '');
$status_input = Input::get('status', '');
$statuses = '';
$makes = '';
$models = '';
$bodies = '';
$new_status_id = '';
$used_status_id = '';
$status_values = Status::all();
foreach ($status_values as $status) {
if ($status->status == 'Used') {
$used_status_id = $status->id;
} else {
if ($status->status == 'New') {
$new_status_id = $status->id;
}
}
}
if ($status_input == $new_status_id) {
$statuses = 'New-';
} else {
if ($status_input == $used_status_id) {
$statuses = 'Used-';
}
}
foreach (explode("-", $make_input) as $make) {
$entities = Make::where('id', '=', $make);
if ($entities->count()) {
$entity = $entities->first();
$makes = $makes . $entity->make . '-';
}
}
foreach (explode("-", $model_input) as $model) {
$entities = Model::where('id', '=', $model);
if ($entities->count()) {
$entity = $entities->first();
$models = $models . $entity->model . '-';
}
}
foreach (explode("-", $body_input) as $body) {
$entities = Body::where('id', '=', $body);
if ($entities->count()) {
$entity = $entities->first();
$bodies = $bodies . $entity->body . '-';
}
}
$ads = '';
if (!empty($statuses)) {
$ads = $ads . $statuses;
}
if (!empty($makes)) {
$ads = $ads . $makes;
}
if (!empty($models)) {
$ads = $ads . $models;
}
if (!empty($bodies)) {
$ads = $ads . $bodies;
}
if (!empty($ads)) {
$ads = substr($ads, 0, -1);
}
return Response::json(array('ads' => $ads));
}
示例8: getAll
public function getAll()
{
$obj = new Status($this->db);
echo json_encode($obj->all());
}
示例9: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that the tickets index filtering works');
TestCommonAdmin::logMeIn($I);
$statuses = Status::all();
foreach ($statuses as $status) {
$I->amOnPage('/tickets/status/' . $status->title);
$I->see('Title', 'th');
$I->see('Updated At', 'th');
$I->see('Priority', 'th');
$I->see('Owner', 'th');
$I->dontSee('whoops');
}
示例10: postData
/**
* [postData - handle company specific posted data]
* @return [json] [DT compatible object]
*/
public function postData()
{
$Model = $this->modelName;
// Build our Editor instance and process the data coming from _POST
global $db;
$data = Editor::inst($db, 'services')->fields(Field::inst('services.id'), Field::inst('services.name'), Field::inst('services.category_id'), Field::inst('service_categories.name'), Field::inst('services.invoice_periods_id'), Field::inst('invoice_periods.description'), Field::inst('services.status_id'), Field::inst('statuses.description'), Field::inst('services.default_monthly_costs'), Field::inst('services.comment'))->leftJoin('service_categories', 'service_categories.id', '=', 'services.category_id')->leftJoin('statuses', 'statuses.id', '=', 'services.status_id')->leftJoin('invoice_periods', 'invoice_periods.id', '=', 'services.invoice_periods_id')->process($_POST)->data();
$data['service_categories'] = ServiceCategory::all(['id AS value', 'name AS label']);
$data['statuses'] = Status::all(['id AS value', 'description AS label']);
$data['invoice_periods'] = Period::all(['id AS value', 'description AS label']);
return Response::json($data);
}
示例11: postModelData
/**
* [postModelData - handle company specific posted subscriptions data]
* @param [Eloquent model] $model [company model]
* @return [json] [DT compatible object]
*/
public function postModelData($model)
{
$Model = $this->modelName;
if (isset($_POST["data"]) && !empty($_POST["data"])) {
$tot_price_str = $_POST['data']['subscriptions']['total_price'];
if (empty($tot_price_str)) {
$subs_id = (int) $_POST['data']['subscriptions']['id'];
$subscription = Subscription::find($subs_id);
$tot_price_str = $this->subscriptionTotalPrice($_POST['data']['subscriptions']['subscription_start'], $_POST['data']['subscriptions']['subscription_end'], $_POST['data']['subscriptions']['invoice_periods_id'], $_POST['data']['subscriptions']['price']);
$_POST['data']['subscriptions']['total_price'] = $tot_price_str;
}
//error_log("Le POST".json_encode($_POST['data']['subscriptions']['total_price']));
}
// Build our Editor instance and process the data coming from _POST
global $db;
$data = Editor::inst($db, 'subscriptions')->fields(Field::inst('subscriptions.id'), Field::inst('subscriptions.company_id'), Field::inst('service_categories.id'), Field::inst('service_categories.name'), Field::inst('subscriptions.service_id'), Field::inst('services.name'), Field::inst('subscriptions.description'), Field::inst('subscriptions.price'), Field::inst('subscriptions.total_price'), Field::inst('subscriptions.subscription_start'), Field::inst('subscriptions.subscription_end')->validator(function ($val, $data, $opts) {
$date_start = strtotime($data['subscriptions']['subscription_start']);
$date_end = strtotime($data['subscriptions']['subscription_end']);
return $date_end > $date_start ? true : "Error: End date precedes start date";
}), Field::inst('subscriptions.invoice_id'), Field::inst('subscriptions.invoice_periods_id'), Field::inst('invoice_periods.description'), Field::inst('subscriptions.status_id'), Field::inst('statuses.description'), Field::inst('subscriptions.status_date'))->leftJoin('invoice_periods', 'invoice_periods.id', '=', 'subscriptions.invoice_periods_id')->leftJoin('statuses', 'statuses.id', '=', 'subscriptions.status_id')->leftJoin('companies', 'companies.id', '=', 'subscriptions.company_id')->leftJoin('services', 'services.id', '=', 'subscriptions.service_id')->leftJoin('service_categories', 'service_categories.id', '=', 'services.category_id')->process($_POST)->data();
$data['companies'] = Company::all(['id AS value', 'bedrijfsnaam AS label']);
$data['services'] = Service::all(['id AS value', 'name AS label']);
$data['service_categories'] = ServiceCategory::all(['id AS value', 'name AS label']);
$data['statuses'] = Status::all(['id AS value', 'description AS label']);
$data['invoice_periods'] = Period::all(['id AS value', 'description AS label']);
return Response::json($data);
}
示例12: listStatuses
function listStatuses()
{
echo Status::all()->toJson();
}