Exemplo n.º 1
0
 public function lists()
 {
     $this->assign('add_button', false);
     $this->assign('search_button', false);
     $this->assign('del_button', false);
     $this->assign('check_all', false);
     $top_more_button[] = array('title' => '导出数据', 'url' => U('export', array('ask_id' => $this->ask_id)));
     $this->assign('top_more_button', $top_more_button);
     $map['ask_id'] = $this->ask_id;
     session('common_condition', $map);
     $list = $this->_get_model_list($this->model);
     $qdao = D('AskQuestion');
     foreach ($list['list_data'] as &$vo) {
         //$user = get_followinfo ( $vo ['uid'] );
         //$vo ['nickname'] = $user ['nickname'];
         $question_id = $vo['question_id'];
         $vo['nickname'] = get_nickname($vo['uid']);
         $vo['times'] += 1;
         $vo['question_id'] = $qdao->getQuestionTitle($question_id, $this->ask_id);
         $vo['true_answer'] = $qdao->getQuestionAnswer($question_id, $this->ask_id);
         //$vo ['answer']= implode ( ', ', unserialize ( $vo ['answer'] ) );
         $vo['answer'] = implode(', ', unserialize($vo['answer']));
         $vo['answer'] = $qdao->getQuestionAnswerExtra($question_id, $this->ask_id, $vo['answer']);
         $vo['is_correct'] = $vo['is_correct'] == 1 ? '是' : '否';
     }
     //dump($list['list_data']);die();
     $this->assign($list);
     // dump($list);exit;
     $this->display();
 }
 public function lists()
 {
     $top_more_button[] = array('title' => '导入数据', 'url' => U('import'));
     $this->assign('top_more_button', $top_more_button);
     $model = $this->getModel('credit_data');
     $map['token'] = get_token();
     if (!empty($_GET['uid'])) {
         $uidArr = wp_explode($_GET['uid']);
         $map['uid'] = array('in', $uidArr);
     } elseif (!empty($_REQUEST['nickname'])) {
         $map['uid'] = array('in', D('Common/User')->searchUser($_REQUEST['nickname']));
     }
     if (!isset($map['uid'])) {
         $map['uid'] = array('exp', '>0');
     }
     if (!empty($_REQUEST['credit_name'])) {
         $map['credit_name'] = safe($_REQUEST['credit_name']);
     }
     if (!empty($_REQUEST['start_time']) && !empty($_REQUEST['end_time'])) {
         $map['cTime'] = array('between', '"' . intval($_REQUEST['start_time']) . ',' . intval($_REQUEST['start_time']) . '"');
     } elseif (!empty($_REQUEST['start_time'])) {
         $map['cTime'] = array('egt', intval($_REQUEST['start_time']));
     } elseif (!empty($_REQUEST['end_time'])) {
         $map['cTime'] = array('elt', intval($_REQUEST['end_time']));
     }
     session('common_condition', $map);
     $list_data = $this->_get_model_list($model);
     foreach ($list_data['list_data'] as &$vo) {
         $vo['uid'] = get_nickname($vo['uid']);
     }
     $this->assign($list_data);
     // dump($list_data);
     $this->display();
 }
Exemplo n.º 3
0
 public function index()
 {
     if (IS_POST) {
         $post_data = I('post.');
         $post_data['first'] = $post_data['rows'] * ($post_data['page'] - 1);
         $map = array();
         $map = $this->_search();
         $total = $this->Model->where($map)->count();
         if ($total == 0) {
             $_list = '';
         } else {
             $_list = $this->Model->where($map)->order($post_data['sort'] . ' ' . $post_data['order'])->limit($post_data['first'] . ',' . $post_data['rows'])->select();
         }
         $option["status"] = array(0 => '禁用', 1 => '启用');
         foreach ($_list as $list_key => $list_one) {
             foreach ($list_one as $list_one_key => $list_one_field) {
                 if ($option[$list_one_key] != '') {
                     $_list[$list_key][$list_one_key] = $option[$list_one_key][$list_one_field];
                 }
             }
             $_list[$list_key]['action_title'] = get_action($_list[$list_key]['action_id'], 'title');
             $_list[$list_key]['user_nickname'] = get_nickname($_list[$list_key]['user_id']);
             $_list[$list_key]["create_time"] = date("Y年m月d日", $_list[$list_key]["create_time"]);
             $operate_menu = '';
             if (Is_Auth('Admin/ActionLog/edit')) {
                 $operate_menu = $operate_menu . "<a href='#' onclick=\"Submit_Form('ActionLog_Form','ActionLog_Data_List','" . U('edit', array('id' => $_list[$list_key]['id'])) . "','','编辑数据','');\">查看行为日志</a>";
             }
             $_list[$list_key]['operate'] = $operate_menu;
         }
         $data = array('total' => $total, 'rows' => $_list);
         $this->ajaxReturn($data);
     } else {
         $this->display();
     }
 }
 public function lists()
 {
     $model = $this->getModel('credit_data');
     $map['token'] = get_token();
     if (!empty($_GET['uid'])) {
         $map['uid'] = intval($_GET['uid']);
     } elseif (!empty($_REQUEST['nickname'])) {
         $user_map['nickname'] = array('like', '%' . htmlspecialchars($_REQUEST['nickname']) . '%');
     }
     if (!isset($map['uid'])) {
         $map['uid'] = array('exp', '>0');
     }
     if (!empty($_REQUEST['credit_name'])) {
         $map['credit_name'] = safe($_REQUEST['credit_name']);
     }
     if (!empty($_REQUEST['start_time']) && !empty($_REQUEST['end_time'])) {
         $map['cTime'] = array('between', '"' . intval($_REQUEST['start_time']) . ',' . intval($_REQUEST['start_time']) . '"');
     } elseif (!empty($_REQUEST['start_time'])) {
         $map['cTime'] = array('egt', intval($_REQUEST['start_time']));
     } elseif (!empty($_REQUEST['end_time'])) {
         $map['cTime'] = array('elt', intval($_REQUEST['end_time']));
     }
     session('common_condition', $map);
     $list_data = $this->_get_model_list($model);
     foreach ($list_data['list_data'] as &$vo) {
         $vo['nickname'] = get_nickname($vo['uid']);
     }
     $this->assign($list_data);
     // dump($list_data);
     $this->display();
 }
