예제 #1
0
                break;
            default:
                $column = 'pubuser';
                $fields = array('maxno' => 'maxno+1', 'replycount' => "(SELECT COUNT(*) FROM {$schema}_list WHERE tid='{$params['tid']}')", 'isnewmsg' => ($record[$column] != $params['uid'] and $params['touid'] === '0') ? 1 : 0, 'isnewat' => $params['touid'] === '0' ? 0 : 1);
        }
        StorageEditByID($schema, $fields, Assign($params['tid'], 0));
        $result = array('code' => '101', 'data' => array());
        ## 獲取更貼人信息
        $condition = array('schema' => array("{$schema}_list"), 'fields' => array('*'), 'filter' => array('t0.id' => $id));
        if ($params['touid'] !== '0') {
            $condition['fields'][] = "at AS h_pubuser";
        } else {
            $condition['fields'][] = "(SELECT {$column} FROM {$schema} WHERE id=t0.tid) AS h_pubuser";
        }
        $buf = StorageFindOne($condition);
        if (is_array($buf) and empty($buf) == FALSE) {
            $result['data'][] = array('posttime' => $buf['pubtime'], 'index' => $buf['no'], 'listid' => $buf['id']);
        }
        ## 更新相關用戶消息
        RefreshMsg(Assign($parmas['uid'], 0));
        RefreshMsg(Assign($params['touid'], 0));
        RefreshMsg(Assign($buf['h_pubuser'], 0));
        ## 添加經驗值
        if ($params['tag'] == '1') {
            Techuser_setRank($params['uid'], 1);
        }
        ## 推送消息
        $message_no = '10' . ($params['touid'] == '0' ? '1' : '2') . "0{$params['tag']}";
        JPushMessage($message_no, $params, $schema);
    }
}
예제 #2
0
if (CheckOpenID($params['openid'], $params['uid']) == FALSE) {
    $result['msg'] = MESSAGE_WARNING;
} else {
    if ($params['reward'] == 1) {
        $result['msg'] = '该回复已经被采纳!';
    } else {
        $info_tid = StorageFindID('hh_techforum_list', Assign($params['tolistid'], 0));
        $user_uid = StorageFindID('hh_techuser', Assign($params['uid'], 0));
        $user_touid = StorageFindID('hh_techuser', Assign($params['touid'], 0));
        $info_tid = StorageFindID('hh_techforum', Assign($params['tid'], 0));
        if ($info_tid['rewarded'] == 1) {
            die(JsonEncode(array('code' => '100', 'msg' => '该回复已经被采纳!')));
        }
        ## 設置回帖的採納狀態
        $fields_tolist = array('adopt' => 1);
        StorageEditByID('hh_techforum_list', $fields_tolist, Assign($params['tolistid'], 0));
        ## 添加會貼者之可兌換積分
        $message = sprintf(RANKSCORE_ADOPTED, $info_tid['title'], SafeUsername($user_uid), Techuser_viewRankScore($params['reward']));
        //Techuser_setRankscore(Assign($params['touid'], 0), $params['reward'], $message, TRUE);
        Techuser_setRankByScore(Assign($params['touid'], 0), Techuser_viewRankScore($params['reward']), $message);
        ## 設置主題悬赏狀態
        $fields_tid = array('rewarded' => 1);
        StorageEditByID('hh_techforum', $fields_tid, Assign($params['tid'], 0));
        ## 記錄樓主採納日誌
        $message = sprintf(RANKSCORE_ADOPT, SafeUsername($user_touid), Techuser_viewRankScore($params['reward']));
        Techuser_setRankscore(Assign($params['uid'], 0), 0, $message);
        ## 添加回帖者經驗值
        Techuser_setRank($params['touid'], 2);
        $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS);
    }
}
예제 #3
0
switch ($params['type']) {
    ## 用户身份认证
    case '1':
        $record_identification = StorageFindID('hh_identification', Assign($params['tid'], 0));
        if (is_array($record_identification) and empty($record_identification) == FALSE) {
            ## 更新認證狀態
            $fields = array('status' => Assign($params['status'], 0), 'grade' => Assign($params['grade']));
            StorageEditByID('hh_identification', $fields, Assign($params['tid'], 0));
            $rankscore = 0;
            ## 若認證通過
            if ($params['status'] == '3') {
                ## 更新用戶信息之認真狀態
                $fields = array('identified' => 1);
                StorageEditByID('hh_techuser', $fields, Assign($record_identification['uid'], 0));
                ## 添加用戶經驗值
                $rankscore = Techuser_setRank($record_identification['uid'], 3);
            }
            $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS, 'score' => $rankscore);
        }
        break;
        ## 系統通知推送
    ## 系統通知推送
    case '2':
        $message = StorageFindID('hh_message', Assign($params['tid'], 0));
        if (is_array($message) and empty($message) == FALSE) {
            if ($message['zhuangtai'] == '1') {
                $mid = JPushMessageByAll($message['title'], '10601');
                $result = array('code' => '101', 'message' => $mid);
            }
        }
        break;