本文整理匯總了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;
}