예제 #1
0
function Mem_updateRoomStatus($update, $select, $check = true)
{
    $result = false;
    $projGUID = $update['ProjGUID'];
    $roomGUID = $update['RoomGUID'];
    $BldGUID = $update['BldGUID'];
    if (memcached_addKey('Update_' . $roomGUID)) {
        $data = APP_getRoomInfo($projGUID, $BldGUID);
        if (!empty($data)) {
            if (isset($data[$roomGUID])) {
                $room =& $data[$roomGUID];
                $set = $check ? $room['ChooseRoom'] != $select : true;
                $set = $set && !empty($update['NewStatus']) && $room['Status'] == $update['Status'];
                if ($set) {
                    if ($select < 2) {
                        $room['ChooseRoom'] = $select > 0 ? 1 : 0;
                        $room['ChooseRoomCstName'] = $select == 1 ? $update['CstName'] : '';
                        $room['SelectTime'] = $select == 1 ? TIMESTAMP : 0;
                    }
                    if ($select == 2 && $update['NewStatus'] == '待售') {
                        $room['ChooseRoom'] = 0;
                    }
                    $room['Status'] = $update['NewStatus'];
                    memcached_set('R_I_' . $BldGUID, $data);
                    $result = true;
                }
            }
        }
        memcached_delete('Update_' . $roomGUID);
    }
    return $result;
}
예제 #2
0
    if (empty($params['projguid'])) {
        $res['result'] = false;
        $res['msg'] = '无效的项目参数';
    } else {
        load()->web('right');
        $res['data'] = App_getBuilds($params['projguid']);
        $right = biz_getUserProjectRight($user['UserGUID'], $params['projguid']);
        $res['right'] = isset($right['Permission']) ? $right['Permission']['app'] : array();
        $res['result'] = true;
        $res['msg'] = '';
    }
    returnJson($res);
}
if ($func == 'roominfo') {
    $res['result'] = true;
    $res['data'] = APP_getRoomInfo($params['projguid'], $params['bldguid']);
    $res['msg'] = '';
    returnJson($res);
}
if ($func == 'selectroom') {
    $room = APP_getRoomStatus($params['projguid'], $params['bldguid'], $params['roomguid']);
    if (!empty($room)) {
        if ($room['Status'] == '待售' && empty($room['ChooseRoom'])) {
            $chips = biz_getChipsByQrcode($params['qrcode']);
            if ($chips['projguid'] != $room['ProjGUID']) {
                $res['msg'] = '认筹单与所选房间非同一项目';
                returnJson($res);
            }
            //认筹单没有选房
            if (!empty($chips)) {
                if (empty($chips['roomstatus'])) {