update db index

This commit is contained in:
Aung Myo
2018-07-04 18:08:15 +06:30
parent bdd20f727e
commit 4f9a4e2984
7 changed files with 49 additions and 47 deletions

View File

@@ -71,10 +71,12 @@ class SalePayment < ApplicationRecord
# update complete order items in oqs
booking = Booking.find_by_sale_id(sale_id)
booking.booking_orders.each do |sodr|
AssignedOrderItem.where("order_id = '#{ sodr.order_id }'").find_each do |aoi|
aoi.delivery_status = 1
aoi.save
end
assigned =AssignedOrderItem.where("order_id = '#{ sodr.order_id }'").pluck(:assigned_order_item_id)
AssignedOrderItem.where({ order_id: '#{assigned}'}).update_all(print_status: true)
# AssignedOrderItem.where("order_id = '#{ sodr.order_id }'").find_each do |aoi|
# aoi.delivery_status = 1
# aoi.save
# end
end
return true, self.save,membership_data
@@ -616,8 +618,9 @@ class SalePayment < ApplicationRecord
end
end
if status && sale_count == 0
table.status = "available"
table.save
table.update_attributes(status: "available")
# table.status = "available"
# table.save
end
# type = 'payment'