12345678910111213141516171819202122232425262728 |
- <?php
- defined('IN_IA') or exit('Access Denied');
- function checkOrder() {
- global $_GPC, $_W;
- $where=" where uniacid = :uniacid and status = :status and is_out_time = :is_out_time";
- $data[':uniacid'] = $_W['uniacid'];
- $data[':status'] = 10;
- $data[':is_out_time'] = 0;
- $sql = "select * from " . tablename("zh_jdgjb_order") . $where . " order by id desc ";
- $list = pdo_fetchall($sql, $data);
- if (count($list) > 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']));
- }
- }
- }
- }
- }
|