我有一个名为ChronoFormatter<CalendarDate> hfShortBiblical =
ChronoFormatter.ofGenericCalendarPattern(
"MM/dd/yyyy",
Locale.forLanguageTag("en-US-u-ca-hebrew")
).with(HebrewMonth.order(), HebrewMonth.Order.BIBILICAL);
ChronoFormatter<CalendarDate> hfShortCivil =
ChronoFormatter.ofGenericCalendarPattern(
"MM/dd/yyyy",
Locale.forLanguageTag("en-US-u-ca-hebrew")
).with(HebrewMonth.order(), HebrewMonth.Order.CIVIL);
System.out.println(hfShortBiblical.format(gregorian)); // 09/09/5778
System.out.println(hfShortCivil.format(gregorian)); // 03/09/5778
的表SolarTime jerusalem = SolarTime.ofJerusalem();
HebrewCalendar currentHebrewDate =
SystemClock.currentMoment().toGeneralTimestamp(
HebrewCalendar.axis(),
Timezone.ofSystem().getID(),
StartOfDay.definedBy(jerusalem.sunset())
).toDate();
invoiceDetails
来自另一个名为item_id
的表foreign key
,其表items
为category_id
叫foreign key
。
我想在使用eloquent之后做到这一点:
categories
但我收到错误:
$result = InvoiceDetail::groupBy('item_id')
->selectRaw('sum(qty) as qty, item_id')->with('item', 'category')->get();
这是我在Call to undefined relationship [category] on model [App\InvoiceDetail].
模型中的关系:
Category
有什么建议吗?