|
@@ -37,6 +37,29 @@ async function processTask(){
|
|
|
}
|
|
|
}else{
|
|
|
//添加到番茄付费里
|
|
|
+ let data = await require('../src/api/fq/fq_search_book').search_new_id(video_product_info.product_parent_id)
|
|
|
+ if(data!=null&&data!=""){
|
|
|
+ let publish_time = data.on_shelf_time
|
|
|
+ if(publish_time==""){
|
|
|
+ publish_time = data.latest_update_time
|
|
|
+ }
|
|
|
+ let words = data.word_count
|
|
|
+ let book_name = data.book_name;
|
|
|
+ let genre = 1
|
|
|
+ if(words>100000){
|
|
|
+ genre = 1;
|
|
|
+ }else{
|
|
|
+ genre = 3;
|
|
|
+ }
|
|
|
+ await CMD.insert_product({
|
|
|
+ tg_platform_id:config.platform_fanqie,
|
|
|
+ book_name:book_name,
|
|
|
+ genre:genre,
|
|
|
+ book_id:video_product_info.product_parent_id,
|
|
|
+ words:words,
|
|
|
+ publish_time:publish_time
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -56,7 +79,17 @@ async function processTask(){
|
|
|
}
|
|
|
|
|
|
|
|
|
+CMD.insert_product = async function(data){
|
|
|
+ await video_product_controllers.createProductData({
|
|
|
+ book_platform:data.tg_platform_id,
|
|
|
+ product_name:data.book_name,
|
|
|
+ genre:data.genre,
|
|
|
+ product_id:data.book_id,
|
|
|
+ words:data.words,
|
|
|
+ publish_time:data.publish_time
|
|
|
|
|
|
+ })
|
|
|
+}
|
|
|
CMD.init = async function(){
|
|
|
redis_help.connect((results)=>{
|
|
|
if(results){
|