这没有显示正确的计数.什么是正确的语法?
$this->data['Tasks'] = \DB::table('tb_tasks')->where('Status', 'like', 'Open%')->whereDate('DeadLine', '>', 'CURDATE()')->count();
Run Code Online (Sandbox Code Playgroud) 我正在尝试临时存储数据并在其他页面中打印。所选数据仅在刷新页面之前有效。我该如何解决?谢谢。
index.blade.php
<form action="" method="post">
{!! Form::select('first_name', $firstNames) !!}
<button type="submit" value="Submit">Go</button>
</form>
Run Code Online (Sandbox Code Playgroud)
DashboardController.php
public function getIndex( Request $request )
{
$this->data['online_users'] = \DB::table('tb_users')->orderBy('last_activity','desc')->limit(10)->get();
$this->data['firstNames'] = \DB::table('tb_users')->orderBy('first_name')->lists('first_name', 'id');
$request->session()->put('first_name', input::get('first_name'));
$this->data['active'] = '';
return view('dashboard.index',$this->data);
}
Run Code Online (Sandbox Code Playgroud)
回声
<p>{{Session::get('first_name')}}</p>
Run Code Online (Sandbox Code Playgroud) 目前,这仅在会话中存储名字。我需要存储位于同一数据库行中的一些其他字段,例如 user_role 和 city。我怎样才能做到这一点 ?
DashboardContaroller.php
public function getIndex( Request $request )
{
$this->data['firstNames'] = \DB::table('tb_users')->orderBy('first_name')->lists('first_name', 'first_name');
Session::put('firstName', $request->get('first_name'));
return view('dashboard.index',$this->data);
}
Run Code Online (Sandbox Code Playgroud)
索引.blade.php
<form action="" method="post">
{!! Form::select('first_name', $firstNames) !!}
<button type="submit" value="Submit">Go</button>
</form>
Run Code Online (Sandbox Code Playgroud)
看法
<p>{{Session::get('firstName','default value')}}</p>
Run Code Online (Sandbox Code Playgroud) 我需要根据section_name更新css.如果部分是精选 css将是right:0,如果section_name是最新的css将是left:0如何我注入一块PHP到CSS?
<img src="square-009.jpg" style="width:300px; height:355px; position: fixed; z-index:9; right:0;" />
Run Code Online (Sandbox Code Playgroud)
section_name变量已经定义,它正在工作
<?php echo $section['section_name']; ?>
Run Code Online (Sandbox Code Playgroud)