//倒计时
//未支付的订单在一天之后取消
if ($order['status'] == 0) {
if ( time() > $order['createyttime'] ) {
pdo_update('wx_shop_order', array('status' => -1,'closereason' => '订单超时'), array('id' => $order['id'], 'openid' => $_W['openid']));
}else{
$order['counttime'] = strval($order['createyttime'] - time());
$counttime = array();
if (is_numeric($order['counttime'])){
$counttime = array(
"hours" => 0, //时
"minutes" => 0, //分
"seconds" => 0, //秒
);
if ($order['counttime'] >= 3600) {
$counttime["hours"] = floor($order['counttime'] / 3600);
$order['counttime'] = ($order['counttime'] % 3600);
}
if ($order['counttime'] >= 60) {
$counttime["minutes"] = floor($order['counttime'] / 60);
$order['counttime'] = ($order['counttime'] % 60);
}
$counttime["seconds"] = floor($order['counttime']);
if($counttime["hours"] > 0){
$order['counttime'] = $counttime["hours"] . "小时" . $counttime["minutes"] . "分" . $counttime["seconds"] . "秒";
}elseif($counttime["minutes"] > 0){
$order['counttime'] = "00小时" . $counttime["minutes"] . "分" . $counttime["seconds"] . "秒";
}elseif($counttime["seconds"] >= 0){
$order['counttime'] = "00小时" . "00分" . $counttime["seconds"] . "秒";
}
}
}
}