Exemplo n.º 1
0
 public function getPostData()
 {
     $postObj = simplexml_load_string($GLOBALS["HTTP_RAW_POST_DATA"], 'SimpleXMLElement', LIBXML_NOCDATA);
     $post_data['FromUserName'] = str_inmysql($postObj->FromUserName);
     $post_data['ToUserName'] = str_inmysql($postObj->ToUserName);
     $post_data['FromMsgType'] = str_inmysql($postObj->MsgType);
     $post_data['Keyword'] = trim(str_inmysql($postObj->Content, '1'));
     $post_data['CreateTime'] = str_inmysql($postObj->CreateTime);
     $post_data['Location_X'] = str_inmysql($postObj->Location_X);
     $post_data['Location_Y'] = str_inmysql($postObj->Location_Y);
     $post_data['Label'] = str_inmysql($postObj->Label);
     $post_data['Event'] = str_inmysql($postObj->Event);
     $post_data['EventKey'] = str_inmysql($postObj->EventKey);
     $post_data['PicUrl'] = str_inmysql($postObj->PicUrl);
     $post_data['Recognition'] = str_inmysql($postObj->Recognition);
     if ($post_data['Event'] == 'CLICK') {
         $post_data['Keyword'] = str_inmysql($post_data['EventKey']);
     }
     //服务号用户自动上传地理位置的处理
     if (strtolower($postObj->Event) == 'location') {
         $memberLocationModel = new Model_Subtable('member_location');
         $memberLocationRow = $memberLocationModel->where("fromuser='******'")->dataRow();
         if ($memberLocationRow) {
             $locationArr['info'][id] = $memberLocationRow['id'];
         }
         $locationArr['info'][fromuser] = $postObj->FromUserName;
         $locationArr['info'][latitude] = $postObj->Latitude;
         $locationArr['info'][longitude] = $postObj->Longitude;
         $locationArr['info'][precision] = $postObj->Precision;
         $locationArr['info'][addtime] = $postObj->CreateTime;
         $memberLocationModel->add($locationArr);
     }
     return $post_data;
 }
Exemplo n.º 2
0
 public function getText()
 {
     $infocommonModel = new Model_InfoCommon();
     $filter['where'] = " id='{$this->info_id}' and customer_id='{$this->customer_id}' and state='1' ";
     $sql = $infocommonModel->select($filter, 'info_intro');
     $inforesult = $infocommonModel->fetchRow($sql);
     $sql = "update info_common set push_num=push_num+1 where id='{$this->info_id}' and customer_id='{$this->customer_id}' limit 1";
     $infocommonModel->query($sql);
     $data['msgtype'] = 'text';
     if ($this->info_id == 183) {
         //记得打开公众号接受消息
         $userModel = new Model_Subtable('sub_user');
         $scoreModel = new Model_SubScore('sub_score');
         $qdScore = $scoreModel->qd();
         $uRow = $userModel->where("fromuser='******'")->dataRow();
         $time = time();
         $startTime = strtotime(date('Y-m-d', $time) . ' 00:00:00');
         //今天0点的时间戳
         if ($uRow['qd_time'] > $startTime) {
             $data['content'] = '已签到';
         } else {
             if ($uRow) {
                 //签到获取积分
                 $data1['info'][id] = $uRow['id'];
                 $data1['info'][score] = $qdScore + $uRow['score'];
                 $data1['info'][score_all] = $qdScore + $uRow['score_all'];
                 $data1['info'][qd_time] = $time;
                 $userModel->add($data1);
                 $data['content'] = '签到成功';
             } else {
                 $data['content'] = '您还未注册';
             }
         }
     } else {
         $data['content'] = $inforesult['info_intro'];
     }
     //file_put_contents('a.txt',$data['content']);
     return $data;
 }
