// @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } 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']));
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號095 邀請好友 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $result = array('code' => '101', 'msg' => 'exclusive'); $record = StorageFindID('hh_techuser', Assign($params['uid'], 0)); $result['withcode'] = (is_array($record) and empty($record) == FALSE) ? $record['withcode'] : ''; $condition = array('schema' => 'hh_dbver', 'filter' => array('vername' => 'yaoqinwenan')); $buf = StorageFindOne($condition); if (is_array($buf) and empty($buf) == FALSE) { $result['information'] = str_replace('_code_', $result['withcode'], $result['remark']); } }
$filter = array('tag' => $params['tag'], 'tid' => $buffer['listid'], 'type' => 1, 'touid' => 1); if (empty($params['uid']) == FALSE) { $filter['uid'] = Assign($params['uid'], 0); } if (StorageCount('hh_techuser_dianzan', $filter)) { $buffer['mypraise'] = '1'; } $filter = array('tag' => $params['tag'], 'tid' => $buffer['listid'], 'type' => 1, 'touid' => 1); //if (empty($params['uid']) == FALSE) $filter['uid'] = Assign($params['uid'], 0); $buffer['praises'] = Assign(StorageCount('hh_techuser_dianzan', $filter), 0); $result['data'][] = $buffer; } $schema = 'hh_techforum'; $filter0 = array('tid' => Assign($params['tid'], 0), 'pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0)); $filter1 = array('type' => Assign($params['tag'], 0), 'tid' => Assign($params['tid'], 0), 'at' => Assign($params['uid'], 0)); $buffer_host = StorageFindID('hh_techforum', 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'], $params['tag'], 0); RefreshMsgByCDZ($buffer_host['pubuser'], $params['tag'], 1); RefreshMsg(Assign($buffer_host['pubuser'], 0)); } ## 消除點贊狀態 StorageEditByID('hh_techforum', array('isnewdz' => 0), Assign($params['tid'], 0)); RefreshMsgByCDZ($params['uid'], $params['tag'], 0);
if (is_array($record_user_posttime) and empty($record_user_posttime) == FALSE) { $buffer_user_posttime = $record_user_posttime['createdat']; } ## 更新帖子被點贊最新時間 if ($buffer_main['createdat'] < $buffer_user_posttime) { $buffer_main['createdat'] = $buffer_user_posttime; } ## 構建點贊人信息 $buffer_main['praisedata'][] = array('uid' => Assign($record_user['id'], 0), 'userpic' => Assign($record_user['headerimg']), 'usernick' => Assign($record_user['nick']), 'grade' => Assign($record_user['h_grade'], 0), 'adopt' => '0', 'anonymous' => '0', 'official' => Assign($record_user['type'], 0), 'identified' => Assign($record_user['identified'], 0), 'rank' => Assign($record_user['rank'], 0), 'rankname' => Assign($record_user['h_rankname'], 0), 'posttime' => Assign($buffer_user_posttime), 'content' => '', 'listid' => '0', 'index' => '0', 'medias' => '0', 'mdata' => array()); } } ## }}} 獲取點贊者信息 ## 獲取樓主信息 {{{ $buffer_tid = $row_main['tid']; if ($index == 1) { $record_tid = StorageFindID($schema, $row_main['tid']); if (is_array($record_tid) and empty($record_tid) == FALSE) { $buffer_tid = $record_tid['tid']; } } $condition_host = array('schema' => array('hh_techuser', $schemas[0]), 'fields' => array('*', 't0.id AS h_uid', 't1.id AS h_tid', 't0.type AS h_official', "(SELECT COUNT(*) FROM {$schemas[1]} WHERE tid=t1.id) AS h_messages", 't0.grade AS h_grade', '(SELECT title FROM hh_rank WHERE dengji=t0.rankname) AS h_rankname'), 'filter' => array('t0.id' => "t1.{$keys[0][0]}", 't1.id' => $buffer_tid)); $record_host = StorageFindOne($condition_host); if (is_array($record_host) and empty($record_host) == FALSE) { $buffer_host = array('uid' => Assign($record_host['h_uid'], 0), 'userpic' => Assign($record_host['headerimg']), 'usernick' => Assign($record_host['nick']), 'grade' => Assign($record_host['h_grade'], 0), 'anonymous' => Assign($record_host['anonymous'], 0), 'reward' => Assign($record_host['reward'], 0), 'posttime' => Assign($record_host[$keys[0][1]]), 'official' => Assign($record_host['h_official'], 0), 'identified' => Assign($record_host['identified'], 0), 'rank' => Assign($record_host['rank'], 0), 'rankname' => Assign($record_host['h_rankname']), 'title' => Assign($record_host['h_title']), 'context' => Assign($record_host['h_content']), 'collect' => 0, 'mypraise' => 0, 'praises' => 0, 'tid' => Assign($record_host['h_tid'], 0), 'messages' => Assign($record_host['h_messages'], 0), 'medias' => 0, 'mdata' => array(), 'level' => Assign($record_host['level'], 0), 'experience' => Assign($record_host['experience'], 0), 'city' => Assign($record_host['city']), 'job' => Assign($record_host['job']), 'salary' => Assign($record_host['salary']), 'headcount' => Assign($record_host['headcount'], 0)); ## 查詢收藏狀態 $filter_host_count = array('uid' => $buffer_host['uid'], 'tid' => $buffer_host['tid'], 'tag' => $tag, 'type' => 1); if (StorageCount('hh_techuser_shoucang', $filter_host_count)) { $buffer_host['collect'] = '1'; } ## 查詢被點贊狀態和總數 $filter_host_count['touid'] = $index;
function JPushMessage($meessageno, $params, $schema) { global $PUSH_MESSAGES; $jpush = array('message' => $PUSH_MESSAGES[$meessageno]); ## 獲取跟帖者信息 $buffer_uid = StorageFindID('hh_techuser', Assign($params['uid'], 0)); if (is_array($buffer_uid) and empty($buffer_uid) == FALSE) { $jpush['who'] = $buffer_uid; } ## 獲取發帖者信息 if (empty($params['touid'])) { $buffer_tid = StorageFindID($schema, Assign($params['tid'], 0)); if (is_array($buffer_tid) and empty($buffer_tid) == FALSE) { $jpush['title'] = $buffer_tid['title']; $key_pubuser = $params['tag'] == 4 ? 'ofuser' : 'pubuser'; $buffer_user = StorageFindID('hh_techuser', $buffer_tid[$key_pubuser]); if (is_array($buffer_user) and empty($buffer_user) == FALSE) { $jpush['user'] = $buffer_user; } } } else { $buffer_tolistid = StorageFindID($schema . '_list', Assign($params['tolistid'], 0)); if (is_array($buffer_tolistid) and empty($buffer_tolistid) == FALSE) { $jpush['title'] = $buffer_tolistid['title']; $jpush['user'] = StorageFindID('hh_techuser', Assign($params['touid'], 0)); } } $jpush['params'] = array('type' => $meessageno); return JPushMessageByUser($jpush); }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號112 懸賞值列表 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $result = array('code' => '101', 'data' => array()); $record = StorageFindID('hh_techuser', $params['uid']); $buffer = array(); $scores = array(50, 100, 150, 200, 300, 500); foreach ($scores as $score) { if ($score < Techuser_viewRankScore($record['rankscore'])) { $buffer['datavalue'][] = $score; } } $buffer['allreward'] = $record['rankscore']; $buffer['changevalue'] = RANK_RS2R; $result['data'][] = $buffer; //$result['msg'] = sprintf(ASK_MESSAGE, $record['rankscore'], RANK_RS2R); }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號020 汽修人之發布求職新貼 // // @authors hjboss <*****@*****.**> 2015-12-17# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARING; } else { $data = array('pubuser' => Assign($params['uid'], 0), 'pubtime' => 'NOW()', 'level' => Assign($params['level']), 'experience' => Assign($params['experience']), 'city' => Assign($params['city']), 'cars' => Assign($params['cars']), 'job' => Assign($params['job']), 'introduce' => Assign($params['introduce'])); $id = StorageAdd('hh_techqzhi', $data); if (empty($id) == TRUE) { $result['msg'] = '发送失败!'; } else { $result = array('code' => '101', 'data' => array()); $record = StorageFindID('hh_techqzhi', $id); if (is_array($record) and empty($record) == FALSE) { $result['data'][] = array('posttime' => $record['pubtime'], 'tid' => $record['id']); } } }
$schema = 'hh_techqzhi'; $data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'tid' => Assign($params['tid'], 0), 'content' => Assign($params['content']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous']), 'no' => "(SELECT maxno FROM {$schema} WHERE id='{$params['tid']}')", 'at' => Assign($params['touid'], 0), 'atlist' => Assign($params['tolistid']), 'isnewat' => $is_newat); break; case '4': $schema = 'hh_zhaopin'; $data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'tid' => Assign($params['tid'], 0), 'content' => Assign($params['content']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous']), 'no' => "(SELECT maxno FROM {$schema} WHERE id='{$params['tid']}')", 'at' => Assign($params['touid'], 0), 'atlist' => Assign($params['tolistid']), 'isnewat' => $is_newat); break; default: $schema = 'hh_techforum'; $data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'tid' => Assign($params['tid'], 0), 'content' => Assign($params['content']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous']), 'no' => "(SELECT maxno FROM {$schema} WHERE id='{$params['tid']}')", 'at' => Assign($params['touid'], 0), 'atlist' => Assign($params['tolistid']), 'isnewat' => $is_newat); } $id = StorageAdd("{$schema}_list", $data); if (empty($id) == TRUE) { $result['msg'] = '发送失败!'; } else { $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);
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號008 發送正在解決問題的回復 // // @authors hjboss <*****@*****.**> 2015-12-14# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $data = array('uid' => Assign($params['uid'], 0), 'qid' => Assign($params['qid'], 0), 'content' => Assign($params['content']), 'pubtime' => 'NOW()', 'no' => "(SELECT maxno FROM hh_questions WHERE id='{$params['qid']}')+1", 'type' => 1); $id = StorageAdd('hh_questions_list', $data); if (empty($id) == TRUE) { $result['msg'] = '发送失败!'; } else { $result = array('code' => '101', 'data' => array()); StorageEdit('hh_questions', array('maxno' => 'maxno+1'), array('id' => $params['qid'])); $buf = StorageFindID('hh_questions_list', $id); if (is_array($buf) and empty($buf) == FALSE) { $result['data'][] = array('posttime' => $buf['pubtime'], 'index' => $buf['no']); } } }
$old_img = $record['headerimg']; } else { $img_path = get_threeimg($params['uid'], $params['iconurl']); $data = array('thirduid' => Assign($params['uid'], 0), 'nick' => Assign($params['nick']), 'city' => Assign($params['city']), 'tag' => Assign($params['tag'], 0), 'headerimg' => $img_path); $uid = StorageAdd('hh_techuser', $data); } if (empty($uid) == TRUE) { $result['msg'] = '登陆不存在!'; } else { $record = StorageFindOne($condition); if (is_array($record) == FALSE or empty($record) == TRUE) { $result['msg'] = '登陆失败!'; } else { $fields = array('loginid' => md5($params['uid'] . $params['pwd'] . time()), 'deviceid' => Assign($params['deviceid'])); StorageEditByID('hh_techuser', $fields, $uid); if (empty($old_img) == TRUE) { $img_path = get_threeimg($params['uid'], $params['iconurl']); StorageEditByID('hh_techuser', array('headerimg' => $img_path), $uid); } $result = array('code' => '101', 'data' => array()); $condition_user = array('schema' => 'hh_techuser', 'fields' => array('*', '(SELECT title FROM hh_score WHERE dengji=grade) AS h_grade'), 'filter' => array('id' => $uid)); $record_user = StorageFindOne($condition_user); $icon_path = $record_user['headerimg']; if (empty($icon_path) or strpos($icon_path, 'http') > -1) { $icon_path = $img_path; } $rankinfo = StorageFindID('hh_rank', $record_user['rankname'] + 1); $result['data'][] = array('uid' => Assign($record_user['id'], 0), 'phone' => Assign($record_user['username_d']), 'openid' => Assign($record_user['loginid']), 'image' => $icon_path, 'nick' => Assign($record_user['nick']), 'grade' => Assign($record_user['h_grade']), 'score' => Assign($record_user['score']), 'city' => Assign($record_user['city']), 'cars' => Assign($record_user['cars']), 'job' => Assign($record_user['job']), 'level' => Assign($record_user['level']), 'experience' => Assign($record_user['experience']), 'percent' => Assign($record_user['percent']), 'needscore' => Assign($record_user['needscore']), 'official' => Assign($record_user['type'], 0), 'identified' => Assign($record_user['identified'], 0), 'rank' => Assign($record_user['rank'], 0), 'rankname' => $rankinfo['title']); Techuser_setScore($uid, 1); } }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號090 汽修人之招聘新貼 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $data = array('ofuser' => Assign($params['uid'], 0), 'job' => Assign($params['job']), 'salary' => Assign($params['salary']), 'headcount' => Assign($params['headcount']), 'city' => Assign($params['city']), 'contactinfo' => Assign($params['contactinfo']), 'boon' => Assign($params['boon']), 'business' => Assign($params['business']), 'scale' => Assign($params['scale']), 'name' => Assign($params['name']), 'location' => Assign($params['location']), 'etc' => Assign($params['etc']), 'createdat' => 'NOW()'); $id = StorageAdd('hh_zhaopin', $data); if (empty($id)) { $result['msg'] = '发送失败!'; } else { $result = array('code' => '101', 'data' => array()); $record = StorageFindID('hh_zhaopin', $id); if (empty($record) == FALSE) { $result['data'][] = array('posttime' => $record['createdat'], 'tid' => $record['id']); } } }
$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; ## 兼容舊版設置積分 ## 兼容舊版設置積分 case '3': $return = Techuser_setScore($params['uid'], $params['score']); $result = array('code' => '101', 'return' => $return); break; ## 清除積分限制 ## 清除積分限制
// 技術版API編號014 發表汽修人跟帖 ##已取消 新接口014 // // @authors hjboss <*****@*****.**> 2015-12-16# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARING; } else { $schema = 'hh_techforum_list'; $schema_s = 'hh_techforum'; if ($params['tag'] == '3') { $schema = 'hh_techqzhi_list'; $schema_s = 'hh_techqzhi'; } $data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'tid' => Assign($params['tid'], 0), 'content' => Assign($params['content']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous'], 0), 'no' => "(SELECT maxno FROM {$schema_s} WHERE id='{$params['tid']}')"); $id = StorageAdd($schema, $data); if (empty($id) == TRUE) { $result['msg'] = '发送失败!'; } else { $result = array('code' => '101', 'data' => array()); $fields = array('maxno' => 'maxno+1', 'replycount' => "(SELECT COUNT(*) FROM {$schema} WHERE tid='{$params['tid']}')"); StorageEditByID($schema_s, $fields, Assign($params['tid'], 0)); $record = StorageFindID($schema, $id, '*'); if (is_array($record) and empty($record) == FALSE) { $result['data'][] = array('posttime' => $record['pubtime'], 'index' => $record['no']); } } }
// Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號103 查案例-獲取案例詳細信息 ##代替058 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $the_times = CheckTimes($params['openid'], $params['uid']); $url_anli = sprintf(PAGE_ANLI, $params['uid'], $params['openid'], DEBUG); if (empty($the_times) == FALSE) { $result = array('code' => '101'); $record = StorageFindID('search_result', Assign($params['cid'], 0)); if (is_array($record) and empty($record) == FALSE) { $result['caseurl'] = $url_anli . $record['id']; } } else { $condition_sub = array('schema' => 'hh_techuser', 'fields' => array('grade'), 'filter' => array('id' => Assign($params['uid'], 0))); $condition = array('schema' => 'hh_score', 'fields' => array('chakan'), 'filter' => '(' . SQLSub($condition_sub) . ')'); $record = StorageFindOne($condition); if (is_array($record) and empty($record) == FALSE) { $result = array('code' => '103', 'msg' => $recod['chakan']); } } }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版APP 分享頁面公共頁面 // // @authors hjboss <*****@*****.**> 2015-12-14# // @version 1.0.0 // @package hhxc define('HHXC', TRUE); require_once 'common.php'; $faultcode = StorageFindID('car_odbfault', Assign($_REQUEST['id'])); $title = $faultcode['miaoshu']; $content = $faultcode['fangan']; include_once 'share_common.php';
$msg['praises'] = Assign(StorageCount('hh_techuser_dianzan', $filter_total), 0); $condition_sub = array('schema' => 'hh_techqzhi_list_img', 'fields' => array('id'), 'filter' => array('listid' => $row['id'])); $buf = StorageFind($condition_sub); 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);
if (is_array($record) and empty($record) == FALSE) { $fields = array('type' => Assign($params['type'], 0)); $num = StorageEdit('hh_techuser_dianzan', $fields, $condition['filter']); $message = empty($params['type']) ? '取消成功!' : '点赞成功!'; $result = array('code' => '101', 'msg' => $message); } else { $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':
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號107 獲取案例跟貼(服務器頁面Ajax專用) // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } header('Access-Control-Allow-Origin:*'); $result = array('code' => '101', 'data' => array()); $condition = array('schema' => 'hh_anli_thread', 'filter' => array('cid' => empty($_REQUEST['cid']) ? Assign($params['cid'], 0) : $_REQUEST['cid']), 'others' => 'ORDER BY id DESC', 'charset' => TRUE); $recordset = StorageFind($condition); if (is_array($recordset) and empty($recordset) == FALSE) { foreach ($recordset as $index => $row) { $record = StorageFindID('hh_techuser', $row['uid']); $content = $row['content']; if (empty($row['version']) == FALSE) { $content = Charset($content, DB_CHARSET, CL_CHARSET); } $result['data'][] = array('uid' => Assign($row['uid'], 0), 'nick' => Assign($record['nick'], NICK_DEFAULT), 'image' => empty($record['headerimg']) ? ICON_DEFAULT : ICON_PATH . $record['headerimg'], 'potimes' => $row['createdat'], 'context' => $content, 'cid' => $row['cid']); } }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號019 汽修人之獲取求職主題詳情 ##已取消 新接口074 // // @authors hjboss <*****@*****.**> 2015-12-17# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } $record = StorageFindID('hh_techqzhi', Assign($params['tid'], 0)); if (is_array($record) == FALSE or empty($record) == TRUE) { $result['msg'] = MESSAGE_EMPTY; } else { $result = array('code' => '101', 'data' => array()); $buf = array('cars' => $record['cars'], 'job' => $record['job'], 'introduce' => $record['introduce'], 'messages' => array()); $condition = array('schema' => 'hh_techqzhi_list', 'fields' => array('*', '(SELECT nick FROM hh_techuser WHERE id=pubuser) AS h_nick', '(SELECT headerimg FROM hh_techuser WHERE id=pubuser) AS h_headerimg'), 'filter' => array('tid' => Assign($params['tid'], 0), 'no' => array('GT', Assign($params['index'], 0)))); $recordset = StorageFind($condition); if (is_array($recordset) and empty($recordset) == FALSE) { foreach ($recordset as $index => $row) { $buf['messages'][] = array('uid' => $row['pubuser'], 'userpic' => $row['h_headerimg'], 'usernick' => $row['h_nick'], 'posttime' => $row['pubtime'], 'content' => $row['content'], 'index' => $row['no']); } } $result['data'][] = $buf; }
} if (empty($result['msg']) == TRUE or empty($params['reward']) == TRUE) { $data = array('pubuser' => Assign($params['uid'], 0), 'type' => Assign($params['tag'], 0), 'title' => Assign($params['title']), 'content' => Assign($params['context']), 'pubtime' => 'NOW()', 'anonymous' => Assign($params['anonymous'], 0), 'reward' => Assign($params['reward'], 0), 'rewarded' => empty($params['reward']) ? 0 : $rankscore); $id = StorageAdd('hh_techforum', $data); if (empty($id) == TRUE) { $result['msg'] = MESSAGE_ERROR; } else { for ($index = 0; $index < 6; $index++) { $field = 'image' . strval($index + 1); if ($_FILES[$field]['error'] <= 0 and empty($_FILES[$field]['tmp_name']) == FALSE) { $buf_data = array('qid' => $id, 'createdat' => 'NOW()', 'filename' => $_FILES[$field]['name'], 'size' => $_FILES[$field]['size']); $buf_id = StorageAdd('hh_techforum_img', $buf_data); $uploadfile = PIC_F_PATH . DIRECTORY_SEPARATOR . "{$buf_id}.png"; $uploadfile_s = PIC_F_PATH . DIRECTORY_SEPARATOR . "{$buf_id}_s.png"; move_uploaded_file($_FILES[$field]['tmp_name'], $uploadfile); MakeSmallIMG($uploadfile, $uploadfile_s); } } $result = array('code' => '101', 'data' => array()); $record = StorageFindID('hh_techforum', $id); if (is_array($record) and empty($record) == FALSE) { $result['data'][] = array('posttime' => $record['pubtime'], 'tid' => $record['id']); } ## 设置用戶可兌換積分 if (empty($rankscore) == FALSE) { $message = sprintf(RANKSCORE_ASK, $data['title'], $params['reward']); Techuser_setRankscore($params['uid'], 0 - $rankscore, $message); } } } }
<?php // Copyright 2015 The Haohaoxiuche Team Authors. All right reserved. // Use of this source that is governed by a Apache-style // license that can be found in the LICENSE file. // // 技術版API編號063 匹配正時之獲取車型詳細信息 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } $the_times = CheckTimes(Assign($params['openid']), Assign($params['uid'], 0)); if (empty($the_times) == TRUE) { $condition = array('schema' => 'hh_score', 'fields' => array('chakan'), 'filter' => array('dengji' => "(SELECT grade FROM hh_techuser WHERE id='{$params['uid']}')")); $record = StorageFindOne($condition); if (is_array($record) and empty($record) == FALSE) { $result = array('code' => '103', 'msg' => $record['chakan']); } } else { $record = StorageFindID('car_type_zhengshi', Assign($params['id'], 0)); if (is_array($record) == FALSE or empty($record) == TRUE) { $result['msg'] = '没有新数据,或者出现错误!'; } else { $result = array('code' => '101', 'url' => sprintf(PAGE_ZHENGSHI, $params['uid'], $params['openid']) . $record['id']); } }