查找支付时间比创建时间大于100秒的订单
$field = "id,create_time,pay_time,TIMESTAMPDIFF(SECOND,create_time,pay_time) AS time_balance"; $res = Db::name('subscribe')->field($field)->having('time_balance>100')->select(); print_dump($res);die;
把token_expired的datetime日期往后延长2小时
$re = Db::name('user')->where('id',8)->exp('token_expire','DATE_ADD(token_expire,INTERVAL 2 HOUR)')->update(); print_dump($re);die;