0) { foreach ($list as $keyOrder => $order) { if (time() > strtotime($order['departure_time'])) { pdo_update('zh_jdgjb_order', array('is_out_time' => 1), array('id' => $order['id'])); $orderData[':uniacid'] = $_W['uniacid']; $orderData[':user_id'] = $order['user_id']; $orderData[':is_out_time'] = 1; $orderData[':is_re_pay'] = 0; $sqlOrder = "select * from " . tablename("zh_jdgjb_order") . " where uniacid = :uniacid and user_id = :user_id and is_out_time = :is_out_time and is_re_pay = :is_re_pay order by id desc "; $result = pdo_fetchall($sqlOrder, $orderData); if (count($result) >= 2) { pdo_update('zh_jdgjb_user', array('level_id' => 0, 'type' => 1), array('id' => $order['user_id'])); } } } } }