904118851 hace 1 mes
padre
commit
c6d7d50392
Se han modificado 1 ficheros con 7 adiciones y 7 borrados
  1. 7 7
      task_script/reset_link.js

+ 7 - 7
task_script/reset_link.js

@@ -35,19 +35,19 @@ async function processTask(){
     let product_id = productIds.pop()
     let connection  = null
     try{
-        if(typeof product_id == "string"){
 
-        }else{
-            product_id = `'${product_id}'`
-        }
+        product_id = product_id.replace(/'/g, '');
+
+        product_id = `"${product_id}"`;
+   
         connection = await mysql.createConnection({
             ...taskdbConfig,
             multipleStatements: true
         });
-        let sql = ` update video_applet_product set status = 0 , wait_status = 0 where product_id = ${product_id} `
+        let sql = ` update video_applet_product set create_at = ? , status = 0 , wait_status = 0 where product_id = ${product_id} AND status = 1 `
         console.log("sql:",sql)
         await connection.execute(
-            sql
+            sql,Date.now()
         );
 
     }catch(e){
@@ -69,7 +69,7 @@ CMD.init = async function(){
             const filePath = './reset_link.xlsx';
             productIds = getProductIds(filePath);
             console.log("productIds:",productIds)
-            productIds = ["7507540479207031321"]
+            productIds = ["7491562200453090329"]
             processTask();
         }
     })