示例#1
0
function RefreshMsgByCDZ($uid, $tag, $touid, $debug = FALSE)
{
    $schemas = array('1' => 'hh_techforum', '2' => 'hh_techforum', '3' => 'hh_techqzhi', '4' => 'hh_zhaopin');
    $schema_name = '';
    $fields = array('isnewdz' => 0);
    $filter = array();
    if ($touid) {
        $schema_name = $schemas[$tag] . '_list';
        $pubuser = $tag == 4 ? 'pubuser' : 'pubuser';
        $filter = array($pubuser => $uid);
        if ($tag == '1' or $tag == '2') {
            $filter['type'] = $tag;
        }
    } else {
        $schema_name = $schemas[$tag];
        $subsql = "SELECT tid FROM hh_techuser_dianzan WHERE uid=%s AND tag=%s AND touid=%s";
        $filter = array('id' => array('IN', sprintf($subsql, $uid, $tag, $touid)));
        StorageEdit($schema_name, $fields, $filter);
        $pubuser = $tag == 4 ? 'ofuser' : 'pubuser';
        $filter = array($pubuser => $uid);
        if ($tag == '1' or $tag == '2') {
            $filter['type'] = $tag;
        }
    }
    StorageEdit($schema_name, $fields, $filter, $debug);
}
示例#2
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編號007 申請訪問該問題
//
// @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_WARNING;
} else {
    $fields = array('lockby' => 0, 'locktime' => 'NOW()', 'zhuangtai' => 0);
    $filter = array('id' => Assign($params['qid'], 0), 'lockby' => Assign($params['uid'], 0), 'zhuangtai' => 1);
    $num = StorageEdit('hh_questions', $fields, $filter);
    if (empty($num) == TRUE) {
        $result['msg'] = '放弃失败!';
    } else {
        StorageEdit('hh_questions_list', array('zhuangtai' => 1), array('qid' => Assign($params['qid'], 0)));
        $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS);
    }
}
示例#3
0
        $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);
}
示例#4
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));
}
示例#5
0
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版APP 分享APP頁面
//
// @authors hjboss <*****@*****.**> 2015-01-02#
// @version 1.0.0
// @package hhxc
define('HHXC', TRUE);
require_once 'common.php';
$condition = array('schema' => 'hh_tuijian_code', 'filter' => array('code' => Assign($_REQUEST['needcode']), 'createdat' => date('Y-m-d')));
if (empty($_REQUEST['needcode']) == FALSE) {
    $buffer = StorageFind($condition);
    if (is_array($buffer) and empty($buffer) == FALSE) {
        $fields = array('number' => 'number+1');
        StorageEdit($condition['schema'], $fields, $condition['filter']);
    } else {
        $data = array('code' => Assign($_REQUEST['needcode']), 'createdat' => date('Y-m-d'), 'number' => 1);
        StorageAdd($condition['schema'], $data);
    }
}
?>
<!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" />
<link rel="stylesheet" type="text/css" href="<?php 
echo URL_MOBILE;
示例#6
0
//
// @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['msg'] = '点赞失败!';
    $condition = array('schema' => 'hh_techuser_dianzan', 'filter' => array('uid' => Assign($params['uid'], 0), 'tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'touid' => 0));
    $record = StorageFindOne($condition);
    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']) {
示例#7
0
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號099 汽修人收藏
//
// @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['msg'] = '收藏失败!';
    $condition = array('schema' => 'hh_techuser_shoucang', 'filter' => array('uid' => Assign($params['uid'], 0), 'tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0)));
    $record = StorageFindOne($condition);
    if (is_array($record) and empty($record) == FALSE) {
        $fields = array('type' => Assign($params['type'], 0));
        $num = StorageEdit('hh_techuser_shoucang', $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']));
        $id = StorageAdd('hh_techuser_shoucang', $data);
        if (empty($id) == FALSE) {
            $message = empty($params['type']) ? '取消成功!' : '收藏成功!';
            $result = array('code' => '101', 'msg' => $message);
        }
    }
}
示例#8
0
    $condition = array('schema' => 'hh_identification', 'fields' => '*', 'filter' => array('uid' => Assign($params['uid'], 0)));
    $record = StorageFindOne($condition);
    ## 處理上傳圖片
    $fileids = array();
    $filekeys = array('fileid', 'filerz1', 'filerz2');
    foreach ($filekeys as $number => $key) {
        $tmpname = "{$params['uid']}-{$number}-" . time() . ".png";
        if ($_FILES[$key]['error'] <= 0 and empty($_FILES[$key]['tmp_name']) == FALSE) {
            $savepath = PIC_D_PATH . DIRECTORY_SEPARATOR . $tmpname;
            $fileids[$key] = $tmpname;
            move_uploaded_file($_FILES[$key]['tmp_name'], $savepath);
        }
    }
    if (is_array($record) == FALSE or empty($record) == TRUE) {
        $data = array('uid' => Assign($params['uid'], 0), 'name' => Assign($params['name']), 'identification' => Assign($params['identification']), 'fileid' => Assign($fileids['fileid']), 'filerz1' => Assign($fileids['filerz1']), 'filerz2' => Assign($fileids['filerz2']), 'deviceid' => Assign($params['deviceid']), 'status' => 2);
        $id = StorageAdd('hh_identification', $data);
    } else {
        $data = array('name' => Assign($params['name']), 'identification' => Assign($params['identification']), 'deviceid' => Assign($params['deviceid']));
        if ($fileids['fileid']) {
            $data['fileid'] = $fileids['fileid'];
        }
        if ($fileids['filerz1']) {
            $data['filerz1'] = $fileids['filerz1'];
        }
        if ($fileids['filerz2']) {
            $data['filerz2'] = $fileids['filerz2'];
        }
        $num = StorageEdit('hh_identification', $data, array('uid' => Assign($params['uid'], 0)));
    }
    $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS, 'fields' => $fields);
}
示例#9
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編號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']);
        }
    }
}
示例#10
0
//
// @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_WARNING;
} else {
    $num = 0;
    switch ($params['type']) {
        case '1':
            $fields = array('lockby' => $params['uid'], 'locktime' => 'NOW()', 'zhuangtai' => 1);
            $filter = array('id' => Assign($params['qid'], 0), 'lockby' => 0, 'zhuangtai' => 0);
            $num = StorageEdit('hh_questions', $fields, $filter);
            break;
        case '2':
            $data = array('ofq' => Assign($params['qid'], 0), 'ofuser' => Assign($params['uid'], 0), 'createdat' => 'NOW()');
            $id = StorageAdd('hh_questions_diff', $data);
            if (empty($id) == FALSE) {
                $num = StorageEditByID('hh_questions', array('difficulty' => 'difficulty+1'), $params['qid']);
            }
            break;
    }
    if (empty($num) == FALSE) {
        $result = array('code' => '101', 'msg' => MESSAGE_SUCCESS);
    } else {
        $result['msg'] = '问题已被其他人抢答!';
    }
}