|
@@ -556,12 +556,12 @@ function M.send_book_data(msg_body)
|
|
|
for i = 1, #res, 1 do
|
|
|
local product_id = res[i].product_id
|
|
|
local product_name = res[i].product_name
|
|
|
- local sql = string.format("SELECT * FROM video_applet_product where product_id = '%s' and book_platform = %d and dy_small_applet_app_id = '%s' ",product_id,msg_body.tg_platform_id,msg_body.app_id)
|
|
|
- res = mysqldtaskbx.Singleton().query(sql)
|
|
|
- if #res<=0 then
|
|
|
+ local sql = string.format("SELECT * FROM video_applet_product where product_id = '%s' and book_platform = %d and dy_small_applet_app_id = '%s' and main_id = %d ",product_id,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_id)
|
|
|
+ local result = mysqldtaskbx.Singleton().query(sql)
|
|
|
+ if #result<=0 then
|
|
|
sql = string.format("INSERT INTO `video_applet_product` (product_id,product_name,book_platform,dy_small_applet_app_id,main_id,wait_status,status) VALUES ('%s','%s',%d,'%s',%d,%d,%d)",
|
|
|
product_id,product_name,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_id,0,0)
|
|
|
- res = mysqldtaskbx.Singleton().query(sql)
|
|
|
+ mysqldtaskbx.Singleton().query(sql)
|
|
|
end
|
|
|
end
|
|
|
return true,{}
|