feat:交易记录、日期组建
This commit is contained in:
1 parent
08ad1c2d81
commit
88e73ad950
32 files changed
+672
-279
No files matched your search
@@ -72,6 +72,9 @@ class ServiceProduct {
|
||||
/// 用餐类型,早餐、中餐、晚餐
|
||||
String? categoryType;
|
||||
|
||||
/// 菜品上架日期
|
||||
DateTime? saleDate;
|
||||
|
||||
ServiceProduct({
|
||||
this.id,
|
||||
this.spuId,
|
||||
@@ -81,6 +84,7 @@ class ServiceProduct {
|
||||
this.hourType,
|
||||
this.sort,
|
||||
this.categoryType,
|
||||
this.saleDate,
|
||||
});
|
||||
|
||||
factory ServiceProduct.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -38,6 +38,9 @@ ServiceProduct _$ServiceProductFromJson(Map<String, dynamic> json) =>
|
||||
hourType: JsonTool.anyToString(json['hourType']),
|
||||
sort: (json['sort'] as num?)?.toInt(),
|
||||
categoryType: json['categoryType'] as String?,
|
||||
saleDate: json['saleDate'] == null
|
||||
? null
|
||||
: DateTime.parse(json['saleDate'] as String),
|
||||
)..price = (json['price'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$ServiceProductToJson(ServiceProduct instance) =>
|
||||
@@ -51,4 +54,5 @@ Map<String, dynamic> _$ServiceProductToJson(ServiceProduct instance) =>
|
||||
'price': instance.price,
|
||||
'sort': instance.sort,
|
||||
'categoryType': instance.categoryType,
|
||||
'saleDate': instance.saleDate?.toIso8601String(),
|
||||
};
|
||||
Reference in new issue
Block a user