Exemplo n.º 5
0
 /**
  * 自动登录用户
  * @param  integer $user 用户信息数组
  */
 private function autoLogin($user)
 {
     /* 更新登录信息 */
     $data = array('uid' => $user['uid'], 'login' => array('exp', '`login`+1'), 'last_login_time' => NOW_TIME, 'last_login_ip' => get_client_ip(1));
     $this->save($data);
     /* 记录登录SESSION和COOKIES */
     $auth = array('uid' => $user['uid'], 'username' => get_nickname($user['uid']), 'last_login_time' => $user['last_login_time']);
     session('user_auth', $auth);
     session('user_auth_sign', data_auth_sign($auth));
 }
Exemplo n.º 6
0
 /**
  * 设置登录状态、记录登录日志
  *
  * @param integer $uid
  *        	用户ID
  * @param boolean $is_remember_me
  *        	是否记录登录状态,默认为false
  * @return boolean 操作是否成功
  */
 private function _recordLogin($uid)
 {
     if (!$this->getCookieUid()) {
         cookie('QT_LOGGED_USER', $this->jiami($this->change() . ".{$uid}."));
     }
     $this->setField('last_login_time', NOW_TIME, 'uid=' . $uid);
     $auth = array('uid' => $uid, 'nickname' => get_nickname($uid), 'last_login_time' => NOW_TIME);
     session('user_auth', $auth);
     session('user_auth_sign', data_auth_sign($auth));
     return true;
 }
Exemplo n.º 7
0
 public function getInvestorlist($pid, $page = '0', $number = '8', $order = 'lead_type desc,create_time desc')
 {
     $projectStatis = $this->getProjectStatis($pid);
     if ($projectStatis['success'] == false) {
         return $projectStatis;
     } else {
         $data['total'] = $projectStatis['info']['actualinvestors'];
         $data['per_page'] = $number;
         $data['page'] = $page + 1;
         $data['last_page'] = ceil($data['total'] / $number);
         $data['estimatefund'] = $projectStatis['info']['estimatefund'];
         $data['raisedfund'] = $projectStatis['info']['raisedfund'];
         $data['fundpercentage'] = $data['raisedfund'] / $data['estimatefund'];
         if ($page <= $data['last_page']) {
             $where['project_id'] = $pid;
             $where['status'] = 9;
             $data['investors'] = M('ProjectInvestor')->where($where)->page($page . ',' . $number)->order($order)->field('investor_id as id,fund,lead_type')->select();
             foreach ($data['investors'] as &$investor) {
                 switch ($investor['lead_type']) {
                     case 9:
                         $investor['lead_type'] = 领投人;
                         break;
                     case 3:
                         $investor['lead_type'] = 跟投人;
                         break;
                 }
                 $investor['nickname'] = get_nickname($investor['id']);
             }
             return array('success' => true, 'info' => $data);
             /*
                             foreach($data['users'] as &$user){
                                 $getUserInfo['nickname'] = get_membername($user['id']);
                                 $getUserInfo['photo_url'] = 'http://'.$_SERVER['HTTP_HOST'].get_memberface($user['id']);
                                 $currentUser = is_login();
                                 if($currentUser>0){
                                     $getUserInfo['relation'] =D('Followers')->getRelation($currentUser,$user['id']);
                                 }
                                 else{
                                     $getUserInfo['relation'] =null;
                                 }
                                 $user = array_merge($user,$getUserInfo);
                             }
                             return $data;*/
         }
         return array('success' => false, 'info' => '没有更多投资者信息!');
     }
     return array('success' => true, 'info' => '没有粉丝信息!');
 }
Exemplo n.º 8
0
 public function afterPayAlipay($record)
 {
     $order_id = $record['out_trade_no'];
     //交易状态
     if ($record['trade_status'] == 'TRADE_FINISHED' || $record['trade_status'] == 'TRADE_SUCCESS') {
         $rechargeModel = M('Order');
         $order = $rechargeModel->getOrder($order_id);
         if ($order['record_id'] == 0) {
             //未作处理
             if (!$order['amount'] == $record['total_fee']) {
                 return '失败——付款订单出错,数额与订单不符,付款失败。请联系管理员。' . $order_id;
                 /*  $this->error('付款订单出错,数额与订单不符,付款失败。请联系管理员。');*/
             }
             if (!$rechargeModel->where(array('id' => $order_id))->setField('record_id', $record['record_id'])) {
                 return '失败——更改订单状态失败。' . $order_id;
                 /*   $this->error('更改订单状态失败。');*/
             }
             $rechargeType = $order['recharge_type'];
             if (!$order['recharge_type']) {
                 return '失败——充值字段合法性验证失败,请联系管理员。' . $order_id;
                 /*  $this->error('充值字段合法性验证失败,请联系管理员。');*/
             }
             $scoreType = $order['score_type'];
             $ratio = $rechargeType['UNIT'];
             $name = $scoreType['title'];
             $step = floor($order['amount'] * $ratio);
             if (M('Ucenter/Score')->setUserScore($order['uid'], $step, $order['field'], 'inc', 'recharge_order', $order_id, get_nickname($order['uid']) . '进行积分充值')) {
                 $rechargeModel->where(array('id' => $order_id))->setField('payok', 1);
                 S('recharge_order_' . $order_id, null);
                 return '成功——充值成功。' . get_nickname($order['uid']) . '[' . $order['uid'] . ']' . '的' . $name . ' 增加 ' . $step;
                 /*  $this->success('充值成功。您的' . $name . ' 增加 ' . $step . '。即将跳转回充值页面。', U('recharge/index/index'), 10);*/
             } else {
                 return '失败——支付成功,但充值到数据库失败。请联系管理员。' . $order_id;
                 /*  $this->error('支付成功,但充值到数据库失败。请联系管理员。');*/
             }
         } else {
             return '失败——该订单已经支付,请勿重复支付。' . $order_id;
             /*  $this->error('该订单已经支付,请勿重复支付。');*/
         }
         //判断该笔订单是否在商户网站中已经做过处理
         //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
     } else {
         return '失败——支付状态出错。' . $record['trade_status'] . $order_id;
         /* $this->error('支付状态出错。' . $record['trade_status']);*/
     }
 }
Exemplo n.º 9
0
 public function afterPayAlipay($record)
 {
     $order_id = $record['out_trade_no'];
     //交易状态
     if ($record['trade_status'] == 'TRADE_FINISHED' || $record['trade_status'] == 'TRADE_SUCCESS') {
         $data['condition'] = 1;
         //置为已支付
         $data['pay_time'] = $record['notify_time'];
         $orderModel = M('store_order');
         $s_uid = $orderModel->where(array('id' => $order_id))->getField('s_uid');
         $shopModel = M('Store/StoreShop');
         $shopModel->where(array('uid' => $s_uid))->setInc('order_count', 1);
         $orderModel->where(array('id' => $order_id))->save($data);
         return '付款成功,等待卖家' . get_nickname($s_uid) . '发货';
     } else {
         return '失败——支付状态出错。' . $record['trade_status'] . $order_id;
         /* $this->error('支付状态出错。' . $record['trade_status']);*/
     }
 }
