我正在使用laravel 5.4,我需要立即检查事件和创建日期条件.所以我使用了以下代码,
protected $table = 'qlog';
public $timestamps = false;
public function getAbondonedCalls(){
$results = DB::table('qlog')
->whereDate('created', '=', DB::raw('curdate()'))
->where('event', '=', 'ABANDON')
->get();
var_dump($results);
die();
}
Run Code Online (Sandbox Code Playgroud)
但是这段代码什么都没有.删除此行后,它返回一条记录.
->whereDate('created', '=', DB::raw('curdate()'))
Run Code Online (Sandbox Code Playgroud)
如何添加这两个条件?
当我尝试访问 symfony 2.8 中的获取结果时,出现此错误。这是我的代码
public function staticAction(Request $request)
{
$jobid = $this->get('session')->get('jobid');
$jobDetails = $this->getVacancyData($jobid);
echo "<pre>";
var_dump($jobDetails);
$description = $jobDetails->jobDescription;
return $this->render('FrontEnd/job.html.twig', array('jobdetails' => $jobDetails ));
}
public function getVacancyData($id){
$vacancy = $this->getDoctrine()
->getRepository(VacancyEntity::class)
->findOneBy(array('id' => $id));
if (!$vacancy) {
throw $this->createNotFoundException();
}else{
return $vacancy;
}
}
Run Code Online (Sandbox Code Playgroud)
以下行发生错误,
$description = $jobDetails->jobDescription;
Run Code Online (Sandbox Code Playgroud)
怎么解决这个问题呢?