【发布时间】:2012-12-20 05:26:14
【问题描述】:
我可以在 Code Igniter 中做到这一点:
$this->db->select();
$this->from->('node');
if ($published == true)
{
$this->db->where('published', 'true');
}
if (isset($year))
{
$this->db->where('year >', $year);
}
$this->db->get();
如何翻译这段代码以便在 Laravel 中工作?
【问题讨论】: