Пример #1
0
        //定单没有确认,
        load()->web('app');
        $room = db_getRoomByGUID($chips['roomguid']);
        if (!empty($room)) {
            if ($room['Status'] == '交款') {
                $room['NewStatus'] = '认购';
                //4强制更新状态?
                APP_updateRoomStatus($room, $chips, 2);
            }
            if (empty($chips['ProtocolNO'])) {
                load()->web('print');
                biz_updateChipsProtocolNo($chips);
            }
            if (biz_insertFee($chips, $room)) {
                //更新状态为确认
                db_updateChipsStatus($chips['id'], 8);
                message('认购确定,生成供款明细成功!', $this->createWebUrl($do));
            } else {
                message('生成供款明细失败!', $this->createWebUrl($do));
            }
        } else {
            message('无效的房间数据!', $this->createWebUrl($do));
        }
    }
    include $this->template('book_disp');
}
if ($op == 'print') {
    load()->web('print');
    $id = intval($_GPC['id']);
    $chips = biz_getChips($id, true);
    $printTitle = '认购书';
Пример #2
0
/**
 * 更新认筹单选房相关信息
 *    +对应状态更新
 * @param $chips
 * @param $state
 * @param null $room
 */
function biz_updateChipsRoomStatus($chips, $state, $room = null)
{
    $update = array();
    if ($state == 0) {
        $update = array('roomguid' => '', 'roomcode' => '', 'roomstatus' => '0', 'shouldpay' => 0);
    }
    if ($state == 1) {
        $update['roomguid'] = $room['RoomGUID'];
        $update['roomcode'] = empty($room['ShowCode']) ? $room['RoomCode'] : $room['ShowCode'];
        $update['roomstatus'] = 1;
        $update['shouldpay'] = biz_getRoomOrderPay($room);
    }
    if ($state == 2) {
        //预留转认购,设置状态为确认
        //db_updateChipsStatus($chips['id'], 8);
    } else {
        pdo_update('chips', $update, array('id' => $chips['id']));
        //内选退房,去除选房状态,---$state为空,去掉
        db_updateChipsStatus($chips['id'], 6, empty($state));
    }
}
Пример #3
0
function print_addTask($chips, $backUrl, $printType)
{
    global $_W, $_GPC;
    $templates = biz_getPrintTemplates($_W['project']['projguid'], $printType, 'id');
    if (empty($templates) || count($templates) == 0) {
        message('无可用的打印模板,请找管理配置模板!', $backUrl, 'error');
    }
    $templateId = trim($_GPC['template']);
    if (!isset($templates[$templateId])) {
        message('无效的打印模板', $backUrl);
    }
    $prints = biz_getAllPrinter($_W['project']['projguid']);
    if (empty($prints) || count($prints) == 0) {
        message('无可用的打印机,请找管理员确认打印机配置!', $backUrl, 'error');
    }
    $titles = biz_getDictionary('printtype');
    $printTitle = $titles[$printType];
    if (empty($printTitle)) {
        message('无效的打印调用!', $backUrl, 'error');
    }
    $template = $templates[$templateId];
    $printId = intval($_GPC['printer']);
    //记录当前使用的打印机
    isetcookie('__print', $printId);
    $print = $prints[$printId];
    if (!biz_checkChipsStatus($chips, $printType, 'printstatus')) {
        db_updateChipsStatus($chips['id'], $printType, false, 'printstatus');
    }
    $copy_max = 9;
    $copy = intval($_GPC['copy']);
    if ($copy <= 0) {
        $copy = 1;
    }
    if ($copy > $copy_max) {
        $copy = $copy_max;
    }
    $printdata = biz_Print_getTemplateData($templateId, $chips);
    $task = array('projguid' => $chips['projguid'], 'title' => $chips['cname'] . '-' . $printTitle, 'printid' => $printId, 'moduleid' => $print['moduleid'], 'templateid' => $templateId, 'templatename' => $template['title'], 'key' => $chips['qrcode'], 'printname' => $print['title'], 'printtype' => $printType, 'printdata' => iserializer($printdata), 'createid' => $_W['uid'], 'creator' => $_W['username'], 'copy' => $copy, 'status' => '等待', 'createtime' => TIMESTAMP);
    if (pdo_insert('printtask', $task)) {
        message('数据已进入排队打印中,请稍候...', $backUrl);
    } else {
        message('写入打印任务数据出错', $backUrl);
    }
}
Пример #4
0
/**
 *获得签到全局表信息
 * 自动增加组
 * @param $key 认筹单二维码key
 * @param $project 项目
 */
function App_Sign_getGroup($key, $project)
{
    $res = array('signed' => false, 'msg' => '');
    $pid = $project['id'];
    //查询是否已有分配的签到
    $sign = biz_getSignInfoByQrcode($key, $pid);
    $chips = biz_getChipsByQrcode($key);
    if (empty($chips)) {
        $res['msg'] = '无效认筹单';
        return $res;
    }
    if (empty($sign) || $sign['preset'] == 1) {
        if ($chips['projguid'] != $project['projguid']) {
            $res['msg'] = '认筹单所属非当前项目';
            return $res;
        }
        //处理已签到信息
        if ($chips['singed'] == 1) {
            $res['msg'] = '认筹单已签到';
            return $res;
        }
    }
    if (isset($chips) || !$sign['signed']) {
        $cachekey = 'lock_sign_' . $pid;
        //写入签到信息
        if (memcached_addKey($cachekey, 30)) {
            if (empty($sign)) {
                $info = getGlobalSign($project);
                $sign = biz_insertSignInfo($chips, $info['group']['dispnum'], $pid, false, true);
                if (!empty($sign)) {
                    // $sign = biz_getSignInfoByQrcode($key, $pid);
                    $res['signed'] = true;
                    $res['group'] = $info['group']['dispnum'];
                }
            } else {
                if (empty($sign['signed'])) {
                    $update['signed'] = 1;
                    $update['signtime'] = TIMESTAMP;
                    pdo_update('sign', $update, array('id' => $sign['id']));
                    unset($update);
                    $sign['signed'] = 1;
                    $sign['signtime'] = TIMESTAMP;
                    $res['signed'] = true;
                    $res['group'] = $sign['gid'];
                }
            }
            if (!empty($sign)) {
                //更新对应组信息
                Sign_updateGroup($sign, true);
            }
            if ($res['signed']) {
                //签到记录组号
                pdo_update('chips', array('signed' => $sign['gid']), array('id' => $chips['id']));
                db_updateChipsStatus($chips['id'], 4);
            }
            memcached_delete($cachekey);
        }
    } else {
        $res['signed'] = !empty($sign['signed']);
    }
    $res['sign'] = $sign;
    return $res;
}