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


PHP Status::where方法代码示例

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


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

示例1: apply

 public function apply()
 {
     if (Session::has('user_id')) {
         if (Input::has('storeId')) {
             $storeId = Input::get('storeId');
             $userId = Session::get('user_id');
             $status = StatusModel::where('store_id', $storeId)->first();
             $myQueue = QueueModel::where('store_id', $storeId)->where('user_id', $userId)->where('queue_no', '>', $status->current_queue_no)->whereRaw('DATE(created_at) = DATE(NOW())')->count();
             if ($myQueue == 0) {
                 $queueNo = $status->last_queue_no;
                 $status->last_queue_no = $queueNo + 1;
                 $status->save();
                 $queue = new QueueModel();
                 $queue->store_id = $storeId;
                 $queue->user_id = $userId;
                 $queue->queue_no = $queueNo + 1;
                 $queue->save();
                 return Response::json(['result' => 'success', 'msg' => 'You have been successfully apply on this store']);
             } else {
                 return Response::json(['result' => 'failed', 'msg' => 'You have already apply on this store', 'code' => 'CD00']);
             }
         } else {
             return Response::json(['result' => 'failed', 'msg' => 'Invalid Request', 'code' => 'CD00']);
         }
     } else {
         return Response::json(['result' => 'failed', 'msg' => 'You must login for apply', 'code' => 'CD01']);
     }
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:28,代码来源:QueueController.php

示例2: getStatus

 public static function getStatus($id)
 {
     switch ((int) $id) {
         case self::SUCCESS:
             return Status::where('id', '=', self::SUCCESS)->firstOrFail();
         case self::FAILURE:
             return Status::where('id', '=', self::FAILURE)->firstOrFail();
         case self::SKIP:
             return Status::where('id', '=', self::SKIP)->firstOrFail();
         default:
             return Status::where('id', '=', self::UNKNOWN)->firstOrFail();
     }
 }
开发者ID:kleopatra999,项目名称:cjan.org,代码行数:13,代码来源:Status.php

示例3: apply

 public function apply()
 {
     if (Input::has('store_id')) {
         $storeId = Input::get('store_id');
         $status = StatusModel::where('store_id', $storeId)->first();
         $queueNo = $status->last_queue_no;
         $status->last_queue_no = $queueNo + 1;
         $status->save();
         $store = StoreModel::find($storeId);
         return Response::json(['result' => 'success', 'msg' => '', 'queue_no' => $queueNo + 1, 'created_at' => $status->updated_at->format('Y-m-d H:i:s'), 'logo' => HTTP_PATH . "/assets/img/logo.png"]);
     } else {
         return Response::json(['result' => 'failed', 'msg' => 'Invalid Request']);
     }
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:14,代码来源:TabletController.php

示例4: findSelectedFilter

 public function findSelectedFilter($filters, $aggregations, $status_filter)
 {
     if (!empty($status_filter)) {
         $values = array();
         $status_ranges = explode("-", $status_filter);
         foreach ($status_ranges as $status_range) {
             $statuses = Status::where('id', '=', $status_range);
             if ($statuses->count()) {
                 $title = $statuses->first()->status;
                 array_push($values, array("title" => $title, "index" => 'status-remove-' . $status_range));
             }
         }
         array_push($filters, array("name" => "Condition", "values" => $values, "modal" => "status"));
     }
     return $filters;
 }
开发者ID:apetrailmukesh,项目名称:bootstrap,代码行数:16,代码来源:UtilityStatus.php

示例5: asyncNext

 public function asyncNext()
 {
     $agent = AgentModel::find(Session::get('agent_id'));
     $agent->is_active = true;
     $agent->save();
     $status = StatusModel::where('store_id', $agent->store_id)->first();
     if (Session::has('process_id')) {
         $process = ProcessModel::find(Session::get('process_id'));
         $process->end_time = date('H:i:s');
         if (Input::has('ticket_type') && Input::get('ticket_type') != '') {
             $process->ticket_type = Input::get('ticket_type');
         }
         $process->save();
         Session::forget('process_id');
     }
     if (Input::get('is_next') == '1') {
         if ($status->current_queue_no + 1 <= $status->last_queue_no) {
             $status->current_queue_no = $status->current_queue_no + 1;
             $status->save();
             $process = new ProcessModel();
             $process->agent_id = Session::get('agent_id');
             $process->queue_no = $status->current_queue_no;
             $process->start_time = date('H:i:s');
             $process->save();
             Session::set('process_id', $process->id);
             return Response::json(['result' => 'success', 'currentQueueNo' => $status->current_queue_no, 'lastQueueNo' => $status->last_queue_no, 'processId' => $process->id]);
         } else {
             $agent->is_active = false;
             $agent->save();
             return Response::json(['result' => 'failed', 'msg' => 'The queue is empty']);
         }
     } else {
         $agent->is_active = false;
         $agent->save();
         return Response::json(['result' => 'failed', 'msg' => 'Your status is DEACTIVE']);
     }
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:37,代码来源:ProcessController.php

示例6: postStatus

 public function postStatus($doc)
 {
     $toAdd = null;
     $status = Input::get('status');
     $doc = Doc::find($doc);
     if (!isset($status)) {
         $doc->statuses()->sync(array());
     } else {
         $toAdd = Status::where('label', $status['text'])->first();
         if (!isset($toAdd)) {
             $toAdd = new Status();
             $toAdd->label = $status['text'];
         }
         $toAdd->save();
         $doc->statuses()->sync(array($toAdd->id));
     }
     $response['messages'][0] = array('text' => 'Document saved', 'severity' => 'info');
     return Response::json($response);
 }
开发者ID:iaincollins,项目名称:madison,代码行数:19,代码来源:DocumentApiController.php

示例7: getStatusByName

 public function getStatusByName($name)
 {
     return Status::where('title', $name)->firstOrFail();
 }
开发者ID:rogerapras,项目名称:SimpleLance,代码行数:4,代码来源:Status.php

示例8: findClientStatus

 public static function findClientStatus($id_client = null, $id_user = null)
 {
     return Status::where('id_client', '=', $id_client)->get();
 }
开发者ID:josemujicap,项目名称:AveFenix-CRM,代码行数:4,代码来源:Status.php

示例9: show

 /**
  * Display the specified resource.
  *
  * @param  [int]  $id
  * @return [Response]
  */
 public function show($id)
 {
     // Check if user has access to loan
     if (!$this->user_loan_has_access($id)) {
         Session::flash('alert_danger', 'Access denied.');
         return Redirect::to('dashboard');
     } else {
         // Get loan info
         $loan = $this->loan->getById($id);
         $loan = $this->loan_add_status($loan);
         $loan = $this->show_add_user_info($loan);
         $conditions = $this->loan->getLoanConditions($loan["id"]);
         foreach ($conditions as &$condition) {
             $condition = $this->condition_add_info($condition);
         }
         $documents = $this->loan->getLoanDocuments($loan["id"]);
         // For the update status form
         $is_staff = $this->is_staff();
         $statuses = Status::where('active', 1)->get()->toArray();
         $condition_types = ConditionType::where('active', 1)->get()->toArray();
         return View::make('auth.loan', ['loan' => $loan, 'documents' => $documents, 'conditions' => $conditions, 'is_staff' => $is_staff, 'statuses' => $statuses, 'condition_types' => $condition_types]);
     }
 }
开发者ID:julianfresco,项目名称:documentHub,代码行数:29,代码来源:LoanController.php


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