Exemplo n.º 10
0
 public function groupInvite()
 {
     $aGroupId = I('group_id', 0, 'intval');
     $this->checkAuth();
     if (IS_POST) {
         $uids = I('post.uids');
         $group = D('Group')->getGroup($aGroupId);
         foreach ($uids as $uid) {
             D('Message')->sendMessage($uid, '邀请加入群组', get_nickname(is_login()) . "邀请您加入群组【{$group['title']}】  <a class='ajax-post' href='" . U('group/index/attend', array('group_id' => $aGroupId)) . "'>接受邀请</a>", 'group/index/group', array('id' => $aGroupId), is_login());
         }
         $result = array('status' => 1, 'info' => '邀请成功');
         $this->ajaxReturn($result);
     } else {
         $friendList = D('Follow')->getAllFriends(is_login());
         $friendIds = getSubByKey($friendList, 'follow_who');
         $friends = array();
         foreach ($friendIds as $v) {
             $friends[$v] = query_user(array('avatar128', 'avatar64', 'nickname', 'uid', 'space_url'), $v);
         }
         $this->assign('friends', $friends);
         $this->assign('group_id', $aGroupId);
         $this->display();
     }
 }
Exemplo n.º 11
0
 public function notify()
 {
     require_once './Application/Recharge/Lib/Alipay/alipay.config.php';
     require_once './Application/Recharge/Lib/Alipay/lib/alipay_notify.class.php';
     $alipayNotify = new \AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyNotify();
     if ($verify_result) {
         //验证成功
         $alipayRecordModel = D('recharge_record_alipay');
         $record['body'] = I('post.body', '未获取', 'op_t');
         $record['buyer_email'] = I('post.buyer_email', '未获取', 'op_t');
         $record['buyer_id'] = I('post.buyer_id', '未获取', 'op_t');
         $record['exterface'] = I('post.exterface', '未获取', 'op_t');
         $record['is_success'] = I('post.is_success', '未获取', 'op_t');
         $record['notify_id'] = I('post.notify_id', '未获取', 'op_t');
         $record['notify_time'] = I('post.notify_time', '0', 'strtotime');
         $record['notify_type'] = I('post.notify_type', '未获取', 'op_t');
         $record['out_trade_no'] = I('post.out_trade_no', '未获取', 'op_t');
         $record['payment_type'] = I('post.payment_type', '未获取', 'op_t');
         $record['seller_email'] = I('post.seller_email', '未获取', 'op_t');
         $record['seller_id'] = I('post.seller_id', '未获取', 'op_t');
         $record['subject'] = I('post.subject', '未获取', 'op_t');
         $record['total_fee'] = I('post.total_fee', '未获取', 'op_t');
         $record['trade_no'] = I('post.trade_no', '未获取', 'op_t');
         $record['trade_status'] = I('post.trade_status', '未获取', 'op_t');
         $record['sign'] = I('post.sign', '未获取', 'op_t');
         $record['sign_type'] = I('post.sign', '未获取', 'op_t');
         if (!($rs = $alipayRecordModel->add($record))) {
             exit('失败——保存支付结果失败。请联系管理员。');
             /*                $this->error('保存支付结果失败。请联系管理员。');*/
         }
         //商户订单号
         $order_id = $record['out_trade_no'];
         //交易状态
         if ($record['trade_status'] == 'TRADE_FINISHED' || $record['trade_status'] == 'TRADE_SUCCESS') {
             $rechargeModel = D('Order');
             $order = $rechargeModel->getOrder($order_id);
             if ($order['record_id'] == 0) {
                 //未作处理
                 if (!$order['amount'] == $record['total_fee']) {
                     exit('失败——付款订单出错,数额与订单不符,付款失败。请联系管理员。' . $order_id);
                     /*  $this->error('付款订单出错,数额与订单不符,付款失败。请联系管理员。');*/
                 }
                 if (!$rechargeModel->where(array('id' => $order_id))->setField('record_id', $rs)) {
                     exit('失败——更改订单状态失败。' . $order_id);
                     /*   $this->error('更改订单状态失败。');*/
                 }
                 $rechargeType = $order['recharge_type'];
                 if (!$order['recharge_type']) {
                     exit('失败——充值字段合法性验证失败,请联系管理员。' . $order_id);
                     /*  $this->error('充值字段合法性验证失败,请联系管理员。');*/
                 }
                 $scoreType = $order['score_type'];
                 $ratio = $rechargeType['UNIT'];
                 $name = $scoreType['title'];
                 $step = floor($order['amount'] * $ratio);
                 $memberModel = D('Member');
                 if ($memberModel->where(array('uid' => $order['uid']))->setInc('score' . $order['field'], $step)) {
                     $rechargeModel->where(array('id' => $order_id))->setField('payok', 1);
                     S('recharge_order_' . $order_id, null);
                     exit('成功——充值成功。' . get_nickname($order['uid']) . '[' . $order['uid'] . ']' . '的' . $name . ' 增加 ' . $step);
                     /*  $this->success('充值成功。您的' . $name . ' 增加 ' . $step . '。即将跳转回充值页面。', U('recharge/index/index'), 10);*/
                 } else {
                     exit('失败——支付成功,但充值到数据库失败。请联系管理员。' . $order_id);
                     /*  $this->error('支付成功,但充值到数据库失败。请联系管理员。');*/
                 }
             } else {
                 exit('失败——该订单已经支付,请勿重复支付。' . $order_id);
                 /*  $this->error('该订单已经支付,请勿重复支付。');*/
             }
             //判断该笔订单是否在商户网站中已经做过处理
             //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
         } else {
             exit('失败——支付状态出错。' . $record['trade_status'] . $order_id);
             /* $this->error('支付状态出错。' . $record['trade_status']);*/
         }
     } else {
         exit('error');
     }
 }
