多个未支付的订单,倒计时30分钟,超过删除

timeTimer();//先走一下
    //单纯分钟和秒倒计时
    var timer = setInterval(jishiMs,1000);
    function jishiMs() {
        if($('.daojishi').length <= 0){
            clearInterval(timer);
        }else{
            timeTimer();
        }
    }
function timeTimer() {
        if($('.daojishi').length > 0) { //如果有未支付的订单(将未支付的订单给统一的类daojishi)
            $('.daojishi').each(function (data, index) {
                var orderTime = $(this).attr('otime');//下单时间(日期)
                var nowTime = Date.parse(new Date());//当前时间(时间戳)
                //var oid = $(this).attr('orderid');//订单id(PS:用于后续操作)
                var time1 = datetime_to_unix(orderTime);//下单时间戳(如果保存的是时间戳直接计算)
                var cha = nowTime / 1000 - time1;//差值
                if (cha < 1800) {
                    var M = 29 - Math.floor(cha / 60);
                    var S = 59 - Math.floor(cha % 60);
                    if (M < 10) {
                        M = '0' + M;
                    }
                    if (S < 10) {
                        S = '0' + S;
                    }
                    $(this).text(M + ':' + S);
                } else {
                   //倒计时结束,执行操作
                }
            })
        }
    }
//将日期转为时间戳
function datetime_to_unix(datetime){
        var tmp_datetime = datetime.replace(/:/g,'-');
        tmp_datetime = tmp_datetime.replace(/ /g,'-');
        var arr = tmp_datetime.split("-");
        var now = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
        return parseInt(now.getTime()/1000);
    }

1、日期转时间戳

function datetime_to_unix(datetime){
    var tmp_datetime = datetime.replace(/:/g,'-');
    tmp_datetime = tmp_datetime.replace(/ /g,'-');
    var arr = tmp_datetime.split("-");
    var now = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
    return parseInt(now.getTime()/1000);
}
datetime_to_unix('2018-08-08 22:22:22');

$('.dianhua').bind('input propertychange', function() {
            var val = $('.dianhua').val().trim();
            $('.dianhua').val(val);
            if(val){
                var phone = '';
                var regPos = /^\d+$/;
                for(var i=0;i<val.length;i++){
                    if(regPos.test(val[i])){
                        phone = phone+''+val[i];
                    }else{
                        $('.dianhua').val(phone);
                    }
                }

            }else{
                $('.dianhua').val('');
            }
        });

数据库报错信息:Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_.....

1、修改innodb_file_per_table和innodb_file_format
①登录数据库直接修改参数:

set global innodb_file_per_table=1

set global innodb_file_format=Barracuda

②修改配置文档my.cnf

[mysqld]

innodb_file_per_table = 1
innodb_file_format = Barracuda
2、将表ROW_FORMAT修改为DYNAMIC或COMPRESSED
ALTER TABLE table_name ROW_FORMAT=COMPRESSED

PS:不知道其他问题有没有,my.cnf里还加了(可忽略):
innodb_log_file_size = 256M
innodb_log_buffer_size = 400M