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


PHP messages::where方法代碼示例

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


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

示例1: mapmessage

 public function mapmessage($id)
 {
     $today = date("Y-m-d H:i:s");
     $fiveday = date("Y-m-d H:i:s", strtotime('-5 days'));
     $tenday = date("Y-m-d H:i:s", strtotime('-10 days'));
     $fifday = date("Y-m-d H:i:s", strtotime('-15 days'));
     $twentyday = date("Y-m-d H:i:s", strtotime('-20 days'));
     $tfiveday = date("Y-m-d H:i:s", strtotime('-25 days'));
     $thurtyday = date("Y-m-d H:i:s", strtotime('-30 days'));
     $thurtyfiveday = date("Y-m-d H:i:s", strtotime('-35 days'));
     //$jsonVariable;
     $q = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $fiveday)->where('date', '<=', $today)->count();
     $w = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $tenday)->where('date', '<=', $fiveday)->count();
     $e = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $fifday)->where('date', '<=', $tenday)->count();
     $r = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $twentyday)->where('date', '<=', $fifday)->count();
     $t = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $tfiveday)->where('date', '<=', $twentyday)->count();
     $y = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $thurtyday)->where('date', '<=', $tfiveday)->count();
     $u = messages::where('agent_id', '=', $id)->where('type', '=', '1')->where('date', '>=', $thurtyfiveday)->where('date', '<=', $thurtyday)->count();
     $today = $q;
     $fiveday = $w;
     $tenday = $e;
     $fifday = $r;
     $twentyday = $t;
     $tfiveday = $y;
     $thurtyfiveday = $u;
     $mapmessage = '[1, ' . $today . '], [2, ' . $fiveday . '], [3, ' . $tenday . '], [4, ' . $fifday . '], [5, ' . $twentyday . '], [6, ' . $tfiveday . '], [7, ' . $thurtyfiveday . ']';
     $jsonVariable['mapmessage'] = $mapmessage;
     return Response::json($jsonVariable);
 }
開發者ID:amsule,項目名稱:controllers,代碼行數:29,代碼來源:DashBoardAccess.php

示例2: selectmessages

 public function selectmessages()
 {
     $agent_id = Input::get('data.agent_id');
     $type = Input::get('data.type');
     $messages = messages::where('agent_id', '=', $agent_id)->where('type', '=', $type)->orderby('msg_id', 'Desc')->get();
     return $messages;
 }
開發者ID:amsule,項目名稱:controllers,代碼行數:7,代碼來源:DBajax.php


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