add migration
This commit is contained in:
@@ -81,7 +81,9 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
client_id=""
|
||||
qty = params[:qty]
|
||||
total_count=0
|
||||
|
||||
puts batch_id
|
||||
puts 'ello'
|
||||
puts params[:id]
|
||||
# check_member= Member.authenticate_session_token(session_token)
|
||||
# if !check_member.nil?
|
||||
encrypt_key=""
|
||||
@@ -89,6 +91,8 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
|
||||
find_batch = Batch.find_by_id(batch_id)
|
||||
if !find_batch.nil?
|
||||
find_batch.generated_qty = qty
|
||||
find_batch.save
|
||||
card_type=find_batch.adult_or_child.upcase
|
||||
product_category_id=find_batch.product_category_id
|
||||
find_product_category=ProductCategory.find_by_id(product_category_id)
|
||||
@@ -141,9 +145,17 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
manufacture_uid = params[:manufacture_uid]
|
||||
batch_line_item = BatchLineItem.find_by_asset_identity(account_no)
|
||||
if !batch_line_item.nil?
|
||||
puts 'he'
|
||||
batch_line_item.manufacture_uid = manufacture_uid
|
||||
batch_line_item.save
|
||||
|
||||
# update batch
|
||||
batch = Batch.find_by_id(batch_line_item.batch_id)
|
||||
card_qty=batch.qty_processing.to_i
|
||||
success_qty=batch.qty_success
|
||||
|
||||
batch.qty_processing=card_qty+1
|
||||
batch.qty_success=success_qty+1
|
||||
batch.save
|
||||
|
||||
@out = true,"success"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user