Exemplo n.º 12
0
 /**
  * 购买商品
  * @param int $id
  * @param int $num
  * @author 郑钟良<*****@*****.**>
  */
 public function goodsBuy($id = 0, $name = '', $address = '', $zipcode = '', $phone = '', $address_id = '')
 {
     $address = op_t($address);
     $address_id = intval($address_id);
     $num = 1;
     if (!is_login()) {
         $this->error('请先登录!');
     }
     $this->checkAuth('Shop/Index/goodsBuy', -1, '你没有购买、兑换商品的权限!');
     $this->checkActionLimit('shop_goods_buy', 'shop', $id, is_login());
     $goods = D('shop')->where(array('id' => $id))->find();
     if ($goods) {
         if ($num <= 0) {
             $this->error('商品购买数量不能为负数。');
         }
         //验证开始
         //判断商品余量
         if ($num > $goods['goods_num']) {
             $this->error('商品余量不足');
         }
         //扣money
         $ScoreModel = D('Ucenter/Score');
         $score_type = modC('SHOP_SCORE_TYPE', '1', 'Shop');
         $money_type = $ScoreModel->getType(array('id' => $score_type));
         $money_need = $num * $goods['money_need'];
         $my_money = query_user('score' . $score_type);
         if ($money_need > $my_money) {
             $this->error('你的' . $money_type['title'] . '不足');
         }
         //用户地址处理
         if ($name == '' || !preg_match("/^[\\x{4e00}-\\x{9fa5}]+\$/u", $name)) {
             $this->error('请输入正确的用户名');
         }
         if ($address == '') {
             $this->error('请填写收货地址');
         }
         if ($zipcode == '' || strlen($zipcode) != 6 || !is_numeric($zipcode)) {
             $this->error('请正确填写邮编');
         }
         if ($phone == '' || !preg_match("/^1[3458][0-9]{9}\$/", $phone)) {
             $this->error('请正确填写手机号码');
         }
         $shop_address['phone'] = $phone;
         $shop_address['name'] = $name;
         $shop_address['address'] = $address;
         $shop_address['zipcode'] = $zipcode;
         if ($address_id) {
             $address_save = D('shop_address')->where(array('id' => $address_id))->save($shop_address);
             if ($address_save) {
                 D('shop_address')->where(array('id' => $address_id))->setField('change_time', time());
             }
             $data['address_id'] = $address_id;
         } else {
             $shop_address['uid'] = is_login();
             $shop_address['create_time'] = time();
             $data['address_id'] = D('shop_address')->add($shop_address);
         }
         //验证结束
         $data['goods_id'] = $id;
         $data['goods_num'] = $num;
         $data['status'] = 0;
         $data['uid'] = is_login();
         $data['createtime'] = time();
         $ScoreModel->setUserScore(array(is_login()), $money_need, $score_type, 'dec', 'shop', $id, get_nickname(is_login()) . '购买了商品');
         $res = D('shop_buy')->add($data);
         if ($res) {
             //商品数量减少,已售量增加
             D('shop')->where('id=' . $id)->setDec('goods_num', $num);
             D('shop')->where('id=' . $id)->setInc('sell_num', $num);
             //发送系统消息
             $message = $goods['goods_name'] . "购买成功,请等待发货。";
             D('Common/Message')->sendMessageWithoutCheckSelf(is_login(), '购买成功通知', $message, 'Shop/Index/myGoods', array('status' => '0'));
             //商城记录
             $shop_log['message'] = '用户[' . is_login() . ']' . query_user('nickname', is_login()) . '在' . time_format($data['createtime']) . '购买了商品<a href="index.php?s=/Shop/Index/goodsDetail/id/' . $goods['id'] . '.html" target="_black">' . $goods['goods_name'] . '</a>';
             $shop_log['uid'] = is_login();
             $shop_log['create_time'] = $data['createtime'];
             D('shop_log')->add($shop_log);
             action_log('shop_goods_buy', 'shop', $id, is_login());
             $this->ajaxReturn(array('status' => 1, 'info' => '购买成功!花费了' . $money_need . $money_type['title'], $_SERVER['HTTP_REFERER']));
         } else {
             $this->ajaxReturn(array('status' => 0, 'info' => '购买失败!'));
         }
     } else {
         $this->ajaxReturn(array('status' => 0, 'info' => '请选择要购买的商品!'));
     }
 }
Exemplo n.º 13
0
 function export()
 {
     set_time_limit(0);
     $id = $hpmap['id'] = I('id');
     $info = D('Coupon')->getInfo($id);
     $dataArr[0] = array(0 => "用户", 1 => " 详细信息", 2 => " SN码", 3 => "工作人员", 4 => "核销时间");
     $px = C('DB_PREFIX');
     $page = I('p', 1, 'intval');
     // 默认显示第一页数据
     // 搜索条件
     $where = "is_use=1 AND addon='Coupon' AND target_id=" . $id;
     $start_time = I('start_time');
     if ($start_time) {
         $where .= " AND s.use_time>" . strtotime($start_time);
     }
     $end_time = I('end_time');
     if ($end_time) {
         $where .= " AND s.use_time<" . strtotime($end_time);
     }
     $search_nickname = I('search_nickname');
     if (!empty($search_nickname)) {
         $where .= " AND s.uid IN(" . D('Common/User')->searchUser($search_nickname) . ")";
     }
     // 读取模型数据列表
     $data = D('Common/SnCode')->field(true)->where($where)->order('use_time DESC')->limit(5000)->select();
     // dump ( $data );
     foreach ($data as $k => $vo) {
         $vo['content'] = '核销优惠券: ' . $info['title'];
         $dataArr[$k + 1] = array(0 => get_nickname($vo['uid']), 1 => $vo['content'], 2 => $vo['sn'], 3 => get_nickname($vo['admin_uid']), 4 => time_format($vo['use_time']));
     }
     outExcel($dataArr, 'Coupon_' . $id);
 }
Exemplo n.º 14
0
<?php

