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; }
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; }
<?php include_once "../../includes/config.inc.php"; check_login(); //验证是否登录 $postTable = new Model_Subtable('sub_pic'); $replyTable = new Model_Subtable('sub_pic_reply'); //回复数据的添加 if ($_POST['action'] == 'add') { //管理员头像 $uRow = D('sub_user')->find(1); $data['info']['head_pic'] = '/data/image_c/' . $uRow['head_pic']; $data['info']['pid'] = (int) $_POST['pid']; $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); /* if($res){ //修改帖子回复数 $pid=$_GET['pid']; $replynum=$replyTable->count(array('where'=>" pid=$pid ")); $postTable->upsert(array('list_id'=>$pid,'list_reply_num'=>$replynum)); } */
<?php include_once "../includes/config.inc.php"; include_once "../includes/class-upload.php"; $customer_id = $_WGT['m_customer_id']; if (method_is('post')) { $upload = new class_upload(); $upload->upload_form_field = 'imgfile'; $upload->out_file_dir = '../data/image_c/' . $customer_id . '/' . date("Ymd"); $upload->max_file_size = 1024 * 1024 * 6; //6M $upload->make_script_safe = 1; $upload->allowed_file_ext = array('gif', 'jpg', 'jpeg', 'png'); $upload->upload_process(); if ($upload->error_no) { ajax_feedback(0, $upload->error_no); } $save_path = str_replace('../data/image_c/', '', $upload->saved_upload_name); makethumb($upload->saved_upload_name, $upload->saved_upload_name, 200, 200); //更新到数据库 $model = new Model_Subtable('sub_user'); $model->query("update sub_user set head_pic='{$save_path}' where id=" . $_POST['id']); ajax_feedback(1, array('path' => $save_path)); }
<?php include_once "../../includes/config.inc.php"; $model = new Model_Subtable('sub_task'); $userModel = new Model_Subtable('sub_user'); if ($_REQUEST['a'] == 'send') { if (!$_GET['tid'] || !$_GET['fromuser']) { die; } $tid = $_GET['tid']; $taskRow = $model->find($tid); //发布方公司名 if ($taskRow['company_name']) { $cname = $taskRow['company_name']; } else { if ($taskRow['uid'] == 1) { $cname = '云客驿站'; } else { $userRow = $userModel->find($taskRow['uid']); $cname = $userRow['nickname']; } } $configModel = new Model_CustomerConfig(); $configModel->sendCustomerMsg($cname . '发布了一个新职位:' . $taskRow['title'] . ",<a href='http://www.yunfanke.com/mobile/index.php?m=task&a=detail&id=" . $tid . "'>点击查看</a>", $_GET['fromuser']); die; } if ($_REQUEST['a'] == 'send_msg_confirm') { set_time_limit(0); $configModel = new Model_CustomerConfig(); $tid = $_GET['tid']; //职位信息
if ($_GET['p']) { if ($listArr) { echo json_encode($listArr); die; } else { echo json_encode('err'); die; } } else { $smarty->assign('list', $listArr); $smarty->setLayout('')->setTpl('mobile/templates/task_index.html')->display(); die; } } if ($_REQUEST['a'] == 'ajax_reply') { $replyModel = new Model_Subtable('sub_reply'); $pageSize = 5; //页大小 $p = (int) $_GET['p'] < 1 ? 1 : (int) $_GET['p']; //当前页数 $limitStr = ($p - 1) * $pageSize . ',' . $pageSize; $listArr = $replyModel->where("tid=" . (int) $_GET['tid'])->order('id desc')->limit($limitStr)->dataArr(); /* foreach($listArr as $key=>$value){ //$listArr[$key]['title']=cut_str(deletehtml($value['title']),5); $listArr[$key]['addtime']=substr($value['addtime'],0,16); } */ if ($listArr) { echo json_encode($listArr); die; } else { echo json_encode('err');
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('D2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('E2')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('F2')->getFont()->setBold(true); //数据库操作 include_once "../../includes/config.inc.php"; $submitModel = new Model_Subtable('sub_job_submit'); $id = (int) $_GET['id']; $listArr = $submitModel->where(" jid='{$id}' ")->order('id desc')->dataArr(); if (!$listArr) { die('无数据'); } $userModel = new Model_Subtable('sub_user'); foreach ($listArr as $key => $value) { $userRow = $userModel->find($value['uid']); $listArr[$key]['uname'] = $userRow['nickname']; $listArr[$key]['uphone'] = $userRow['username']; $userRow['sex'] == 1 ? $listArr[$key]['usex'] = '男' : ($listArr[$key]['usex'] = '女'); } $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '提报列表' . date('Y-m-d H:i:s')); foreach ($listArr as $lk => $lv) { $lj = $lk + 3; $objPHPExcel->getActiveSheet()->setCellValue('A' . $lj, $lv['uname'] . '/' . $lv['usex'] . '/' . $lv['uphone'])->setCellValue('B' . $lj, $lv['name'])->setCellValue('C' . $lj, $lv['carnum'] . ' ')->setCellValue('D' . $lj, $lv['phone'])->setCellValue('E' . $lj, $lv['license'])->setCellValue('F' . $lj, substr($lv['addtime'], 0, 10)); } // Rename worksheet $objPHPExcel->getActiveSheet()->setTitle('提报列表'); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(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']);
//数据删除 if ($_REQUEST['a'] == 'del') { $vo = $model->find($_POST['id']); $res = $model->del($_POST['id']); //删除原图 if ($res) { @unlink("../../data/image_c/" . $vo['pic']); } echo json_encode($res); die; } //评论列表 if ($_REQUEST['a'] == 'detail') { $vo = $model->find($_GET['id']); $smarty->assign('vo', $vo); $replyModel = new Model_Subtable('sub_pic_reply'); $replyList = $replyModel->order('id desc')->limit('10')->dataArr(); $smarty->assign('replyList', $replyList); $smarty->setLayout('')->setTpl('mobile/templates/pic_detail.html')->display(); die; } //数据列表 $filter['order'] = " is_up desc,up_time desc,id desc "; $data = $model->paginate($filter, '*', common_pg('p'), 10); $listArr = $data['data']; $userModel = D('sub_user'); foreach ($listArr as $key => $value) { $listArr[$key]['introduce'] = cut_str(deletehtml($value['introduce']), 20); //发布人 $userRow = $userModel->where("fromuser='******'fromuser'] . "'")->dataRow(); $listArr[$key]['faburen'] = $userRow['nickname'] . '-' . $userRow['nicheng'] . '-' . $userRow['username'];
<?php $model = new Model_Subtable('sub_agent'); if ($_REQUEST['a'] == 'add') { if (method_is('post')) { $data = $_POST; $res = $model->add($data); $res ? die('suc') : die('err'); } else { $smarty->setLayout('')->setTpl('mobile/templates/agent_add.html')->display(); die; } } if ($_REQUEST['a'] == 'mid') { $smarty->setLayout('')->setTpl('mobile/templates/agent_mid.html')->display(); die; } //信息设置 if ($_REQUEST['a'] == 'info') { if (method_is('post')) { $data = $_POST; if ($data['num']['id'] && $data['str']['code']) { $res = D('sub_user')->add($data); } die('suc'); } else { $kvRow = D('sub_kv')->where("k='discount'")->dataRow(); $smarty->assign('discount', $kvRow['v'] * 10); $smarty->setLayout('')->setTpl('mobile/templates/agent_info.html')->display(); die; }
<?php include_once "../../includes/config.inc.php"; $configModel = new Model_CustomerConfig(); $userModel = new Model_Subtable('sub_user'); //微信通道 if (method_is('post')) { $content = "亲~,你已成功注册云客驿站平台,但个人资料至今还未完善哦,请尽快完善。为了能及时参加兼职工作,请至“个人中心”-“我的金库”绑定中国银行卡,(除本地中国银行卡外,其他银行会产生2.5元手续费;异地银行卡产生5.5元手续费哦),如有疑问,请在左下方客服窗口咨询云姐哦~"; $configModel->sendCustomerMsg($content, $_POST['fromuser']); } else { $listArr = $userModel->field('fromuser')->where("is_see=0 and fromuser!='' group by fromuser")->dataArr(); $smarty->assign('list', $listArr); $smarty->assign('listcount', count($listArr)); $smarty->setTpl('msg/templates/send_wanshan.html')->display(); die; }
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'); }
$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'] = '女'); //序号处理 $listArr[$key]['xuhao'] = $key + 1; } } else { $smarty->setLayout('')->setTpl('mobile/templates/no_data.html')->display(); die; } $smarty->assign('list', $listArr); $smarty->setLayout('')->setTpl('mobile/templates/caiwu_sign_js.html')->display(); die; } } //改变金额 if ($_REQUEST['a'] == 'change_money') { $signModel = new Model_Subtable('sub_sign'); $data = array(); $data['info']['id'] = (int) $_POST['id']; $data['info']['fact_money'] = (int) $_POST['fact_money']; $signModel->add($data); } //驳回处理 if ($_REQUEST['a'] == 'back_act') { $data = array(); $data['info']['id'] = (int) $_POST['tid']; $data['info']['jingli_queren'] = 0; $model->add($data); }
<?php include_once "../includes/config.inc.php"; //if(!strpos($_SERVER['HTTP_USER_AGENT'],'MicroMessenger')) die("请在微信浏览器中打开");//判断是否微信打开 $model = new Model_Subtable('sub_user'); //登录 if ($_REQUEST['a'] == 'dologin') { $data = $_POST; $userRow = $model->field('id,username,pass,fromuser')->where("username='******'username'] . "'")->dataRow(); if (!$userRow) { echo 'usernameerr'; die; } else { if ($userRow['pass'] != md5($data['pass'])) { echo 'passerr'; die; } else { //写cookie setCookie('tyuid', $userRow['id'], time() + 3600 * 24); //只写一天的cookie $_SESSION['tyuser'] = $userRow; echo 'success'; die; } } } $smarty->setLayout('')->setTpl('mobile/templates/login.html')->display();
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']; $model->add($data); die('suc'); } die; } //数据列表 $dmodel = new Model_Subtable('s_district'); $condition = array(); $condition[] = " id!=1 "; if ($_GET['did']) { $condition[] = " did='" . $_GET['did'] . "' "; $count_district_str = " and did='" . $_GET['did'] . "' "; } if ($_GET['type'] == 1) { $condition[] = " type in (1,3)"; //个人用户或客服 } else { $condition[] = " type=2"; } //信息完善 if ($_GET['wanshan'] == 1) { $condition[] = " pic!='' ";
<?php 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);
} //推荐人返利积分 function getTjrScore() { $scoreModel = new Model_SubScore('sub_score'); return $scoreModel->tjr(); } //城市级联 if ($_REQUEST['a'] == 'get_citys') { $cmodel = new Model_Subtable('s_city'); $carr = $cmodel->where("ProvinceID=" . $_GET['pid'])->dataArr(); echo json_encode($carr); die; } if ($_REQUEST['a'] == 'get_districts') { $dmodel = new Model_Subtable('s_district'); $darr = $dmodel->where("CityID=" . $_GET['cid'])->order('DistrictId asc')->dataArr(); echo json_encode($darr); die; } //提现 if ($_REQUEST['a'] == 'tx') { if ($userRow['money'] > 0) { //提现表添加数据 $outData['info']['uid'] = $userRow['id']; $outData['info']['money'] = $userRow['money']; D('sub_out')->add($outData); //用户金额清零 $data['info']['id'] = $userRow['id']; $data['info']['money'] = 0; $userModel->add($data);
<?php include_once "../../includes/config.inc.php"; check_login(); //验证是否登录 $model = new Model_Subtable('member_ext'); $memberModel = new Model_Subtable('member'); /* //数据保存 if($_REQUEST['a']=='add'){ if(method_is('post')){ $data=$_POST; $res=$model->add($data); echo json_encode($res);die(); }else{ $id=(int)$_GET['id']; if($id){ $smarty->assign('vo',$model->find($id)); } $smarty->setTpl('news/templates/add.html')->display();die(); } } //数据删除 if($_REQUEST['a']=='del'){ $res=$model->del($_POST['id']); echo json_encode($res);die(); } */ //数据列表 $condition = array(); if ($_GET['keywords']) { $condition[] = " name like '%" . common_pg('keywords') . "%' "; }
<?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>'); } }
<?php include_once "../../includes/config.inc.php"; $configModel = new Model_CustomerConfig(); $userModel = new Model_Subtable('sub_user'); //微信通道 if (method_is('post')) { $configModel->sendCustomerMsg($_POST['content'], $_POST['fromuser']); } else { $listArr = $userModel->field('fromuser')->where("`type`!=2 and fromuser!='' group by fromuser")->dataArr(); $smarty->assign('list', $listArr); $smarty->assign('listcount', count($listArr)); $smarty->setTpl('msg/templates/add.html')->display(); die; }
<?php include_once "../../includes/config.inc.php"; $configModel = new Model_CustomerConfig(); $userModel = new Model_Subtable('sub_user'); //微信通道 if (method_is('post')) { $dailyModel = new Model_Subtable('sub_daily'); $id = $_POST['content']; $row = $dailyModel->find($id); $content = $row['title'] . $row['content'] . "<a href='" . $row['a_link'] . "'>" . $row['a_title'] . "</a>"; $configModel->sendCustomerMsg($content, $_POST['fromuser']); } else { $dailyModel = new Model_Subtable('sub_daily'); $id = $_GET['id']; $row = $dailyModel->find($id); $content = $row['title'] . $row['content'] . "<a href='" . $row['a_link'] . "'>" . $row['a_title'] . "</a>"; $smarty->assign('content', $content); $smarty->assign('id', $id); $listArr = $userModel->field('fromuser')->where("username in ('15631183141','18013085978','13814812590','18351519983')")->dataArr(); $smarty->assign('list', $listArr); $smarty->assign('listcount', count($listArr)); $smarty->setTpl('msg/templates/send_kf.html')->display(); die; }
<?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'); } }
<?php include_once "../../includes/config.inc.php"; check_login(); //验证是否登录 $model = new Model_Subtable('sub_out'); //数据保存 if ($_REQUEST['a'] == 'add') { if (method_is('post')) { $data = $_POST; $res = $model->add($data); echo json_encode($res); die; } else { $id = (int) $_GET['id']; if ($id) { $smarty->assign('vo', $model->find($id)); } $smarty->setTpl('tx/templates/add.html')->display(); die; } } //更改支付状态 if ($_REQUEST['a'] == 'kf') { $data['info'][is_pay] = (int) $_GET['is_pay']; $data['info'][id] = (int) $_GET['id']; $res = $model->add($data); echo $res; die; } //数据删除
$uRow['sex'] == 1 ? $listArr[$key]['sex'] = '男' : ($listArr[$key]['sex'] = '女'); //是否可看手机号 if ($userRow['is_see'] == 0) { $listArr[$key]['username'] = substr($uRow['username'], 0, 3) . '***' . substr($uRow['username'], -4); } //序号处理 $listArr[$key]['xuhao'] = $key + 1; } } $smarty->assign('list', $listArr); $smarty->setLayout('')->setTpl('mobile/templates/sign_qd.html')->display(); die; } } if ($_REQUEST['a'] == 'sign_qd_ajax') { $signModel = new Model_Subtable('sub_sign'); $pageSize = 30; $p = $_GET['p']; $limitStr = ($p - 1) * $pageSize . ',' . $pageSize; $listArr = $signModel->where("is_valid=1 and tid=" . $_GET['tid'])->order('distance asc')->limit($limitStr)->dataArr(); 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) { $listArr[$key]['username'] = substr($uRow['username'], 0, 3) . '***' . substr($uRow['username'], -4); }
<?php include_once "../../includes/config.inc.php"; 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; }
echo json_encode($carr); die; } if ($_REQUEST['a'] == 'get_districts') { $dmodel = new Model_Subtable('s_district'); $darr = $dmodel->where("CityID=" . $_GET['cid'])->order('DistrictId asc')->dataArr(); echo json_encode($darr); die; } //触发删除前天之前message表中数据 $rand_num = rand(1, 6); if ($rand_num == 3) { $model->query("delete from message where create_date < '" . date('Y-m-d H:i:s', time() - 3600 * 24 * 2) . "'"); } //数据列表 $signModel = new Model_Subtable('sub_sign'); $condition = array(); if ($_GET['keywords']) { $condition[] = " title like '%" . common_pg('keywords') . "%' "; } if ($condition) { $filter['where'] = implode('and', $condition); } $filter['order'] = " id desc "; $data = $model->paginate($filter, '*', common_pg('p'), 10); $listArr = $data['data']; foreach ($listArr as $key => $value) { $listArr[$key]['title'] = cut_str(deletehtml($value['title']), 10); //总数 $countRow = $signModel->field('count(id) as c')->where(" tid='{$value['id']}'")->dataRow(); $listArr[$key]['countnum'] = $countRow['c'];
<?php include_once "../includes/config.inc.php"; //判断登录 if (empty($_SESSION['tyuser'])) { header("Location:./login.php"); die; } //当前登录用户信息 $userModel = new Model_Subtable('sub_user'); $userRow = $userModel->find($_SESSION['tyuser']['id']); if ($userRow['type'] == 2) { header("Location:index.php?m=user&a=user_index"); die; } else { header("Location:index.php?m=task&a=index"); die; }
<?php /** *任务分拨 */ $model = new Model_Subtable('sub_task'); //每日的职位列表 if ($_REQUEST['a'] == 'task_index') { $assignModel = D('sub_assign'); if ($_GET['date']) { $date = $_GET['date']; } else { $date = date('Y-m-d'); } $listArr = $model->where("left(addtime,10) = '{$date}'")->order('id desc')->dataArr(); foreach ($listArr as $key => $value) { $listArr[$key]['title'] = cut_str(deletehtml($value['title']), 15); //是否分拨 $assignRow = $assignModel->where("tid='" . $value['id'] . "'")->dataRow(); if ($assignRow) { $listArr[$key]['is_fb'] = 1; } //区经理是否审核 $listArr[$key]['is_qujingli'] = $assignRow['is_qujingli']; //督导是否全部提报 $assignRow1 = $assignModel->where("tid='" . $value['id'] . "' and isnull(final_pic)")->dataRow(); if ($assignRow && empty($assignRow1)) { $listArr[$key]['is_dudao'] = 1; } } $smarty->assign('list', $listArr);
<?php $model = new Model_Subtable('sub_card'); if ($_REQUEST['a'] == 'index') { $current_time = time(); $uid = $userRow['id']; $list = $model->where("uid='{$uid}' and out_time > " . $current_time)->dataArr(); $num1 = 0; $num2 = 0; $num3 = 0; foreach ($list as $v) { if ($v['type'] == 1) { $num1++; } elseif ($v['type'] == 2) { $num2++; } elseif ($v['type'] == 3) { $num3++; } } $smarty->assign('num1', $num1); $smarty->assign('num2', $num2); $smarty->assign('num3', $num3); //禁闭期内的记录 $banModel = D('ban'); if ($userRow['cardnum']) { $where_str = "end_time > '" . date('Y-m-d', $current_time) . "' and (username='******'username'] . "' or cardnum='" . $userRow['cardnum'] . "')"; } else { $where_str = "end_time > '" . date('Y-m-d', $current_time) . "' and username='******'username'] . "'"; } $banList = $banModel->where($where_str)->dataArr(); if ($banList) {
//数据保存 if ($_REQUEST['a'] == 'add') { $data = $_POST; $res = $model->add($data); echo json_encode($res); die; } //详情 if ($_REQUEST['a'] == 'detail') { $m = new Model_Subtable('sub_shop_odetail'); $id = (int) $_GET['id']; $vo = $model->find($id); //收货人信息 $pmodel = new Model_Subtable('s_province'); $cmodel = new Model_Subtable('s_city'); $dmodel = new Model_Subtable('s_district'); $shipRow = $shipModel->find($vo['shipid']); $prow = $pmodel->where("ProvinceID=" . $shipRow['pid'])->dataRow(); $shipRow['pname'] = $prow['ProvinceName']; $crow = $cmodel->where("CityID=" . $shipRow['cid'])->dataRow(); $shipRow['cname'] = $crow['CityName']; $drow = $dmodel->where("DistrictID=" . $shipRow['did'])->dataRow(); $shipRow['dname'] = $drow['DistrictName']; $smarty->assign('shipRow', $shipRow); if ($id) { $smarty->assign('vo', $vo); $detailList = $m->where(" oid={$id} ")->dataArr(); foreach ($detailList as $key => $value) { $detailList[$key] = unserialize($value['goods_row']); $detailList[$key]['oid'] = $value['oid']; $detailList[$key]['num'] = $value['num'];