本文整理汇总了PHP中Properties::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Properties::where方法的具体用法?PHP Properties::where怎么用?PHP Properties::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties::where方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListPropReportsPdf
public function getListPropReportsPdf()
{
$cat = Session::get('catid');
if ($cat == "*") {
$props = Properties::all();
$catid = "*";
} else {
$props = Properties::where('prop_category', $cat)->get();
$catid = PropertyCategory::where('id', $cat)->pluck('id');
}
Fpdf::AddPage();
Fpdf::Image('img/dap.jpg', 10, 5, 150);
Fpdf::SetFont('Arial', 'B', 12);
Fpdf::Ln(20.6);
Fpdf::Cell(40, 27, 'List of Properties', 0, 2, 'C', 0);
Fpdf::SetFont('Arial', 'B', 9.5);
Fpdf::Cell(27, 5, 'Property ID', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Serial No', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Property Name', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Category', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Status', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Cost', 1, 0, 'C', 0);
Fpdf::Cell(27, 5, 'Date Acquired', 1, 0, 'C', 0);
Fpdf::Ln();
foreach ($props as $prop) {
Fpdf::SetFont('Arial', 'B', 6);
Fpdf::Cell(27, 4, $prop->propname, 1, 0, 'C', 0);
Fpdf::Cell(27, 4, $prop->serialno, 1, 0, 'C', 0);
Fpdf::Cell(27, 4, $prop->propname, 1, 0, 'C', 0);
$category = PropertyCategory::find($prop->prop_category);
Fpdf::Cell(27, 4, $category->catname, 1, 0, 'C', 0);
Fpdf::Cell(27, 4, $prop->propstatus, 1, 0, 'C', 0);
Fpdf::Cell(27, 4, $prop->propcost, 1, 0, 'C', 0);
Fpdf::Cell(27, 4, $prop->formatDateAcquired(), 1, 0, 'C', 0);
Fpdf::Ln();
}
Fpdf::Output();
exit;
}