当前位置: 首页>>代码示例>>PHP>>正文


PHP get_mid函数代码示例

本文整理汇总了PHP中get_mid函数的典型用法代码示例。如果您正苦于以下问题:PHP get_mid函数的具体用法?PHP get_mid怎么用?PHP get_mid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_mid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 function getList($sportsId, $update = false)
 {
     $key = 'LotteryPrizeList_getList_' . $sportsId;
     $info = S($key);
     if ($info === false || $update) {
         $map['sports_id'] = $sportsId;
         $map['uid'] = session('manager_id');
         if (empty($map['uid'])) {
             $map['uid'] = get_mid();
         }
         $info = (array) $this->where($map)->select();
         $awardDao = D('Addons://Draw/Award');
         if (count($info) != 0) {
             foreach ($info as &$v) {
                 $award = $awardDao->getInfo($v['award_id']);
                 $v['awardarr'] = $award;
                 $v['award_name'] = $award['name'];
                 $v['award_pic'] = get_cover_url($award['img']);
             }
         }
         //             $info['awardarr']=M('Award')->getInfo($info['sports_id']);
         //             $info['sports']=M('Addons://Sports/Sports')->getInfo($info['sports_id']);
         S($key, $info, 86400);
     }
     return $info;
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:26,代码来源:LotteryPrizeListModel.class.php

示例2: updateCount

 function updateCount($sports_id, $follow_id, $count)
 {
     $count++;
     $map['sports_id'] = $sports_id;
     $map['follow_id'] = $follow_id;
     $map['uid'] = session('manager_id');
     if (empty($map['uid'])) {
         $map['uid'] = get_mid();
     }
     $res = $this->where($map)->setField('count', $count);
     if ($res) {
         $this->hasDraw($sports_id, $follow_id, true);
     }
     return $res;
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:15,代码来源:DrawFollowLogModel.class.php

示例3: showComment

 function showComment()
 {
     $map['id'] = I('id');
     if (IS_POST) {
         $param['id'] = $data['loveId'] = I('loveId');
         $data['content'] = I('content');
         $data['cTime'] = time();
         $data['token'] = get_token();
         $data['openid'] = get_mid();
         $res = M('love_comment')->add($data);
         $jump_url = addons_url('Love://Love/showComment', $param);
         redirect($jump_url);
     }
     $comment_map['loveId'] = I('id');
     $comment_info = M('love_comment')->where($comment_map)->order('id desc')->select();
     $this->assign('comment_info', $comment_info);
     $info = M('love')->where($map)->find();
     //		$this->assign('oo',I('id').'kk');
     $this->assign('info', $info);
     $this->display();
 }
开发者ID:Rayuu,项目名称:weiphp,代码行数:21,代码来源:LoveController.class.php

示例4: card_show

 function card_show()
 {
     $model = $this->getModel('wish_card');
     $Model = D(parse_name(get_table_name($model['id']), 1));
     if (IS_POST) {
         //保存贺卡
         $write_info = session('write_info');
         $post_data = array_merge($write_info, $_POST);
         $post_data['mid'] = get_mid();
         $post_data['token'] = get_token();
         $post_data['create_time'] = time();
         if ($id = $Model->add($post_data)) {
             $data = $post_data;
             $isMake = 1;
         }
     } else {
         $id = I('id');
         $data = $Model->find($id);
         $Model->where('id=' . $id)->setInc('read_count', 1);
         //统计浏览数加1
         $isMake = 0;
     }
     if ($data) {
         $sendUser = get_followinfo($data['mid']);
         $this->assign('sendUser', $sendUser);
         $this->assign('data', $data);
         $shareUrl = addons_url('WishCard://Wap/card_show', array('id' => $id));
         $makeUrl = addons_url('WishCard://Wap/card_type');
         $this->assign('shareUrl', $shareUrl);
         $this->assign('makeUrl', $makeUrl);
         $this->assign('isMake', $isMake);
         //是否制作的
         //dump($shareUrl);
         $template = ONETHINK_ADDON_PATH . 'WishCard/View/default/Template/' . $data['template_cate'] . '/' . $data['template'] . '/index.html';
         $this->assign("assetsPath", SITE_URL . '/Addons/WishCard/View/default/Template/' . $data['template_cate'] . '/' . $data['template']);
         $this->display($template);
     } else {
         $this->error("没有该模板或模板保存不成功!");
     }
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:40,代码来源:WapController.class.php

示例5: getList

 /**
  * 获取插件配置
  * 获取的优先级:当前用户插件权限》当前公众号设置》后台默认配置》安装文件上的配置
  */
 function getList($is_admin = false)
 {
     // 当前公众号的设置
     $map['token'] = get_token();
     if (empty($map['token'])) {
         return array();
     }
     $info = get_token_appinfo($map['token']);
     $token_status = json_decode($info['addon_status'], true);
     // 等级权限
     if ($info['group_id']) {
         $map2['id'] = $info['group_id'];
         $addon_ids = M('public_group')->where($map2)->getField('addon_status');
         if ($addon_ids) {
             $map3['id'] = array('in', $addon_ids);
             $addons = M('addons')->where($map3)->field('`name`')->select();
             foreach ($addons as $a) {
                 $token_status[$a['name']] = '-1';
             }
         }
     }
     // 对当前用户的权限进行判断
     if ($is_admin) {
         unset($map);
         $map['uid'] = get_mid();
         $map['mp_id'] = $info['id'];
         $addon_ids = M('public_link')->where($map)->getField('addon_status');
         if ($addon_ids) {
             $map3['id'] = array('in', $addon_ids);
             $addons = M('addons')->where($map3)->field('`name`')->select();
             foreach ($addons as $a) {
                 $token_status[$a['name']] = '-1';
             }
         }
     }
     // dump ( $token_status );
     // dump(M ( 'public' )->getLastSql());exit;
     return $token_status;
 }
开发者ID:chenpusn,项目名称:guoxian,代码行数:43,代码来源:AddonStatusModel.class.php

示例6: strlen

    $longlen = strlen($longint);
    echo $longint . "\n";
    for ($i = $longlen - 7; $i > -7; $i -= 7) {
        $offset1 = $i < 0 ? 0 : $i;
        $sublen = $i > 0 ? 7 : $i + 7;
        $subint = substr($longint, $offset1, $sublen);
        $substr = ten2base62($subint) . $substr;
    }
    return $substr;
}
$num = '218340105584896';
$num = '52036560683837093888';
$num = '3226266762397899821056';
$num = 2.000285392686698E+23;
$num = 620000000000000006;
$num = 839299365868340227;
$num = 221110410216147026;
$num = 3482583008837912;
// yyEmoB58Y
$num = 3482583008708876;
// yyEmoAxzK
$num = 3482583004642731;
// yyEmojtML
$num = 3486096061137924;
// yA7KC4M1C
$num = 5612814510546515491;
//  eBi65u6rkYz
//$num = 56800235589;
//$base62 =  ten2base62($num);
$base62 = get_mid($num);
echo $base62 . "\n";
开发者ID:mafergomez70,项目名称:micro-power,代码行数:31,代码来源:change_base.php

示例7: get_package_template

 function get_package_template()
 {
     $addons = I('addons');
     /*
      * $dir = ONETHINK_ADDON_PATH . $addons . '/View/default/Package';
      * $url = SITE_URL . '/Addons/' . $addons . '/View/default/Package';
      *
      * $dirObj = opendir ( $dir );
      * while ( $file = readdir ( $dirObj ) ) {
      * if ($file === '.' || $file == '..' || $file == '.svn' || is_file ( $dir . '/' . $file ))
      * continue;
      *
      * $res ['dirName'] = $res ['title'] = $file;
      *
      * // 获取配置文件
      * if (file_exists ( $dir . '/' . $file . '/info.php' )) {
      * $info = require_once $dir . '/' . $file . '/info.php';
      * $res = array_merge ( $res, $info );
      * }
      *
      * // 获取效果图
      * if (file_exists ( $dir . '/' . $file . '/info.php' )) {
      * $res ['icon'] = __ROOT__ . '/Addons/'.$addons.'/View/default/Package/' . $file . '/icon.png';
      * } else {
      * $res ['icon'] = __IMG__ . '/default.png';
      * }
      *
      * $tempList [] = $res;
      * unset ( $res );
      * }
      * closedir ( $dir );
      */
     $map['uid'] = get_mid();
     $map['addons'] = $addons;
     $Model = D('SucaiTemplate');
     $tempList = $Model->where($map)->select();
     // dump($tempList);
     if (!$tempList) {
         $default['addons'] = $addons;
         $default['template'] = 'default';
         $tempList[] = $default;
     } else {
         $hasDefault = false;
         foreach ($tempList as $vo) {
             if ($vo['template'] == 'default') {
                 $hasDefault = true;
                 break;
             }
         }
         if ($hasDefault == false) {
             $default['addons'] = $addons;
             $default['template'] = 'default';
             $tempList[] = $default;
         }
     }
     // dump($tempList);
     foreach ($tempList as &$vo) {
         $info = $this->_readSucaiTemplateInfo($vo['addons'], $vo['template']);
         // dump($info);
         $vo['title'] = $info['title'];
         $vo['icon'] = $info['icon'];
     }
     // dump($tempList);
     $this->ajaxReturn($tempList, 'JSON');
 }
开发者ID:chenpusn,项目名称:haozhixian,代码行数:65,代码来源:AddonsController.class.php

示例8: getSnCount

 function getSnCount($type = '')
 {
     $count = 0;
     $mid = get_mid();
     $list = $this->getMyAll($mid, 'ShopCoupon');
     foreach ($list as $k => &$v) {
         $coupon = (array) D('Addons://ShopCoupon/Coupon')->getInfo($v['target_id']);
         if ($coupon) {
             $v['sn_id'] = $v['id'];
             $v = array_merge($v, $coupon);
             if ($type != '') {
                 if ($coupon['type'] == $type) {
                     $count++;
                 }
             } else {
                 $count++;
             }
         } else {
             unset($list[$k]);
         }
     }
     return $count;
 }
开发者ID:yxz1025,项目名称:weiphp3.0,代码行数:23,代码来源:SnCodeModel.class.php

示例9: _getGuessInfo

 function _getGuessInfo($id)
 {
     // 检查ID是否合法
     if (empty($id) || 0 == $id) {
         $this->error("错误的竞猜ID");
     }
     // $map ['id'] = $map2 ['guess_id'] = $map3['guess_id'] = intval ( $id );
     $guess_id = intval($id);
     $follow_id = get_mid();
     // $info = M ( 'guess' )->where ( $map )->find ();
     $info = D('Guess')->getInfo($guess_id);
     $this->assign('info', $info);
     // dump($info);
     // $opts = M ( 'guess_option' )->where ( $map2 )->order ( '`order` asc' )->select ();
     $opts = D('GuessOption')->getGuessOption($guess_id);
     foreach ($opts as $p) {
         $total += $p['guess_count'];
     }
     foreach ($opts as &$vo) {
         $vo['percent'] = round($vo['guess_count'] * 100 / $total, 1);
     }
     $this->assign('opts', $opts);
     $this->assign('num_total', $total);
     // $voteInfo = M ( 'guess_log' )->where ( $map3 )->select ();
     $voteInfo = D('GuessLog')->getFollowLog($follow_id, $guess_id);
     // dump($voteInfo);
     // exit;
     if ($voteInfo) {
         $joinData = explode(',', $voteInfo[0]['optionids']);
         $this->assign('joinData', $joinData);
         // dump($joinData);
         // exit;
     }
     return $info;
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:35,代码来源:GuessController.class.php

示例10: explode

     $kategorie = $url_subdir_entry;
 } else {
     $menu = explode("_", str_replace(".odt", "", $file), 3);
     $ebene = "/" . substr(rawurlencode($url_subdir_entry), 0, $len_max["site_menu"]["entry"]);
     $kategorie = "";
     foreach ($menu as $key => $part) {
         if ($kategorie != "") {
             $ebene .= "/" . $kategorie;
         }
         $kategorie = substr(rawurlencode($part), 0, $len_max["site_menu"]["entry"]);
         $index_child = $key + 2;
         $var_child = "refid_" . $index_child;
         $index_parent = $key + 1;
         $var_parent = "refid_" . $index_parent;
         // $ausgaben["output"] .= $ebene."/".$kategorie.": ".$menu_csv[$ebene."/".$kategorie]."<br>";
         ${$var_child} = get_mid($kategorie, ${$var_parent}, $menu_csv[$ebene . "/" . $kategorie]);
     }
 }
 //  3.1 odt auspacken
 $zip = new ZipArchive();
 if ($zip->open($cfg["migrate"]["path"] . $subdir_entry . "/txt/" . $file) == TRUE) {
     $content = $zip->getFromName('content.xml');
     if ($cfg["migrate"]["utf-8"] == False) {
         $content = utf8_decode($content);
     }
     $style = $zip->getFromName('styles.xml');
 }
 // 3.2 ggf weitere tags aus dem odt-header holen
 preg_match_all("/(\\<style:style )(.*)(>)/" . $preg_mod, $content, $match);
 foreach ($match[0] as $key => $value) {
     preg_match("/style:parent-style-name=\"(.*)\"/" . $preg_mod, $value, $parent);
开发者ID:BackupTheBerlios,项目名称:ewebuki-bvv-svn,代码行数:31,代码来源:migrate.inc.php

示例11: get_addon_jump_url

 function get_addon_jump_url()
 {
     $addonName = I('addon_name');
     $id = I('id');
     $jumpType = I('jump_type');
     $public_info = get_token_appinfo();
     $url = '';
     switch ($addonName) {
         case 'Shop':
             // 获取当前登录的用户的商城
             // 获取当前登录的用户的商城
             $map['token'] = get_token();
             $map['manager_id'] = $this->mid;
             $currentShopInfo = M('shop')->where($map)->find();
             $id = $currentShopInfo['id'];
             $url = addons_url('Shop://Wap/index', array('shop_id' => $id, 'publicid' => $public_info['id'], 'uid' => get_mid()));
             break;
         case 'Coupon':
             if ($jumpType == 0) {
                 $url = addons_url('Coupon://Wap/lists', array('publicid' => $public_info['id'], 'id' => $id));
             } else {
                 $url = addons_url('Coupon://Wap/lists', array('publicid' => $public_info['id']));
             }
             break;
         case 'WishCard':
             $url = addons_url('WishCard://Wap/card_type', array('publicid' => $public_info['id']));
             break;
         case 'CardVouchers':
             $url = addons_url('CardVouchers://Wap/index', array('publicid' => $public_info['id'], 'id' => $id));
             break;
         case 'RedBag':
             $url = addons_url('RedBag://Wap/index', array('publicid' => $public_info['id'], 'id' => $id));
             break;
         case 'Invite':
             $url = addons_url('Invite://Wap/index', array('publicid' => $public_info['id'], 'id' => $id));
             break;
         default:
             $param_name = 'id';
             if (!$url) {
                 $param['publicid'] = $public_info['id'];
                 $param[$param_name] = $id;
                 $url = addons_url("{$addonName}://{$addonName}/index", $param);
             }
             break;
     }
     echo $url;
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:47,代码来源:CustomMenuController.class.php

示例12: _replyData

 function _replyData($uid, $param, $msg_type)
 {
     $map['token'] = get_token();
     $map['uid'] = $uid;
     $param['touser'] = M('public_follow')->where($map)->getField('openid');
     $param['msgtype'] = $msg_type;
     $url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' . get_access_token();
     // dump($param);
     // die;
     $result['status'] = 0;
     $result['msg'] = '回复失败';
     $res = post_data($url, $param);
     if ($res['errcode'] != 0) {
         $result['msg'] = error_msg($res);
     } else {
         $data['ToUserName'] = get_token();
         $data['FromUserName'] = $param['touser'];
         $data['CreateTime'] = NOW_TIME;
         $data['Content'] = isset($param['text']['content']) ? $param['text']['content'] : json_encode($param);
         $data['MsgId'] = get_mid();
         // 该字段保存管理员ID
         $data['type'] = 1;
         $data['is_read'] = 1;
         M('weixin_message')->add($data);
         $result['status'] = 1;
         $result['msg'] = '回复成功';
     }
     return $result;
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:29,代码来源:CustomModel.class.php

示例13: my

 public function my()
 {
     // 输出用户基本信息
     $followInfo = M('follow')->where(array('token' => get_token(), 'openid' => get_openid()))->find();
     //var_dump($followInfo);
     if (!$followInfo['headimgurl']) {
         $followInfo['headimgurl'] = 'http://idouly.com/wechat/Uploads/Headimgs/oOWE4tzFL9UjMBTiV2Wgmbaon390/1436673771.png';
     }
     if (!$followInfo['nickname']) {
         $followInfo['nickname'] = '未填写昵称';
     }
     $followInfo['uid'] = get_mid();
     $this->assign('followInfo', $followInfo);
     // 输出用户积分记录
     $creditData = M('credit_data')->where(array('token' => get_token(), 'uid' => get_mid()))->select();
     foreach ($creditData as $k => &$v) {
         $v['title'] = M('credit_config')->where(array('name' => $v['credit_name']))->getField('title');
     }
     $this->assign('creditData', $creditData);
     $this->display('userCenter');
 }
开发者ID:Rayuu,项目名称:weiphp,代码行数:21,代码来源:UserCenterController.class.php

示例14: getLzwgUserAllPrizeData

 function getLzwgUserAllPrizeData($follow_id, $update = false)
 {
     $key = 'LuckyFollow_getLzwgUserAllPrizeData_' . $follow_id;
     $info = S($key);
     if ($info === false || $update) {
         $map['follow_id'] = $follow_id;
         $map['uid'] = session('manager_id');
         if (empty($map['uid'])) {
             $map['uid'] = get_mid();
         }
         $info = M('lucky_follow')->where($map)->field('award_id,state,zjtime')->order('zjtime desc')->select();
         $awardDao = D('Addons://Draw/Award');
         foreach ($info as &$i) {
             $award = $awardDao->getInfo($i['award_id']);
             $i = array_merge($i, $award);
         }
     }
     S($key, $info, 86400);
     return $info;
 }
开发者ID:yxz1025,项目名称:weiphp3.0,代码行数:20,代码来源:LuckyFollowModel.class.php

示例15: add

 public function add()
 {
     $this->assign('normal_tips', '请不设置相同的关键词,相同的关键词只回复最新的设置');
     $replyInfo = M('auto_reply')->where(array('id' => I('id')))->find();
     $this->assign('data', $replyInfo);
     $model = $this->getModel('AutoReply');
     if (IS_POST) {
         if ($_POST['reply_scene'] == 2 && $_POST['keyword'] == '') {
             $this->error('请填写关键词');
         }
         // dump($_POST);die;
         if (I('video_id')) {
             $data['msg_type'] = 'video';
         }
         if (I('voice_id')) {
             $data['msg_type'] = 'voice';
         }
         if (I('image_material') || I('image')) {
             $data['msg_type'] = 'image';
         }
         if (I('appmsg_id')) {
             $data['msg_type'] = 'news';
         }
         if (I('content')) {
             $data['msg_type'] = 'text';
         }
         $data['keyword'] = I('keyword');
         $data['reply_scene'] = I('reply_scene');
         $data['content'] = I('content');
         $data['group_id'] = intval(I('appmsg_id'));
         $data['image_id'] = intval(I('image'));
         $data['voice_id'] = intval(I('voice_id'));
         $data['video_id'] = intval(I('video_id'));
         $data['manage_id'] = intval(get_mid());
         $data['token'] = get_token();
         $data['image_material'] = intval(I('image_material'));
         // dump($data);die;
         $Model = D(parse_name(get_table_name($model['id']), 1));
         // 获取模型的字段信息
         if ($_POST['reply_scene'] == 2) {
             $Model = $this->checkAttr($Model, $model['id']);
         }
         if ($Model->create()) {
             if (I('reply_scene') == 0) {
                 $url = U('subscribe');
             } elseif (I('reply_scene') == 1) {
                 $url = U('message');
             } else {
                 $url = U('lists');
             }
             if (I('id')) {
                 // 更新
                 $result = M('auto_reply')->where(array('id' => I('id')))->save($data);
                 if ($result || $result === 0) {
                     $this->success('更新' . $model['title'] . '成功!', $url);
                 }
             } else {
                 // 新增
                 $id = $Model->add($data);
                 $this->_saveKeyword($model, $id);
                 $this->success('添加' . $model['title'] . '成功!', $url);
             }
         } else {
             $this->error($Model->getError());
         }
     } else {
         $fields = get_model_attribute($model['id']);
         $fields = $this->_deal_fields($fields, $type);
         $this->assign('fields', $fields);
         $postUrl = U('add', array('model' => $model['id']));
         $this->assign('post_url', $postUrl);
         $this->assign('reply_scene', 2);
         // 回复场景:关键词回复
         $this->display('reply');
     }
 }
开发者ID:LukeChow1018,项目名称:weixin,代码行数:76,代码来源:AutoReplyController.class.php


注:本文中的get_mid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。