include "./config";
include "./func.php";
try {
    $conn = connect();
} catch (Exception $error) {
    display_message($error->getMessage(), "", "error");
    exit;
}
$nickname = get_nickname($conn);
$count = get_rows($conn);
$select = "select * from article;";
$result = $conn->query($select);
?>
<!DOCTYPE html>
<html>
<head>
    <title>归档</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-combined.min.css">
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style type="text/css">
        body {
            background-image:url("image/theme.png");
            background-size: cover;
            background-repeat:no-repeat;
Exemplo n.º 15
0
 public function show()
 {
     pc_base::load_sys_class('form', '', 0);
     $M = getcache('ask', 'commons');
     $M = $M[1];
     $_username = param::get_cookie('_username', L('phpcms_friends'));
     $_userid = param::get_cookie('_userid');
     $r_m = $this->db_m->get_one(array('userid' => $_userid, 'siteid' => SITEID));
     $_point = $r_m['point'];
     $id = intval($_GET['id']);
     if (!$id) {
         showmessage(L('illegal_parameters'), HTTP_REFERER);
     }
     $array = array();
     $a = $this->db->get_one(array('askid' => $id, 'siteid' => SITEID));
     $posts_table_name = $this->db2->posts_table($a['catid']);
     $this->db2->table_name = $posts_table_name;
     if (!$this->db2->table_exists(str_replace($this->db2->db_tablepre, '', $posts_table_name))) {
         showmessage(L('info_does_not_exists'), HTTP_REFERER);
     }
     $result = $this->db2->select("askid={$id} AND status>2 AND siteid=" . SITEID, '*');
     foreach ($result as $r) {
         if ($r['isask']) {
             $arr = $this->db->get_one(array('askid' => $id, 'siteid' => SITEID));
             $r['title'] = $arr['title'];
             $r['reward'] = $arr['reward'];
             $r['status'] = $arr['status'];
             $r['answercount'] = $arr['answercount'];
             $r['flag'] = $arr['flag'];
             $r['endtime'] = $arr['endtime'];
             $r['catid'] = $arr['catid'];
             $r['hits'] = $arr['hits'];
             $r['anonymity'] = $arr['anonymity'];
             $rs['keywords'] = $arr['keywords'];
             $r['keywords'] = explode(' ', $arr['keywords']);
             if (SYS_TIME > $r['endtime'] && !$arr['ischeck']) {
                 $this->db->update(array('ischeck' => '1'), array('askid' => $id));
                 $this->db->update(array('flag' => '3'), 'askid=' . $id . ' AND answercount>1');
                 $this->db2->update(array('candidate' => '1'), array('askid' => $id));
                 $this->db_credit->update($arr['userid'], $arr['username'], $M['del_day15_credit'], 0);
                 pc_base::load_app_class('spend', 'pay', 0);
                 spend::point($M['del_day15_credit'], L('ask_15days_no_deal_with'), $arr['userid'], $arr['username'], '', '', $flag);
             }
         }
         $userids[] = $r['userid'];
         $array[] = $r;
     }
     if ($userids) {
         $userids = implode(',', $userids);
         $data = $this->db_m->select("userid IN ({$userids}) AND siteid=" . SITEID, '*');
         foreach ($data as $r) {
             $userinfo[$r['userid']]['actortype'] = $r['actortype'];
             $userinfo[$r['userid']]['point'] = $r['point'];
         }
         foreach ($array as $arr) {
             $arr['actortype'] = $userinfo[$arr['userid']]['actortype'];
             $arr['point'] = $userinfo[$arr['userid']]['point'];
             $_array[] = $arr;
         }
         $array = $_array;
     } else {
         $array = $array;
     }
     if ($array) {
         $have_answer = false;
         foreach ($array as $k => $v) {
             if ($v['isask']) {
                 $title = $v['title'];
                 $message = $this->M[1]['use_editor'] ? $v['message'] : trim_textarea($v['message']);
                 $reward = $v['reward'];
                 $userid = $v['userid'];
                 $username = $v['username'];
                 $nickname = get_nickname($v['userid']);
                 $status = $v['status'];
                 $hits = $v['hits'];
                 $flag = $v['flag'];
                 $addtime = $v['addtime'];
                 $actor = actor($v['actortype'], $v['point']);
                 $answercount = $v['answercount'];
                 $result = count_down($v['endtime']);
                 $day = $result[0];
                 $hour = $result[1];
                 $minute = $result[2];
                 $catid = $v['catid'];
                 $anonymity = $v['anonymity'];
                 $keywords = $v['keywords'];
             } elseif ($v['optimal']) {
                 $best_answer_pid = $v['pid'];
                 $best_answer_vote_1 = $v['best_answer_vote_1'];
                 $best_answer_vote_2 = $v['best_answer_vote_2'];
                 $totalnum = $best_answer_vote_1 + $best_answer_vote_2;
                 $best_answer_vote_1_per = round($best_answer_vote_1 / $totalnum * 100, 1) . "%";
                 $best_answer_vote_2_per = round($best_answer_vote_2 / $totalnum * 100, 1) . "%";
                 $solvetime = $v['solvetime'];
                 $answer = $v['message'];
                 $answertime = $v['addtime'];
                 $answer = trim_textarea($v['message']);
                 $optimail_username = $v['username'];
                 $optimail_userid = $v['userid'];
                 $optimail_nickname = get_nickname($v['userid']);
                 $optimal_actor = actor($v['actortype'], $v['point']);
             } else {
                 if ($v['userid'] == $_userid) {
                     $have_answer = true;
                 }
                 $infos[$k]['pid'] = $v['pid'];
                 $infos[$k]['userid'] = $v['userid'];
                 $infos[$k]['username'] = $v['username'];
                 $infos[$k]['nickname'] = get_nickname($v['userid']);
                 $infos[$k]['addtime'] = $v['addtime'];
                 $infos[$k]['candidate'] = $v['candidate'];
                 $infos[$k]['anonymity'] = $v['anonymity'];
                 $infos[$k]['actor'] = actor($v['actortype'], $v['point']);
                 $infos[$k]['message'] = $this->M[1]['use_editor'] ? $v['message'] : trim_textarea($v['message']);
             }
         }
         if ($v['optimal']) {
             $answercount = $answercount - 1;
         }
         if ($userid == $_userid) {
             $isask = 1;
         } else {
             $isask = 0;
         }
         if (isset($action) && $action == 'vote') {
             if ($flag == 1) {
                 exit;
             }
             $tpl = 'vote';
         } else {
             $tpl = 'show';
         }
         if ($status == 1) {
             showmessage(L('info_does_not_exists'), HTTP_REFERER);
         }
         if ($userid != $_userid) {
             $this->db->update(array('hits' => '+=1'), array('askid' => $id));
         }
         $description = $answer ? str_cut($answer, '200') : str_cut($message, '200');
         $SEO = seo(SITEID, $catid, $title, $description, $seo_keywords);
         include template('ask', $tpl);
     } else {
         showmessage(L('info_does_not_exists'), HTTP_REFERER);
     }
 }
                    ThinkWechat
                </small>
            </a>
        </div>

        <!-- 退出登录 -->
        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <!-- #section:basics/navbar.user_menu -->
                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="/Public/assets/avatars/user.jpg" alt="Jason's Photo"/>
								<span class="user-info">
									<small>Welcome,</small>
									<?php 
echo get_nickname();
?>
								</span>

                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a id="clickChangePassword" href="javascript:void (0)">
                                <i class="ace-icon fa fa-cog"></i>
                                修改密码
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
} else {
    echo "";
}
?>
        </ul>
        <!-- /主导航 -->

        <!-- 用户栏 -->
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">你好,<em title="<?php 
echo get_nickname($mid);
?>
"><?php 
echo get_nickname($mid);
?>
</em></li>
                <li><a href="<?php 
