本文整理汇总了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;
}