<?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編號075 提交案例評分 // // @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), 'createdat' => 'NOW()', 'ofanli' => Assign($params['cid'], 0), 'score' => Assign($params['score'], 0)); $id = StorageAdd('car_anli_score', $data); if (empty($id) == TRUE) { $result['msg'] = '重复保存!'; } else { $avg = "(SELECT SUM(score)/COUNT(id) FROM car_anli_score WHERE ofanli='%d')"; $fields = array('score_avg' => sprintf($avg, $params['cid'])); StorageEditByID('search_result', $fields, $params['cid']); ## 更新用戶積分 Techuser_setScore(Assign($params['uid'], 0), 5); $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS); } }
<?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編號016 技師用戶登陸請求 ##已取消 新接口064 // // @authors hjboss <*****@*****.**> 2015-12-17# // @version 1.0.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'] = '用户不存在!'; } 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' => Assign($params[KEY_PHONE]), 'data' => array()); $result['data'][] = array('uid' => $record['id'], 'openid' => $record['loginid'], 'image' => $record['headerimg'], 'nick' => $record['nick'], 'grade' => $record['grade'], 'score' => $record['score'], 'city' => $record['city'], 'cars' => $record['cars'], 'job' => $record['job'], 'level' => $record['level'], 'experience' => $record['experience']); Techuser_setScore($record['id'], 1); } }
$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編號015 發送用戶註冊請求 ##已取消 新接口096 // // @authors hjboss <*****@*****.**> 2015-12-17# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } $data = array('username' => Assign($params['phone']), 'password' => Assign($params['pwd']), 'createdat' => 'NOW()', 'deviceid' => Assign($params['deviceid']), 'username_d' => Assign($params[KEY_PHONE])); $id = StorageAdd('hh_techuser', $data); if (empty($id) == TRUE) { $result['msg'] = '电话号码已注册!'; } else { $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS); $num = StorageEditByID('hh_techuser', array('withcode' => WithCode($username, $id)), $id); if (empty($num) == TRUE) { StorageEditByID('hh_techuser', array('withcode' => WithCode($username, $id, 9999999)), $id); } Techuser_setScore($id, 7); }
<?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編號022 查現象之獲取故障點列表 ##已取消 新接口054 // // @authors hjboss <*****@*****.**> 2015-12-17# // @version 1.0.0 // @package hhxc if (!defined('HHXC')) { die('Permission denied'); } ## 構建查詢故障點SQL $condition_sub = array('schema' => 'car_symptom_fault', 'fields' => array('offault'), 'filter' => array('ofsymptom' => Assign($params['pheid'], 0))); $condition = array('schema' => 'car_fault', 'fields' => array('id'), 'filter' => array('type' => array('NEQ', 7), 'id' => array('IN', SQLSub($condition_sub))), 'others' => 'LIMIT 20'); $recordset = StorageFind($condition); if (is_array($recordset) == FALSE or empty($recordset) == TRUE) { $result['msg'] = MESSAGE_EMPTY; } else { $result = array('code' => '101', 'data' => array()); foreach ($recordset as $index => $row) { $result['data'][] = $row['id']; } if (CheckOpenID($params['openid'], $params['uid']) == TRUE) { Techuser_setScore($params['uid'], 2); } }
} $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; ## 清除積分限制 ## 清除積分限制 case '4': $fields = array(); for ($index = 1; $index <= 13; $index++) { $fields["s{$index}_day"] = 0; $fields["s{$index}_sum"] = 0; } StorageEditByID('hh_techuser', $fields, $params['uid']); }
<?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編號094 分享成功 // // @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 { $ret = Techuser_setScore(Assign($params['uid'], 0), 6); $result = array('code' => '101', 'msg' => $ret); }