本文整理匯總了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);
}
示例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;
}