Example #1
0
        $record = StorageFindID($schema, Assign($params['tid'], 0));
        ## 更新更貼統計數據
        $fields = array();
        $column = '';
        switch ($params['tag']) {
            case '3':
                $column = 'pubuser';
                $fields = array('maxno' => 'maxno+1', 'replycount' => "(SELECT COUNT(*) FROM {$schema}_list WHERE tid='{$params['tid']}')", 'isnewmsg' => $record[$column] == $params['uid'] ? 0 : 1, 'isnewat' => empty($params['touid']) ? 0 : 1);
                break;
            case '4':
                $column = 'ofuser';
                $fields = array('maxno' => 'maxno+1', 'replycount' => "(SELECT COUNT(*) FROM {$schema}_list WHERE tid='{$params['tid']}')", 'isnewmsg' => $record[$column] == $params['uid'] ? 0 : 1, 'isnewat' => empty($params['touid']) ? 0 : 1);
                break;
            default:
                $column = 'pubuser';
                $fields = array('maxno' => 'maxno+1', 'replycount' => "(SELECT COUNT(*) FROM {$schema}_list WHERE tid='{$params['tid']}')", 'isnewmsg' => $record[$column] == $params['uid'] ? 0 : 1, 'isnewat' => empty($params['touid']) ? 0 : 1);
        }
        StorageEditByID($schema, $fields, Assign($params['tid'], 0));
        $result = array('code' => '101', 'data' => array());
        ## 獲取更貼人信息
        $condition = array('schema' => "{$schema}_list", 'fields' => array('pubtime', 'no', 'id', "(SELECT {$column} FROM {$schema} WHERE id={$schema}_list.id) AS h_pubuser"), 'filter' => array('id' => $id));
        $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));
    }
}
Example #2
0
     $data = array('uid' => Assign($params['uid'], 0), 'tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'type' => Assign($params['type'], 0), 'deviceid' => Assign($params['deviceid']), 'touid' => 0);
     $id = StorageAdd('hh_techuser_dianzan', $data);
     if (empty($id) == FALSE) {
         $message = empty($params['type']) ? '取消成功!' : '点赞成功!';
         $result = array('code' => '101', 'msg' => $message);
     }
 }
 ## 更新點贊通知
 $schemas = array('1' => 'hh_techforum', '2' => 'hh_techforum', '3' => 'hh_techqzhi', '4' => 'hh_zhaopin');
 $info = StorageFindID($schemas[$params['tag']], Assign($params['tid'], 0));
 $pubuser = $params['tag'] == '4' ? 'ofuser' : 'pubuser';
 if (empty($schemas[$params['tag']]) == FALSE and $info[$pubuser] != $params['uid']) {
     $isnewdz = array('isnewdz' => $params['type'] === '1' ? 1 : 0);
     StorageEditByID($schemas[$params['tag']], $isnewdz, Assign($params['tid'], 0));
     ## 被點贊的樓主更新通知
     RefreshMsg(Assign($info[$pubuser], 0));
 }
 ## 推送消息
 if ($params['type'] == '1') {
     $schema = 'hh_techforum';
     switch ($params['tag']) {
         case '3':
             $schema = 'hh_techqzhi';
             break;
         case '4':
             $schema = 'hh_zhaopin';
             break;
     }
     $params['touid'] = 0;
     JPushMessage("1030{$params['tag']}", $params, $schema);
 }
Example #3
0
                if (is_array($buf) and empty($buf) == FALSE) {
                    foreach ($buf as $number => $row_img) {
                        $msg['mdata'][] = array('mid' => $row_img['id'], 'type' => 0, 'mname' => 'image' . ($number + 1), 'mpic' => $row_img['id'] . '_s.png', 'url' => '');
                    }
                }
                $buffer['messages'][] = $msg;
            }
        }
        $result['data'][] = $buffer;
        $schema = 'hh_techqzhi';
        $filter0 = array('tid' => Assign($params['tid'], 0), 'pubuser' => Assign($params['uid'], 0));
        $filter1 = array('tid' => Assign($params['tid'], 0), 'at' => Assign($params['uid'], 0));
        $buffer_host = StorageFindID($schema, Assign($params['tid'], 0));
        if (is_array($buffer_host) and empty($buffer_host) == FALSE) {
            if ($params['uid'] == $buffer_host['pubuser']) {
                StorageEditByID($schema, array('isnewmsg' => 0, 'isnewat' => 0), $params['tid']);
            }
        }
        StorageEdit($schema . '_list', array('isnew' => 0, 'isnewat' => 0), $filter0);
        StorageEdit($schema . '_list', array('isnew' => 0, 'isnewat' => 0), $filter1);
        ## 取消點贊狀態
        RefreshMsgByCDZ($buffer_host['pubuser'], 3, 0);
        RefreshMsgByCDZ($buffer_host['pubuser'], 3, 1);
        RefreshMsg(Assign($buffer_host['pubuser'], 0));
    }
    ## 清除點贊狀態
    StorageEditByID('hh_techqzhi', array('isnewdz' => 0), Assign($params['tid'], 0));
    RefreshMsgByCDZ($params['uid'], 3, 0);
    RefreshMsgByCDZ($params['uid'], 3, 1);
    RefreshMsg(Assign($params['uid'], 0));
}
Example #4
0
// @package hhxc
if (!defined('HHXC')) {
    die('Permission denied');
}
$condition = array('schema' => 'hh_techuser', 'filter' => array('username_d' => Assign($params[KEY_PHONE])));
$record = StorageFindOne($condition);
if (is_array($record) == FALSE or empty($record) == TRUE) {
    $result['msg'] = "用户{$params[KEY_PHONE]}不存在!";
} else {
    $condition['filter']['password'] = Assign($params['pwd']);
    $record = StorageFindOne($condition);
    if (is_array($record) == FALSE or empty($record) == TRUE) {
        $result['msg'] = '密码不正确!';
    } else {
        $result = array('code' => '101', 'msg' => $params[KEY_PHONE], 'data' => array());
        ## 更新OPENID
        $fields = array('loginid' => md5($record['uid'] . $params['password'] . time()), 'deviceid' => Assign($params['deviceid']));
        StorageEditByID('hh_techuser', $fields, $record['id']);
        ## 獲取當前用戶信息
        $condition_sub = array('schema' => 'hh_techuser', 'fields' => array('*', '(SELECT title FROM hh_score WHERE dengji=grade) AS h_grade', '(SELECT title FROM hh_rank WHERE dengji=rankname) AS h_rankname'), 'filter' => array('id' => $record['id']));
        $buf = StorageFindOne($condition_sub);
        if (is_array($buf) and empty($buf) == FALSE) {
            $result['data'][] = array('uid' => $buf['id'], 'openid' => $buf['loginid'], 'image' => $buf['headerimg'], 'nick' => $buf['nick'], 'grade' => $buf['h_grade'], 'score' => $buf['score'], 'city' => $buf['city'], 'cars' => $buf['cars'], 'job' => $buf['job'], 'level' => $buf['level'], 'experience' => $buf['experience'], 'percent' => $buf['percent'], 'needscore' => $buf['needscore'], 'official' => Assign($buf['type'], 0), 'identified' => Assign($buf['identified'], 0), 'rank' => Assign($buf['rank'], 0), 'rankname' => Assign($buf['h_rankname']));
            ## 可兌換積分激活
            Techuser_rankinit($record['id']);
            ## 更新登陸積分
            Techuser_setScore($record['id'], 1);
            RefreshMsg($record['id']);
        }
    }
}