Exemplo n.º 3
0
    $replyModel = new Model_Subtable('sub_reply');
    $replyList = $replyModel->order('id desc')->limit('5')->dataArr();
    $smarty->assign('replyList', $replyList);
    $smarty->setLayout('')->setTpl('mobile/templates/task_detail.html')->display();
    die;
}
//申请职位
if ($_REQUEST['a'] == 'sign') {
    $signModel = new Model_Subtable('sub_sign');
    $data['num']['tid'] = $_GET['tid'];
    $data['num']['uid'] = $userRow['id'];
    $s = $signModel->where("tid=" . $data['num']['tid'] . " and uid=" . $data['num']['uid'])->dataRow();
    if ($s) {
        die('ybm');
    } else {
        $res = $signModel->add($data);
        $res ? die('suc') : die('err');
    }
}
//评论
if ($_REQUEST['a'] == 'reply') {
    $replyModel = new Model_Subtable('sub_reply');
    if ($_GET['tid'] && $_GET['content']) {
        $memberModel = new Model_Member();
        $data['num']['tid'] = $_GET['tid'];
        $data['num']['uid'] = $userRow['id'];
        $data['info']['name'] = $userRow['nicheng'];
        $data['info']['head_pic'] = $memberModel->getPic($userRow['fromuser']);
        $data['str']['content'] = $_GET['content'];
        $res = $replyModel->add($data);
        $res ? die('suc') : die('err');
Exemplo n.º 4
0
check_login();
//验证是否登录
$model = new Model_Subtable('sub_shop_goods');
$cateModel = new Model_Subtable('sub_shop_cate');
//数据保存
if ($_REQUEST['a'] == 'add') {
    if (method_is('post')) {
        $data = $_POST;
        //删除原图
        if ($data['num'][id]) {
            $vo = $model->find($data['num'][id]);
            if ($vo['pic'] != $data['info'][pic]) {
                @unlink("../../data/image_c/" . $vo['pic']);
            }
        }
        $res = $model->add($data);
        echo json_encode($res);
        die;
    } else {
        $id = (int) $_GET['id'];
        if ($id) {
            $smarty->assign('vo', $model->find($id));
        }
        //获取商品类别
        $smarty->assign('cateList', $cateModel->dataArr());
        $smarty->setTpl('shop/templates/goods_add.html')->display();
        die;
    }
}
//数据删除
if ($_REQUEST['a'] == 'del') {
Exemplo n.º 5
0
<?php

include_once "../../includes/config.inc.php";
check_login();
//验证是否登录
$postTable = new Model_Subtable('sub_task');
$replyTable = new Model_Subtable('sub_reply');
//回复数据的添加
if ($_POST['action'] == 'add') {
    //管理员头像
    $uRow = D('sub_user')->find(1);
    $data['info']['head_pic'] = '/data/image_c/' . $uRow['head_pic'];
    $data['info']['tid'] = (int) $_POST['tid'];
    $data['info']['content'] = str_inmysql($_POST['content']);
    $data['info']['name'] = '云姐';
    $res = $replyTable->add($data);
    if ($res) {
        echo json_encode($res);
    }
    exit;
}
//数据删除
if ($_GET['action'] == 'del') {
    $id = (int) $_GET['id'];
    $res = $replyTable->del($id);
    echo json_encode($res);
    exit;
}
//根据ID查询帖子信息
$id = (int) $_GET['id'];
$vo = $postTable->find($_GET['id']);
Exemplo n.º 6
0
<?php

$model = new Model_Subtable('sub_task');
$userModel = D('sub_user');
if ($_REQUEST['a'] == 'add') {
    if (method_is('post')) {
        $data = $_POST;
        $data['info']['uid'] = $userRow['id'];
        $data['info']['work_time'] = $data['work_date'] . ' ' . $data['work_hour'] . '-' . $data['work_hour_end'];
        $data['info']['jihe_time'] = $data['jihe_date'] . ' ' . $data['jihe_hour'];
        //获取该任务发布时的经纬度(手机端)
        $locationModel = new Model_Subtable('member_location');
        $locationRow = $locationModel->where("fromuser='******'fromuser'] . "'")->dataRow();
        $data['info'][latitude] = $locationRow['latitude'];
        $data['info'][longitude] = $locationRow['longitude'];
        $res = $model->add($data);
        $res ? die('suc') : die('err');
    } else {
        //苏州市下的区
        $dmodel = new Model_Subtable('s_district');
        $smarty->assign('darr', $dmodel->where("CityID=78")->order("DistrictId asc")->dataArr());
        //一天24小时的数组
        for ($i = 0; $i < 25; $i++) {
            $i < 10 ? $hourArr[] = '0' . $i . ':00' : ($hourArr[] = $i . ':00');
        }
        $smarty->assign('hourArr', $hourArr);
        if ($_GET['id']) {
            $smarty->assign('vo', $model->find($_GET['id']));
        }
        $smarty->setLayout('')->setTpl('mobile/templates/task_add.html')->display();
        die;
Exemplo n.º 7
0
<?php

include_once "../includes/config.inc.php";
if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) {
    die("请在微信浏览器中打开");
}
//判断是否微信打开
//微信用户标识
include_once "get_openid.php";
$model = new Model_Subtable('sub_user');
$scoreModel = new Model_SubScore('sub_score');
$qdScore = $scoreModel->qd();
$uRow = $model->where("fromuser='******'")->dataRow();
$time = time();
$startTime = strtotime(date('Y-m-d', $time) . ' 00:00:00');
//今天0点的时间戳
if ($uRow['qd_time'] > $startTime) {
    die('<script type="text/javascript">alert("请勿重复签到,请关闭网页")</script>');
} else {
    if ($uRow) {
        //签到获取积分
        $data1['info'][id] = $uRow['id'];
        $data1['info'][score] = $qdScore + $uRow['score'];
        $data1['info'][score_all] = $qdScore + $uRow['score_all'];
        $data1['info'][qd_time] = time();
        $model->add($data1);
        die('<script type="text/javascript">alert("签到成功,请关闭网页")</script>');
    } else {
        die('<script type="text/javascript">alert("您还未注册,请关闭网页")</script>');
    }
}
Exemplo n.º 8
0
         } else {
             $js1IdRow[] = $temp_arr[1];
         }
     }
     if ($js2IdRow) {
         $model->query('update sub_sign set is_js=2 where id in (' . implode(',', $js2IdRow) . ')');
     }
     if ($js1IdRow) {
         $model->query('update sub_sign set is_js=1 where id in (' . implode(',', $js1IdRow) . ')');
     }
     //更改职位经理确认状态
     $taskData = array();
     $taskData['num']['id'] = $data['tid'];
     $taskData['num']['jingli_queren'] = 1;
     $taskData['num']['is_shut'] = 1;
     $model->add($taskData);
     die('suc');
 } else {
     $listArr = $signModel->where("is_js=1 and tid=" . $_GET['tid'])->order('distance asc')->limit('30')->dataArr();
     //应结算人数
     $listRow = $signModel->field("count(*) as countnum")->where("is_js=1 and tid=" . $_GET['tid'])->dataRow();
     $smarty->assign('countnum', $listRow['countnum']);
     if ($listArr) {
         foreach ($listArr as $key => $value) {
             //从快照中获取用户信息
             $value['user_json'] ? $uRow = unserialize($value['user_json']) : ($uRow = $userModel->find($value['uid']));
             $listArr[$key]['username'] = $uRow['username'];
             $listArr[$key]['nickname'] = $uRow['nickname'];
             $uRow['sex'] == 1 ? $listArr[$key]['sex'] = '男' : ($listArr[$key]['sex'] = '女');
             //是否可看手机号
             if ($userRow['is_see'] == 0) {
Exemplo n.º 9
0
<?php

$model = new Model_Subtable('sub_money_log');
//充值
if ($_REQUEST['a'] == 'cz') {
    $czModel = new Model_Subtable('sub_cz');
    $data = array();
    $data['info']['uid'] = $userRow['id'];
    $data['info']['money'] = (int) $_POST['money'];
    if ($data['info']['uid'] < 1 || $data['info']['money'] < 1) {
        die('err');
    }
    $res = $czModel->add($data);
    if ($res) {
        echo 'cz_' . $res;
        //充值订单号
        die;
    } else {
        die('err');
    }
}
Exemplo n.º 10
0
    die;
}
//取消任务
if ($_REQUEST['a'] == 'cancel_sign') {
    $jobsignModel = new Model_Subtable('sub_jobsign');
    $submitModel = new Model_Subtable('sub_job_submit');
    $jid = (int) $_GET['jid'];
    $jobsignModel->query("delete from sub_jobsign where jid='{$jid}' and uid='" . $_SESSION['tyuser']['id'] . "'");
    //写取消日志
    $signcancelModel = new Model_Subtable('sub_jobsign_cancel');
    $data = array();
    $data['info']['jid'] = $jid;
    $data['info']['uid'] = $_SESSION['tyuser']['id'];
    $signcancelModel->add($data);
    //领取数-1
    $jobsignModel->query("update sub_job set num=num-1 where id='" . $jid . "'");
    die('suc');
}
//任务提报
if ($_REQUEST['a'] == 'signadd') {
    $submitModel = new Model_Subtable('sub_job_submit');
    $data = $_POST;
    //查重
    $phoneRow = $submitModel->where("phone='" . $data['str']['phone'] . "'")->dataRow();
    if ($phoneRow) {
        die('cf');
    }
    $data['info']['uid'] = $_SESSION['tyuser']['id'];
    $res = $submitModel->add($data);
    $res ? die('suc') : die('err');
}
Exemplo n.º 11
0
        $userRow = $userModel->find($id);
        $configModel = new Model_CustomerConfig();
        $configModel->sendCustomerMsg($_POST['content'], $userRow['fromuser']);
    }
    die;
}
//生成大礼包优惠码
if ($_REQUEST['a'] == 'produce_code') {
    if (method_is('post')) {
        $data = array();
        $id = $_POST['id'];
        $userModel = new Model_Subtable('sub_user');
        $userRow = $userModel->find($id);
        $data['info']['id'] = $id;
        $data['info']['code'] = substr(md5($userRow['username']), -6);
        $userModel->add($data);
    }
    die;
}
//生成代理商编号
if ($_REQUEST['a'] == 'num_change') {
    if (method_is('post')) {
        if ($_POST['num'] != '') {
            $r = $model->where("agent_num='" . $_POST['num'] . "'")->dataRow();
            if ($r) {
                die('cf');
            }
        }
        $data = array();
        $data['info']['id'] = $_POST['id'];
        $data['info']['agent_num'] = $_POST['num'];
Exemplo n.º 12
0
include_once "../includes/config.inc.php";
//if(!strpos($_SERVER['HTTP_USER_AGENT'],'MicroMessenger')) die("请在微信浏览器中打开");//判断是否微信打开
$model = new Model_Subtable('sub_user');
//注册
if ($_REQUEST['a'] == 'do') {
    $data = $_POST;
    //手机验证码核对
    if ($data['code'] != $_SESSION['mobile_code'] or empty($data['code'])) {
        echo 'codeerr';
        die;
    }
    $row = $model->where("username='******'username'] . "'")->dataRow();
    //数据修改
    $info['num']['id'] = $row['id'];
    $info['info']['pass'] = md5($data['pass']);
    if ($info['num']['id'] && $info['info']['pass']) {
        $res = $model->add($info);
    } else {
        $res = 0;
    }
    if ($res) {
        $_SESSION['mobile'] = '';
        $_SESSION['mobile_code'] = '';
    }
    echo $res;
    die;
}
//防止恶意请求的随机码
$_SESSION['send_code'] = code_random(6, 1);
$smarty->assign('send_code', $_SESSION['send_code']);
$smarty->setLayout('')->setTpl('mobile/templates/editp.html')->display();
Exemplo n.º 13
0
<?php

$model = new Model_Subtable('sub_user');
//添加银行卡号
if ($_REQUEST['a'] == 'add_bank') {
    $data = $_POST;
    $data['info']['id'] = $userRow['id'];
    $res = $model->add($data);
    $res ? die('suc') : die('err');
}
//个人信息完善
if ($_REQUEST['a'] == 'user_add_personal') {
    if (method_is('post')) {
        $data = $_POST;
        //推荐人返利
        if ($data['recommend_phone'] && $data['recommend_phone'] != $userRow['username']) {
            $uRow = $model->where("username='******'recommend_phone'] . "'")->dataRow();
            if ($uRow) {
                $data['info'][recommend_phone] = $data['recommend_phone'];
                //修改推荐人积分
                $tjrScore = (int) getTjrScore();
                $data1['info'][id] = $uRow['id'];
                $data1['info'][score] = $tjrScore + $uRow['score'];
                $data1['info'][score_all] = $tjrScore + $uRow['score_all'];
                $model->add($data1);
            }
        }
        $res = $model->add($data);
        echo $res;
        die;
    } else {
Exemplo n.º 14
0
        $model->query("update sub_pic set `fnum`=`fnum`+1 where id={$pid}");
        die('suc');
    }
}
//鸡蛋
if ($_REQUEST['a'] == 'egg') {
    $feModel = new Model_Subtable('sub_pic_fe');
    $pid = (int) $_GET['pid'];
    $feRow = $feModel->where("type=2 and pid={$pid} and fromuser='******'picuser']['fromuser'] . "'")->dataRow();
    if ($feRow) {
        die('err');
    } else {
        $data['info'][type] = 2;
        $data['info'][pid] = $pid;
        $data['info'][fromuser] = $_SESSION['picuser']['fromuser'];
        $feModel->add($data);
        //鸡蛋数+1
        $model->query("update sub_pic set `enum`=`enum`+1 where id={$pid}");
        die('suc');
    }
}
if ($_REQUEST['a'] == 'index') {
    $list = $model->order('is_up desc,up_time desc,id desc')->limit('20')->dataArr();
    foreach ($list as $key => $value) {
        $list[$key]['introduce'] = cut_str(deletehtml($value['introduce']), 15);
        //评论数
        $replyModel = new Model_Subtable('sub_pic_reply');
        $replyRow = $replyModel->field("count(id) as countnum")->where("pid='{$value['id']}'")->dataRow();
        $list[$key]['countnum'] = $replyRow['countnum'];
    }
    $smarty->assign('list', $list);