• mysql事件(定时任务)处理超时失效订单



    MySQL事件(定时任务)

    https://blog.csdn.net/pan_junbiao/article/details/86489237

    UPDATE wz_mer_goods_spec as a,
    (
    SELECT osn,shop_id,SUM(goods_num) g_num,state,spec_id from wz_mer_goods_details join wz_mer_goods_order using(osn) WHERE state=0 GROUP BY
    spec_id
    ) as d
    SET a.surplus_num=a.surplus_num + d.g_num
    WHERE a.shop_id=d.shop_id
    AND a.spec_id=d.spec_id
    AND TIMESTAMPDIFF(SECOND, a.create_time, NOW()) > 15;
    UPDATE
    wz_mer_goods_order AS order_
    set
    order_.state = '3'
    WHERE 1 = 1
    AND order_.state = '0'
    AND TIMESTAMPDIFF(SECOND, order_.create_time, NOW()) > 15;
    END
    执行场景:
    1:多-用户--同商品同规格(spec_id+mer_gid)--订单失效--同商品同规格 库存增加对应失效订单数量
    2:多用户--同商品不同规格--- 订单失效--库存对应增加失效订单数量
    原始库存

  • 相关阅读:
    离愁
    梦想与生活
    神秘巨星
    Web用户控件
    Ajax
    php的基本语法与字符串与增删改查
    php建立方法
    jquery
    上传文件
    webfrom验证控件
  • 原文地址:https://www.cnblogs.com/yehuisir/p/11251706.html
Copyright © 2020-2023  润新知