echo U('Home/Index/index');
?>
">返回前台</a></li>
                <li><a href="<?php 
echo U('User/updatePassword');
?>
">修改密码</a></li>
                <li><a href="<?php 
echo U('User/updateNickname');
?>
">修改昵称</a></li>
                <li><a href="<?php 
Exemplo n.º 18
0
 function showLog()
 {
     $nav[0]['title'] = "投票列表";
     $nav[0]['class'] = "";
     $nav[0]['url'] = U("lists");
     $nav[1]['title'] = "投票记录";
     $nav[1]['class'] = "current";
     $this->assign('nav', $nav);
     $btn['url'] = U('lists', array('mdm' => $_GET['mdm']));
     $btn['title'] = '返回';
     $returnbtn[] = $btn;
     $this->assign('top_more_button', $returnbtn);
     $this->assign('add_button', false);
     $this->assign('search_button', false);
     $this->assign('del_button', false);
     $this->assign('check_all', false);
     $model = $this->vlog;
     $page = I('p', 1, 'intval');
     // 默认显示第一页数据
     // 解析列表规则
     $list_data = $this->_list_grid($model);
     unset($list_data['list_grids'][4]);
     $grids = $list_data['list_grids'];
     $fields = $list_data['fields'];
     // 搜索条件
     // $map ['addon'] = $this->addon;
     $map['vote_id'] = I('id');
     // $map ['token'] = get_token ();
     session('common_condition', $map);
     // $map = $this->_search_map ( $model, $fields );
     $row = empty($model['list_row']) ? 20 : $model['list_row'];
     empty($fields) || in_array('id', $fields) || array_push($fields, 'id');
     $name = parse_name(get_table_name($model['id']), true);
     $data = M($name)->field(empty($fields) ? true : $fields)->where($map)->order('id DESC')->page($page, $row)->select();
     //var_dump($data);
     // 获取投票标题
     // 		$map2 ['id'] = I ( 'id' );
     // 		$vname = M ( 'vote' )->where ( $map2 )->getField ( 'title' );
     foreach ($data as $v) {
         $option_ids[$v['options']] = $v['options'];
     }
     // 代码须优化
     // 获取投票选项名称
     if (!empty($option_ids)) {
         $map3['id'] = array('in', $option_ids);
         $list = M('vote_option')->where($map3)->field('id,name')->select();
         foreach ($list as $vo) {
             $option_names[$vo['id']] = $vo['name'];
         }
     }
     foreach ($data as &$v) {
         // 			$v ['vote_id'] = $vname;
         $v['options'] = $option_names[$v['options']];
         $user = get_userinfo($v['user_id']);
         $v['vote_id'] = url_img_html($user['headimgurl']);
         $v['user_id'] = get_nickname($v['user_id']);
     }
     $count = M($name)->where($map)->count();
     $list_data['list_data'] = $data;
     // 分页
     if ($count > $row) {
         $page = new \Think\Page($count, $row);
         $page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
         $list_data['_page'] = $page->show();
     }
     unset($list_data["list_grids"][""]);
     $this->assign($list_data);
     //dump($list_data);
     $this->display('./Application/Home/View/default/Addons/lists.html');
 }
 /**
  * 审核通过
  */
 public function receiveMember()
 {
     $aUid = I('post.uid', 0, 'intval');
     $aGroupId = I('post.group_id', '', 'intval');
     $res = M('GroupMember')->setStatus($aUid, $aGroupId, 1);
     $dynamic['group_id'] = $aGroupId;
     $dynamic['uid'] = $aUid;
     $dynamic['type'] = 'attend';
     $dynamic['create_time'] = time();
     M('GroupDynamic')->add($dynamic);
     if ($res) {
         $group = M('Group')->getGroup($aGroupId);
         M('Message')->sendMessage($aUid, '群组审核通过', get_nickname(is_login()) . "通过了您加入群组【{$group['title']}】的请求", 'group/index/group', array('id' => $aGroupId), is_login());
         S('group_member_count_' . $group['id'], null);
         S('group_is_join_' . $group['id'] . '_' . $aUid, null);
         $this->success('审核成功', 'refresh');
     } else {
         $this->error('审核失败');
     }
 }
                ?>
<tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="<?php 
                echo $vo["id"];
                ?>
" /></td>
			<td><?php 
                echo $vo["id"];
                ?>
 </td>
			<td><?php 
                echo get_action($vo['action_id'], 'title');
                ?>
</td>
			<td><?php 
                echo get_nickname($vo['user_id']);
                ?>
</td>
			<td><span><?php 
                echo time_format($vo["create_time"]);
                ?>
</span></td>
			<td><a href="<?php 
                echo U('Action/edit?id=' . $vo['id']);
                ?>
">详细</a>
				<a class="confirm ajax-get" href="<?php 
                echo U('Action/remove?ids=' . $vo['id']);
                ?>
">删除</a>
                </td>
Exemplo n.º 21
0
 /**
  * 回收站列表
  * @author huajie <*****@*****.**>
  */
 public function recycle()
 {
     //获取左边菜单
     $this->getMenu();
     $map['status'] = -1;
     $list = $this->lists(M('Document'), $map, 'update_time desc');
     //处理列表数据
     if (is_array($list)) {
         foreach ($list as $k => &$v) {
             $v['username'] = get_nickname($v['uid']);
         }
     }
     $this->assign('list', $list);
     $this->meta_title = '回收站';
     $this->display();
 }
</a></td>
						
                  
                        <td><?php 
                echo $vo["province"];
                ?>
,<?php 
                echo $vo["city"];
                ?>
</td>
						<td><?php 
                echo $vo["country"];
                ?>
</td>
						<td><?php 
                echo get_nickname($uid);
                ?>
</td>
                         <td><?php 
                echo date('Y-m-d H:i:s', $vo["time"]);
                ?>
</td>
					<td> 
                            <a title="编辑" href="<?php 
                echo U('edit?id=' . $vo['id']);
                ?>
