$params['message'] = SMS_ACTION_BANDINGS . $chars; break; case '2': $condition = array('schema' => 'hh_techuser', 'filter' => array('username_d' => Assign($params['phone']))); if (empty($params['phoneaes']) == FALSE) { $condition['filter']['username'] = Assign($params['phoneaes']); } $record = StorageFindOne($condition); if (is_array($record) == FALSE or empty($record) == TRUE) { $result['msg'] = '该号码不存在!'; die(JsonEncode($result)); } $params['message'] = SMS_ACTION_PASSWORD . $chars; break; } ## 發送短信 if (SMS($params['phone'], $params['message']) == FALSE) { $result['msg'] = '发送失败!'; die(JsonEncode($result)); } $result = array('code' => '101', 'data' => $chars); ## 統計短信發送 $condition = array('schema' => 'hh_sms_log', 'filter' => array('createdat' => date('Y-m-d'))); $record = StorageFindOne($condition); if (is_array($record) and empty($record) == FALSE) { $fields = array("status{$params['opt']}" => "status{$params['opt']}+1"); StorageEdit('hh_sms_log', $fields, $condition['filter']); } else { $data = array("status{$params['opt']}" => 1, 'createdat' => date('Y-m-d')); StorageAdd('hh_sms_log', $data); }
function CheckTimes($openid, $uid) { $condition = array('schema' => 'hh_techuser', 'fields' => array('times_cx'), 'filter' => array('loginid' => $openid, 'id' => $uid)); $record = StorageFindOne($condition); if (is_array($record) and empty($record) == FALSE) { return $record['times_cx']; } return FALSE; }
} ## 構建點贊人信息 $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; if (StorageCount('hh_techuser_dianzan', $filter_host_count)) { $buffer_host['mypraise'] = '1'; } $filter_host_total = array('tid' => $buffer_host['tid'], 'tag' => $tag, 'type' => 1, 'touid' => $index); $buffer_host['praises'] = StorageCount('hh_techuser_dianzan', $filter_host_total); ## 獲取帖子圖片
$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)); } }
<?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編號071 獲取用戶數據 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } $rankings = array('10', '100', '1k', '5k', '1w', '2w', '3w', '4w', '5w', '6w', '10w'); if (CheckOpenID($params['openid'], $params['uid']) == FALSE) { $result['msg'] = MESSAGE_WARNING; } else { $record = StorageFindID('hh_techuser', Assign($params['cuid'], 0)); if (is_array($record) == FALSE or empty($record) == TRUE) { $result['msg'] = MESSAGE_EMPTY; } else { $result = array('code' => '101', 'data' => array()); $h_grade = $record['grade'] > 50 ? 'V' . ($record['grade'] - 50) : 'L' . $record['grade']; ## 獲取經驗名稱 $condition_main = array('schema' => array('hh_rank'), 'fields' => array('*', '(SELECT score FROM hh_rank WHERE id=t0.id+1) AS h_score'), 'filter' => array('dengji' => $record['rankname'])); $h_rankname = StorageFindOne($condition_main); $result['data'][] = array('image' => $record['headerimg'], 'nick' => $record['nick'], 'grade' => $h_grade, 'city' => $record['city'], 'cars' => $record['cars'], 'job' => $record['job'], 'level' => $record['level'], 'experience' => $record['experience'], 'official' => Assign($record['type'], 0), 'identified' => Assign($record['identified'], 0), 'rank' => Assign($record['rank'], 0), 'rankname' => Assign($h_rankname['title']), 'rankvalue' => Assign($h_rankname['h_score']), 'ranking' => $rankings[count($rankings) - 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編號076 總數量條數 // // @authors hjboss <*****@*****.**> 2015-12-18# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } $condition = array('schema' => 'hh_dbver', 'fields' => array('ver'), 'filter' => array('vername' => 'datatotal')); $count = StorageCount($condition['schema'], $condition['filter']); if (empty($count) == TRUE) { $result['msg'] = MESSAGE_EMPTY; } else { $result = array('code' => '101', 'totalnumber' => 0); $record = StorageFindOne($condition); if (is_array($record) and empty($record) == FALSE) { $condition_sub = array('schema' => 'hh_datatotal', 'fields' => array('(symptomp+anli+fault+faultcode+timing+(SELECT COUNT(*) FROM hh_techuser)) AS h_ct'), 'others' => 'ORDER BY id DESC'); $buf = StorageFindOne($condition_sub); if (is_array($buf) and empty($buf) == FALSE) { $result['totalnumber'] = $buf['h_ct']; } } }
$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. // // 技術版APP 案例分析詳細頁面 // // @authors hjboss <*****@*****.**> 2016-01-02# // @version 1.0.0 // @package hhxc define('HHXC', TRUE); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'common.php'; $condition = array('schema' => 'search_result', 'fields' => array('*', '(SELECT maintext FROM search_result_maintext WHERE resultid=search_result.id) AS maintext', '(SELECT title FROM search_object WHERE id=search_result.ofurl) AS h_fromurl'), 'filter' => array('id' => $_GET['resultid'])); $anli = StorageFindOne($condition); $anli['maintext'] = trim($anli['maintext'], '<BRbr />'); $anli['maintext'] = str_replace('<BR><BR>', '</p><p>', $anli['maintext']); $anli['maintext'] = str_replace('<br><br>', '</p><p>', $anli['maintext']); $url_download = 'http://www.haohaoxiuche.com/download/hhxcjsb.apk'; if ($_REQUEST['t'] != 1) { $url_download = 'https://appsto.re/hk/pzy-9.i'; } header('Content-Type: text/html;charset=utf-8'); ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <title>好好修车-免费修车老师,私人汽车医生!</title> <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css" />
<?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'; $condition = array('schema' => 'hh_techuser_cxsym', 'fields' => array('*', '(select title from car_symptom where id=ofsymptom) as pheno', '(select title from car_fault where id=offault) as h_title', '(select baike from car_parts where id=(select ofpart from car_fault where id=hh_techuser_cxsym.offault)) as h_baike', '(select title from car_parts where id=(select ofpart from car_fault where id=hh_techuser_cxsym.offault))'), 'filter' => array('id' => $_REQUEST['id'])); $cxsym = StorageFindOne($condition); $title = $cxsym['h_title']; $content = $cxsym['h_baike']; include_once 'share_common.php';