Минорные фиксы

This commit is contained in:
Данила Мочалов 2023-12-03 20:25:58 +04:00
parent 963ef167c8
commit af6a0ffe3e
4 changed files with 7 additions and 6 deletions

View File

@ -24,6 +24,6 @@ interface OrderDao {
fun getByUserId(userId: Int): Flow<List<OrderWithProducts>>
@Query("select * from orders where orders.user_id =:userId and orders.order_status = 'Неоплачено'")
fun getUnpaidByUser(userId: Int) : Flow<OrderWithProducts>
@Query("select * from orders where orders.user_id =:userId and orders.order_status = 'Готовится'")
@Query("select * from orders where orders.user_id =:userId and (orders.order_status = 'Готовится' or orders.order_status = 'Готово')")
fun getPaidByUser(userId: Int) : Flow<List<OrderWithProducts>>
}

View File

@ -7,5 +7,6 @@ data class OrderProductModelWithProduct(
@Embedded
val orderProductModel: OrderProductModel,
@Relation(entity = ProductModel::class, parentColumn = "product_id", entityColumn = "id")
val product: ProductModel
val product: ProductModel,
)

View File

@ -199,7 +199,7 @@ fun PaidItem(order : OrderWithProducts) {
fontWeight = FontWeight.Bold
)
Text(
text = order.orderWithProducts[index].orderProductModel.totalPrice.toString() + " руб.",
text = (order.orderWithProducts[index].orderProductModel.quantity * order.orderWithProducts[index].product.price).toString() + " руб.",
fontFamily = NunitoFamily,
fontSize = 20.sp,
modifier = Modifier.padding(top = 15.dp),
@ -250,7 +250,7 @@ fun CartItem(order : OrderWithProducts) {
fontWeight = FontWeight.Bold
)
Text(
text = order.orderWithProducts[index].orderProductModel.totalPrice.toString() + " руб.",
text = (order.orderWithProducts[index].orderProductModel.quantity * order.orderWithProducts[index].product.price).toString() + " руб.",
fontFamily = NunitoFamily,
fontSize = 18.sp,
fontWeight = FontWeight.Bold

View File

@ -54,11 +54,11 @@ class UserViewModel @Inject constructor(
_registrationState.postValue(false)
return
}
if (login.length < 8 || login.length > 20) {
if (login.length < 5 || login.length > 20) {
_registrationState.postValue(false)
return
}
if (password.length < 8 || password.length > 20) {
if (password.length < 5 || password.length > 20) {
_registrationState.postValue(false)
return
}