|
@@ -354,10 +354,20 @@ function M.set_album_link(msg_body)
|
|
|
return true, {}
|
|
|
end
|
|
|
|
|
|
+--同步匹配书籍
|
|
|
+function M.sync_match_book_id(msg_body)
|
|
|
+ local isok ,key = tools.checkData({"match_book","product_id"},msg_body)
|
|
|
+ if not isok then
|
|
|
+ return false,string.format("缺少字段: %s.", key)
|
|
|
+ end
|
|
|
+ local sql = string.format("UPDATE video_product SET match_book = '%s' WHERE product_id = '%s' ",msg_body.match_book,msg_body.product_id)
|
|
|
+ mysqldtaskbx.Singleton().query(sql)
|
|
|
+ return true, {}
|
|
|
+end
|
|
|
|
|
|
--添加书籍数据
|
|
|
function M.add_book_data(msg_body)
|
|
|
- local isok ,key = tools.checkData({"album_link","fee_unit","default_price","default_pay_section","publish_time","status","product_parent_id","tg_platform_id","product_id","product_name"
|
|
|
+ local isok ,key = tools.checkData({"author","album_link","fee_unit","default_price","default_pay_section","publish_time","status","product_parent_id","tg_platform_id","product_id","product_name"
|
|
|
,"genre","is_store"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
@@ -371,7 +381,8 @@ function M.add_book_data(msg_body)
|
|
|
return false,"书籍已存在!"
|
|
|
end
|
|
|
|
|
|
- sql = string.format("INSERT INTO `video_product` (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',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
+ sql = string.format("INSERT INTO `video_product` (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',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
+ msg_body.author,
|
|
|
msg_body.album_link,
|
|
|
msg_body.fee_unit,
|
|
|
msg_body.default_price,
|