">编辑</a>
                            <a class="confirm ajax-get" title="删除" href="<?php 
                echo U('del?id=' . $vo['id']);
                ?>
">删除</a>
Exemplo n.º 23
0
$maximum_reward = $everpaid + $estimated_balance + $shelved_shares_estimate + $smppsec + $donated;
$unpaid_balance_print = prettySatoshis($unpaid_balance);
$estimated_change_print = "+" . prettySatoshis($estimated_change);
# can/should never be negative...
$estimated_balance_print = prettySatoshis($estimated_balance);
$percent_pps = $total_rewarded / ($total_rewarded + $shelved_shares + $smppsec + $donated);
$percent_pps_estimate = ($estimated_balance + $everpaid) / $maximum_reward;
$percent_pps_estimated_change = $percent_pps_estimate - $percent_pps;
$percent_pps_print = prettyProportion($percent_pps);
$percent_pps_estimate_print = prettyProportion($percent_pps_estimate);
$percent_pps_estimate_change_print = ($percent_pps_estimated_change > 0 ? "+" : "") . prettyProportion($percent_pps_estimated_change);
$savedbal = $bal;
$bal = prettySatoshis($bal);
$titleprepend = "({$bal}) {$givenuser} - ";
print_stats_top();
$nickname = get_nickname($link, $user_id);
if ($nickname != "" && $nickname != $givenuser) {
    print "<H2><I>{$nickname}</I> <small> - {$givenuser}</small></H2>";
} else {
    print "<h2>{$givenuser}</h2>";
}
print "<div id=\"userstatsmain\">";
print "<TABLE class=\"userstatsbalance\">";
print "<THEAD><TR><TH></TH><TH>Unpaid Balance</TH><TH><A HREF=\"http://eligius.st/wiki/index.php/Capped_PPS_with_Recent_Backpay\">Shares Rewarded</A></TH></TR></THEAD>";
print "<TR class=\"userstatsodd\"><TD>As of last block: </TD><TD style=\"text-align: right;\">{$unpaid_balance_print}</TD><TD style=\"text-align: right; font-size: 80%;\">{$percent_pps_print}</TD></TR>";
print "<TR class=\"userstatseven\"><TD>Estimated Change: </TD><TD style=\"text-align: right;\">{$estimated_change_print}</TD><TD style=\"text-align: right; font-size: 80%;\">{$percent_pps_estimate_change_print}</TD></TR>";
print "<TR class=\"userstatsodd\"><TD>Estimated Total: </TD><TD style=\"text-align: right;\">{$estimated_balance_print}</TD><TD style=\"text-align: right; font-size: 80%;\">{$percent_pps_estimate_print}</TD></TR>";
print "</TABLE>";
$query_hash = hash("sha256", "userstats.php hashrate table for {$givenuser} with id {$user_id}");
$hashratetable = get_stats_cache($link, 11, $query_hash);
if ($hashratetable != "") {
Exemplo n.º 24
0
 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . '后台调整');
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success('操作成功!');
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title("用户扩展资料详情");
         $builder->meta_title = '用户扩展资料详情';
         $builder->keyId()->keyReadOnly('username', "用户名称")->keyReadOnly('nickname', '昵称');
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', '无分组身份', '可以多选', $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
         $role_group = D('RoleGroup')->select();
         foreach ($role_group as $group) {
             $group_role = $roleModel->where(array('group_id' => $group['id'], 'status' => 1))->select();
             if (count($group_role)) {
                 $role_key[] = 'role' . $group['id'];
                 $group_role_options = $already_group_role = array();
                 foreach ($group_role as $val) {
                     if (in_array($val['id'], $already_role)) {
                         $already_group_role = $val['id'];
                     }
                     $group_role_options[$val['id']] = $val['title'];
                 }
                 $builder->keyRadio('role' . $group['id'], '分组[' . $group['title'] . ']身份', '同一分组下用户最多只能拥有其中一个身份', $group_role_options)->keyDefault('role' . $group['id'], $already_group_role);
             }
         }
         /*身份设置 end*/
         $builder->group('基本设置', implode(',', $field_key));
         $builder->group('积分设置', implode(',', $score_key));
         $builder->group('身份设置', implode(',', $role_key));
         $builder->buttonSubmit('', '保存');
         $builder->buttonBack();
         $builder->display();
     }
 }
