|
@@ -15,6 +15,7 @@ local mysqldtaskbx = {}
|
|
|
--product_name 书名
|
|
|
function M.search_book_data(msg_body)
|
|
|
local isok ,key = tools.checkData({
|
|
|
+ "gender",
|
|
|
"is_match",
|
|
|
"start_create_at",
|
|
|
"end_create_at",
|
|
@@ -52,6 +53,12 @@ function M.search_book_data(msg_body)
|
|
|
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+ local gender_param = ""
|
|
|
+ if msg_body.gender~="" then
|
|
|
+ gender_param = string.format(" AND gender = %d ",msg_body.gender)
|
|
|
+ end
|
|
|
+
|
|
|
local product_parent_id_param = ""
|
|
|
if msg_body.product_parent_id~="" then
|
|
|
product_parent_id_param = string.format(" AND product_parent_id = '%s' ",msg_body.product_parent_id)
|
|
@@ -139,7 +146,7 @@ function M.search_book_data(msg_body)
|
|
|
alias_name_param = string.format(" AND ( alias_name LIKE CONCAT( '%%%s%%')) ",msg_body.alias_name)
|
|
|
end
|
|
|
|
|
|
- local param = is_match_param..create_date_param..product_parent_id_param..is_top_param..status_param..date_param..totalChapterNum_param..product_param..product_name_param..tg_platform_param..is_auto_param..is_store_param..genre_param..alias_name_param..word_param;
|
|
|
+ local param = gender_param..is_match_param..create_date_param..product_parent_id_param..is_top_param..status_param..date_param..totalChapterNum_param..product_param..product_name_param..tg_platform_param..is_auto_param..is_store_param..genre_param..alias_name_param..word_param;
|
|
|
|
|
|
if stat_cost_param~="" and up_or_down_publish_time_param ~="" then
|
|
|
up_or_down_publish_time_param = " , "..up_or_down_publish_time_param
|
|
@@ -378,14 +385,14 @@ function M.set_album_link(msg_body)
|
|
|
end
|
|
|
|
|
|
function M.modify_product_info(msg_body)
|
|
|
- local isok ,key = tools.checkData({"id","list_time","words","author","fee_unit","default_price","default_pay_section","publish_time","status","product_parent_id",
|
|
|
+ local isok ,key = tools.checkData({"totalChapterNum","gender","id","list_time","words","author","fee_unit","default_price","default_pay_section","publish_time","status","product_parent_id",
|
|
|
"genre","is_store"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
|
local sql ;
|
|
|
local isok,res;
|
|
|
- sql = string.format("UPDATE `video_product` SET list_time = '%s' , words = '%s' , author = '%s' ,fee_unit = %d , default_price = %f , default_pay_section = %d , publish_time = '%s' , status = %d , product_parent_id = '%s' , genre = %d , is_store = %d WHERE id = %d ",msg_body.list_time,msg_body.words,msg_body.author,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.genre,msg_body.is_store,msg_body.id)
|
|
|
+ sql = string.format("UPDATE `video_product` SET totalChapterNum = %d , gender = %d , list_time = '%s' , words = '%s' , author = '%s' ,fee_unit = %d , default_price = %f , default_pay_section = %d , publish_time = '%s' , status = %d , product_parent_id = '%s' , genre = %d , is_store = %d WHERE id = %d ",msg_body.totalChapterNum,msg_body.gender,msg_body.list_time,msg_body.words,msg_body.author,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.genre,msg_body.is_store,msg_body.id)
|
|
|
res = mysqldtaskbx.Singleton().query(sql)
|
|
|
return true,{}
|
|
|
end
|
|
@@ -423,7 +430,7 @@ end
|
|
|
|
|
|
--添加书籍数据
|
|
|
function M.add_book_data(msg_body)
|
|
|
- local isok ,key = tools.checkData({"list_time","words","author","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({"gender","list_time","words","author","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)
|
|
@@ -451,7 +458,8 @@ function M.add_book_data(msg_body)
|
|
|
return false,"书籍已存在!"
|
|
|
end
|
|
|
|
|
|
- sql = string.format("INSERT INTO `video_product` (list_time,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 ('%s',%d,'%s','%s','%s','%s',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
+ sql = string.format("INSERT INTO `video_product` (gender,list_time,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',%d,'%s','%s','%s','%s',%d,%f,%d,'%s',%d,'%s',%d,'%s','%s',%d,%d,0)",
|
|
|
+ msg_body.gender,
|
|
|
msg_body.list_time,
|
|
|
totalChapterNum,
|
|
|
match_book,
|