|
@@ -398,6 +398,11 @@ function M.add_book_data(msg_body)
|
|
|
if msg_body.match_book~=nil then
|
|
|
match_book = msg_body.match_book
|
|
|
end
|
|
|
+
|
|
|
+ local totalChapterNum = 0
|
|
|
+ if msg_body.totalChapterNum~=nil then
|
|
|
+ totalChapterNum = msg_body.totalChapterNum
|
|
|
+ end
|
|
|
local sql ;
|
|
|
local isok,res;
|
|
|
local sql = string.format("SELECT id FROM video_product where product_id = '%s' LIMIT 1 ",msg_body.product_id)
|
|
@@ -407,21 +412,22 @@ function M.add_book_data(msg_body)
|
|
|
return false,"书籍已存在!"
|
|
|
end
|
|
|
|
|
|
- sql = string.format("INSERT INTO `video_product` (match_book,words,author,album_link,fee_unit,default_price,default_pay_section,publish_time,status,product_parent_id,book_platform,product_id, product_name, genre,is_store,is_auto) VALUES ('%s','%s','%s','%s',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
- match_book,
|
|
|
- msg_body.words,
|
|
|
- msg_body.author,
|
|
|
- album_link,
|
|
|
- msg_body.fee_unit,
|
|
|
- msg_body.default_price,
|
|
|
- msg_body.default_pay_section,
|
|
|
- msg_body.publish_time,
|
|
|
- msg_body.status,
|
|
|
- msg_body.product_parent_id,
|
|
|
- msg_body.tg_platform_id,
|
|
|
- msg_body.product_id,
|
|
|
- msg_body.product_name,
|
|
|
- msg_body.genre,msg_body.is_store)
|
|
|
+ sql = string.format("INSERT INTO `video_product` (totalChapterNum,match_book,words,author,album_link,fee_unit,default_price,default_pay_section,publish_time,status,product_parent_id,book_platform,product_id, product_name, genre,is_store,is_auto) VALUES (%d,'%s','%s','%s','%s',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
+ totalChapterNum,
|
|
|
+ match_book,
|
|
|
+ msg_body.words,
|
|
|
+ msg_body.author,
|
|
|
+ album_link,
|
|
|
+ msg_body.fee_unit,
|
|
|
+ msg_body.default_price,
|
|
|
+ msg_body.default_pay_section,
|
|
|
+ msg_body.publish_time,
|
|
|
+ msg_body.status,
|
|
|
+ msg_body.product_parent_id,
|
|
|
+ msg_body.tg_platform_id,
|
|
|
+ msg_body.product_id,
|
|
|
+ msg_body.product_name,
|
|
|
+ msg_body.genre,msg_body.is_store)
|
|
|
|
|
|
res = mysqldtaskbx.Singleton().query(sql)
|
|
|
return true,{}
|