Exemplo n.º 25
0
 public function addcart()
 {
     if (!is_login()) {
         $this->ajaxErr(-1, '请登录后再操作!');
     }
     $id = I('tid', -1, '/^\\d+$/');
     if ($id <= 0) {
         $this->ajaxErr(10031, 'id error');
     }
     $topic = M('Topic')->where('id=' . $id . ' AND status<>' . C('ITEM_STATUS.DELETED'))->find();
     if (!$topic) {
         $this->ajaxErr(-20, '主题不存在或主题已删除!');
     }
     $dat['topic_id'] = $id;
     $dat['author_id'] = $topic['author_id'];
     $dat['author_nick'] = get_nickname($topic['author_id']);
     $dat['title'] = $topic['title'];
     $dat['thumb'] = $topic['thumb'];
     $dat['gold_price'] = $topic['gold_price'];
     $dat['user_id'] = session('user_auth.uid');
     $dat['add_time'] = time();
     if (intval(M('Cart')->where('user_id = ' . session('user_auth.uid') . ' AND topic_id=' . $id)->count()) > 0) {
         $this->ajaxErr(-10, '已经在购物车内');
     }
     if (M('Cart')->add($dat)) {
         session('cart_cnt', M('Cart')->where('user_id = ' . session('user_auth.uid'))->count());
         $this->ajaxSucc(array("count" => session('cart_cnt')));
     }
     $this->ajaxErr(-1, '加入购物车失败');
 }
 function PublicAdmin()
 {
     $page = I('p', 1, 'intval');
     $addon_list = D('Home/Addons')->getWeixinList(true);
     foreach ($addon_list as $v) {
         $all_ids[] = $v['id'];
         $nameArr[$v['id']] = $v['title'];
     }
     $public_list = M('member_public')->field('group_id,count(id) as public_count')->group('group_id')->select();
     foreach ($public_list as $p) {
         $public_count[$p['group_id']] = $p['public_count'];
     }
     // 获取模型信息
     $model = M('Model')->getByName('member_public');
     $list_data = $this->_get_model_list($model, $page);
     $ids = getSubByKey($list_data['list_data'], 'id');
     if ($ids) {
         $map['mp_id'] = array('in', $ids);
         $link = M('member_public_link')->where($map)->select();
         foreach ($link as $k) {
             $admin[$k['mp_id']][] = get_nickname($k['uid']);
         }
     }
     foreach ($list_data['list_data'] as &$vo) {
         if (!empty($vo['headface_url'])) {
             $vo['headface_url'] = '<img src="' . get_cover_url($vo['headface_url']) . '" width="50" height="50" />';
         }
         $vo['uid'] = implode(' , ', $admin[$vo['id']]);
     }
     $href = 'editPublicAdmin?id=[id]|编辑,delPublicAdmin?id=[id]|删除,PublicLink?id=[id]|管理员配置';
     foreach ($list_data['list_grids'] as $k => &$g) {
         if ($g['title'] == '操作') {
             $g['href'] = $href;
         }
         if ($g['title'] == '当前公众号') {
             unset($list_data['list_grids'][$k]);
         }
     }
     $this->assign($list_data);
     $this->assign('model', $model);
     $this->meta_title = $model['title'] . '管理';
     $this->assign('add_url', U('Home/MemberPublic/add'));
     $this->display('Think:lists');
 }
 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . L('_BACKGROUND_ADJUSTMENT_'));
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success(L('_SUCCESS_OPERATE_') . L('_EXCLAMATION_'));
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title(L('_USER_EXPAND_INFO_DETAIL_'));
         $builder->meta_title = L('_USER_EXPAND_INFO_DETAIL_');
         $builder->keyId()->keyReadOnly('username', L('_USER_NAME_'))->keyReadOnly('nickname', L('_NICKNAME_'));
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', L('_ROLE_GROUP_NONE_'), L('_MULTI_OPTIONS_'), $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
         $role_group = D('RoleGroup')->select();
         foreach ($role_group as $group) {
             $group_role = $roleModel->where(array('group_id' => $group['id'], 'status' => 1))->select();
             if (count($group_role)) {
                 $role_key[] = 'role' . $group['id'];
                 $group_role_options = $already_group_role = array();
                 foreach ($group_role as $val) {
                     if (in_array($val['id'], $already_role)) {
                         $already_group_role = $val['id'];
                     }
                     $group_role_options[$val['id']] = $val['title'];
                 }
                 $myJs = "\$('.group_list').last().children().last().append('<a class=\"btn btn-default\" id=\"checkFalse\">" . L('_SELECTION_CANCEL_') . "</a>');";
                 $myJs = $myJs . "\$('#checkFalse').click(";
                 $myJs = $myJs . "function(){ \$('input[type=\"radio\"]').attr(\"checked\",false)}";
                 $myJs = $myJs . ");";
                 $builder->keyRadio('role' . $group['id'], L('_ROLE_GROUP_', array('title' => $group['title'])), L('_ROLE_GROUP_VICE_'), $group_role_options)->keyDefault('role' . $group['id'], $already_group_role)->addCustomJs($myJs);
             }
         }
         /*身份设置 end*/
         $builder->group(L('_BASIC_SETTINGS_'), implode(',', $field_key));
         $builder->group(L('_SETTINGS_SCORE_'), implode(',', $score_key));
         $builder->group(L('_SETTINGS_ROLE_'), implode(',', $role_key));
         $builder->buttonSubmit('', L('_SAVE_'));
         $builder->buttonBack();
         $builder->display();
     }
 }
        $i = 0;
        $__LIST__ = $new_prizes;
        if (count($__LIST__) == 0) {
            echo "";
        } else {
            foreach ($__LIST__ as $key => $vo) {
                $mod = $i % 2;
                ++$i;
                ?>
<li>
                    <span class="col_1"><?php 
                echo time_format($vo["cTime"]);
                ?>
</span>
                    <span class="col_2"><?php 
                echo get_nickname($vo["uid"]);
                ?>
</span>
                    <span class="col_3"><?php 
                echo $vo["prize_title"];
                ?>
</span>
                </li><?php 
            }
        }
    } else {
        echo "";
    }
    ?>
             </ul><?php 
}
 /**
  * 回收站列表
  * @author huajie <*****@*****.**>
  */
 public function recycle()
 {
     //获取左边菜单
     $this->getMenu();
     $map['status'] = -1;
     if (!IS_ROOT) {
         $cate_auth = AuthGroupModel::getAuthCategories(UID);
         if ($cate_auth) {
             $map['category_id'] = array('IN', $cate_auth);
         } else {
             $map['category_id'] = -1;
         }
     }
     $list = $this->lists(D('Document'), $map, 'update_time desc');
     //处理列表数据
     if (is_array($list)) {
         foreach ($list as $k => &$v) {
             $v['username'] = get_nickname($v['uid']);
         }
     }
     $this->assign('list', $list);
     $this->meta_title = '回收站';
     $this->display();
 }
Exemplo n.º 30
0
 /**
  * 增加专辑评论
  */
 public function doAddComment()
 {
     if (!is_login()) {
         $this->error('请您先进行登录', U('Mob/member/index'), 1);
     }
     $aContent = I('post.content', '', 'op_t');
     //获取评论内容
     $aIssueId = I('post.issueId', 0, 'intval');
     //获取当前专辑ID
     $aUid = I('post.uid', 0, 'intval');
     if (empty($aContent)) {
         $this->error('评论内容不能为空');
     }
     $uid = is_login();
     $result = D('LocalComment')->addIssueComment($uid, $aIssueId, $aContent);
     $title = get_nickname(is_login()) . '评论了您';
     D('Common/Message')->sendMessage($aUid, $title, "评论内容:{$aContent}", 'Issue/Index/IssueContentDetail', array('id' => $aIssueId), is_login(), 0);
     action_log('add_issue_comment', 'local_comment', $result, $uid);
     $map['id'] = array('eq', $result);
     $issuecomment = D('Local_comment')->where(array('status' => 1, $map))->order('create_time desc')->select();
     foreach ($issuecomment as &$v) {
         $v['user'] = query_user(array('nickname', 'avatar32', 'uid'), $v['uid']);
         $v['cover_url'] = getThumbImageById($v['cover_id']);
         $v['content'] = parse_weibo_mobile_content($v['content']);
     }
     if ($issuecomment) {
         $data['html'] = "";
         foreach ($issuecomment as $val) {
             $this->assign("vo", $val);
             $data['html'] .= $this->fetch("_issuecomment");
             $data['status'] = 1;
         }
     } else {
         $data['stutus'] = 0;
     }
     $this->ajaxReturn($data);
 }