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


PHP user::get_instance方法代码示例

本文整理汇总了PHP中user::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP user::get_instance方法的具体用法?PHP user::get_instance怎么用?PHP user::get_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在user的用法示例。


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

示例1: index

 public function index()
 {
     role::check('user_charge_orders');
     /* 初始化默认查询条件 */
     $user_query_struct = array('where' => array(), 'like' => array(), 'orderby' => array('id' => "DESC"), 'limit' => array('per_page' => 20, 'offset' => 0));
     /* 用户列表模板 */
     $this->template->content = new View("user/user_charge_orders");
     /* 搜索功能 */
     $search_arr = array('order_num');
     $search_value = $this->input->get('search_value');
     $where_view = array();
     $user_query_struct['like']['order_num'] = $search_value;
     //$user_query_struct['like']['ret_order_num'] = $search_value;
     $where_view['search_value'] = $search_value;
     /* 每页显示条数 */
     $per_page = controller_tool::per_page();
     $user_query_struct['limit']['per_page'] = $per_page;
     /* 调用分页 */
     $this->pagination = new Pagination(array('total_items' => User_chargeService::get_instance()->query_count($user_query_struct), 'items_per_page' => $per_page));
     //d($this->pagination->sql_offset);
     $user_query_struct['limit']['offset'] = $this->pagination->sql_offset;
     $users = User_chargeService::get_instance()->lists($user_query_struct);
     $userobj = user::get_instance();
     foreach ($users as $key => $rowuser) {
         $users[$key]['userinfo'] = $userobj->get($rowuser['user_id']);
     }
     /* 调用列表 */
     $this->template->content->user_list = $users;
     $this->template->content->where = $where_view;
     $this->template->content->pay_banks = Kohana::config('pay_banks');
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:31,代码来源:user_charge_orders.php

示例2: add

 /**
  * 更新或添加信息
  *
  * @param  array $data 数据包
  * @return true or false
  */
 public function add($data)
 {
     $obj = ORM::factory('account_virtual_log');
     if (!$obj->validate($data)) {
         return FALSE;
     }
     !empty($data['order_num']) && ($obj->order_num = $data['order_num']);
     $obj->user_id = $data['user_id'];
     $obj->log_type = $data['log_type'];
     empty($data['is_in']) && ($data['is_in'] = 0);
     $obj->is_in = $data['is_in'];
     $obj->price = $data['price'];
     $obj->user_money = $data['user_money'];
     $obj->memo = $data['memo'];
     $obj->method = serialize(array('url' => 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER["REQUEST_URI"], 'method' => $_SERVER['REQUEST_METHOD']));
     $obj->ip = tool::get_str_ip();
     $obj->save();
     if ($obj->saved) {
         //更新用户表金额
         $userobj = user::get_instance();
         if ($data['is_in'] == 0) {
             $usermoney = $obj->user_money + $obj->price;
         } else {
             $usermoney = $obj->user_money - $obj->price;
         }
         $userobj->update_virtual_money($data['user_id'], $usermoney);
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:37,代码来源:account_virtual_log.php

示例3: check_status

 public function check_status($id = '')
 {
     //权限检查 得到所有可管理站点ID列表
     role::check('user_edit');
     if (!empty($id)) {
         $data['check_status'] = 2;
         if (Myuser::instance($id)->edit_handsel_users($id, $data)) {
             $user = user::get_instance();
             //彩金赠送开始
             $handsel = handsel::get_instance();
             $handsel_info = $handsel->get(1);
             //$data_money = array('free_money' => $handsel_info['total']);
             //$flag = $user->update_user_free_money($id,$data_money);
             //account_log::get_instance()->add($data_log);
             user_money::get_instance()->update_money(0, $id, $handsel_info['total'], 7, date('YmdHis') . rand(0, 99999), 'FREE_MONEY', '赠送彩金');
             //彩金赠送结束
             remind::set(Kohana::lang('o_global.update_success'), request::referrer(), 'success');
         } else {
             remind::set(Kohana::lang('o_global.update_error'), request::referrer(), 'error');
         }
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:22,代码来源:handsel.php

示例4: index

 /**
  * 订单列表
  */
 public function index($status = NULL)
 {
     $time_expired = 60 * 60 * 2;
     //将要过期时间
     $time_delay = 5 * 60;
     //过期延迟显示时间
     //$mklasttime = mktime(date("H"), date("i"), date("s"), date("m"), date("d")-5, date("Y"));
     //$last_time = date('Y-m-d H:i:s', $mklasttime);
     //初始化默认查询结构体
     $query_struct_default = array('where' => array(), 'orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => 10, 'page' => 1));
     if (!empty($status)) {
         switch ($status) {
             case 'hasbuy':
                 $query_struct_default['where']['status'] = 0;
                 break;
             case 'noprint':
                 $query_struct_default['where']['status'] = 1;
                 break;
             case 'beexpired':
                 $query_struct_default['where']['date_end <'] = date("Y-m-d H:i:s", time() + $time_expired);
                 //当离方案截止时间小于2小时时为将要到期
                 $query_struct_default['where']['date_end >'] = tool::get_date();
                 break;
             case 'hasexpired':
                 $query_struct_default['where']['date_end <'] = date("Y-m-d H:i:s", time() + $time_delay);
                 $query_struct_default['where']['status'] = array(0);
                 break;
             case 'hasprint':
                 $query_struct_default['where']['status'] = 2;
                 break;
             case 'nobonus':
                 $query_struct_default['where']['status'] = 3;
                 break;
             case 'hasbonus':
                 $query_struct_default['where']['status'] = 4;
                 break;
             case 'givehonus':
                 $query_struct_default['where']['status'] = 5;
                 break;
             case 'cancel':
                 $query_struct_default['where']['status'] = 6;
                 break;
             default:
         }
     }
     //d($query_struct_default);
     /* 搜索功能 */
     $search_arr = array('id', 'order_num', 'username');
     $search_value = $this->input->get('search_value');
     $search_type = $this->input->get('search_type');
     $where_view = array();
     //$query_struct_default['where']['date_end >='] = tool::get_date();
     if (strlen($this->input->get('start_time')) > 0) {
         $query_struct_default['where']['date_add >='] = $this->input->get('start_time') . ' 00:00:00';
         $where_view['start_time'] = $this->input->get('start_time');
     }
     if (strlen($this->input->get('end_time')) > 0) {
         $query_struct_default['where']['date_add <='] = $this->input->get('end_time') . ' 00:00:00';
         $where_view['end_time'] = $this->input->get('end_time');
     }
     if ($search_arr) {
         foreach ($search_arr as $value) {
             if ($search_type == $value && strlen($search_value) > 0) {
                 if ($value == 'lastname') {
                     $userobj = user::get_instance();
                     $userinfo = $userobj->get_search($search_value);
                     $userid = $userinfo['id'];
                     $query_struct_default['where']['start_user_id'] = $userid;
                     $query_struct_default['where']['user_id'] = $userid;
                 } else {
                     $query_struct_default['like'][$value] = $search_value;
                 }
             }
         }
         $where_view['search_type'] = $search_type;
         $where_view['search_value'] = $search_value;
     }
     $request_data = $this->input->get();
     //初始化当前查询结构体
     $query_struct_current = array();
     //设置合并默认查询条件到当前查询结构体
     $query_struct_current = array_merge($query_struct_current, $query_struct_default);
     //列表排序
     $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'));
     $orderby = controller_tool::orderby($orderby_arr);
     // 排序处理
     if (isset($request_data['orderby']) && is_numeric($request_data['orderby'])) {
         $query_struct_current['orderby'] = $orderby;
     }
     $query_struct_current['orderby'] = $orderby;
     //每页条目数
     controller_tool::request_per_page($query_struct_current, $request_data);
     //调用服务执行查询
     $return_data['count'] = $this->order_basic_obj->count($query_struct_current);
     //统计数量
     /* 调用分页 */
     $this->pagination = new Pagination(array('total_items' => $return_data['count'], 'items_per_page' => $query_struct_current['limit']['per_page']));
//.........这里部分代码省略.........
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:101,代码来源:order.php

示例5: dowithByLPid

 public function dowithByLPid($lotyid, $playid)
 {
     if (empty($lotyid) || empty($playid)) {
         $servers = $this->input->server('argv');
         $playid = $servers[3];
         $lotyid = $servers[2];
     }
     $databasic = array();
     $data = array();
     //得到玩法下的所有启用状态的自动跟单JOB
     $all_plan = $this->getAllPlan($lotyid, $playid);
     foreach ($all_plan as $aplanObj) {
         $aplan = $aplanObj->as_array();
         $auto_roder_jobs = $this->getAllJob($lotyid, $playid, $aplan['user_id']);
         foreach ($auto_roder_jobs as $aJobObj) {
             //处理该自动跟单
             $ajob = $aJobObj->as_array();
             $jobid = $ajob['id'];
             $uid = $ajob['uid'];
             $fuid = $ajob['fuid'];
             switch ($lotyid) {
                 case '1':
                     $pordernum = $aplan['basic_id'];
                     $this->plans_obj = $this->jczq_obj;
                     break;
                 case '2':
                     $pordernum = $aplan['basic_id'];
                     $this->plans_obj = $this->sfc_obj;
                     break;
                 case '6':
                     $pordernum = $aplan['basic_id'];
                     $this->plans_obj = $this->jclq_obj;
                     break;
                 case '7':
                     $pordernum = $aplan['basic_id'];
                     $this->plans_obj = $this->bjdc_obj;
                     break;
                 default:
                     $pordernum = $aplan['order_num'];
                     break;
             }
             $pid = $aplan['id'];
             $iscontinue = $this->log->where(array('pid' => $pid, 'uid' => $uid))->find()->as_array();
             if ($iscontinue['id']) {
                 continue;
             }
             //竞彩足球   其它彩种还要扩展这里
             $result = $this->plans_obj->get_by_order_id($pordernum);
             switch ($lotyid) {
                 case 2:
                     $result['surplus'] = $result['buyed'];
                     $result['buyed'] = $result['copies'] - $result['surplus'];
                     break;
             }
             $errcode = '200';
             //验证余额
             $userobj = user::get_instance();
             $usermoney = $userobj->get_user_money($uid);
             if ($usermoney < $ajob['money']) {
                 $errcode = '101';
                 //用户余额不足
             }
             //验证是否满员
             if ($result['surplus'] <= 0) {
                 $errcode = '102';
                 //'此方案已满员无法购买!';
             }
             //验证可认够的钱是否够
             if ($result['surplus'] * $result['price_one'] < $ajob['money']) {
                 $errcode = '103';
                 //方案可购金额小于你的订制金额
             }
             //方案是否限定范围
             if ($ajob['limitswitch']) {
                 if ($ajob['maximum'] < $result['total_price']) {
                     $errcode = '104';
                     //方案金额大于你的限定金额最大值
                 }
                 if ($ajob['minimum'] > $result['total_price']) {
                     $errcode = '105';
                     //方案金额小于你的限定金额的最小值
                 }
             }
             //检查方案日期是否结束
             if (strtotime($result['time_end']) < time()) {
                 $errcode = '106';
                 //'此方案已到期无法购买!';
             }
             //检查是否是合买对象
             if (!empty($result['friends']) && $result['friends'] != 'all') {
                 $errcode = '107';
                 //'此方案只有固定的彩友可以合买!';
             }
             $config = Kohana::config('database.default');
             extract($config['connection']);
             $mysqli = new mysqli($host, $user, $pass, $database, $port);
             if (mysqli_connect_errno()) {
                 echo '数据异常!';
             }
             $mysqli->query("SET NAMES 'utf8'");
//.........这里部分代码省略.........
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:101,代码来源:auto_order.php

示例6: minus_money

 public function minus_money($user_id, $money, $arrmoney, $logtype, $order_num = NULL, $memo = NULL)
 {
     $user_id = intval($user_id);
     $logtype = intval($logtype);
     //参数检测
     if ($user_id <= 0 || $logtype < 0 || $money < 0 || !is_array($arrmoney) || empty($arrmoney)) {
         return -1;
     }
     $testmoney = 0;
     foreach ($arrmoney as $row) {
         $testmoney += $row;
     }
     if ($money != $testmoney) {
         return -2;
     }
     //获取用户所有总资金
     $userobj = user::get_instance();
     $user_moneys = $userobj->get_user_moneys($user_id);
     $old_user_moneys = $user_moneys;
     //当出现异常
     if (empty($user_moneys)) {
         return -3;
     }
     $logobj = ORM::factory('account_log');
     $data = array();
     $data['order_num'] = $order_num;
     $data['log_type'] = $logtype;
     $data['user_id'] = $user_id;
     $data['price'] = $money;
     $data['user_money'] = $user_moneys['all_money'];
     $data['is_in'] = 1;
     $data['memo'] = $memo;
     $data['method'] = serialize(array('url' => 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER["REQUEST_URI"], 'method' => $_SERVER['REQUEST_METHOD']));
     $data['ip'] = tool::get_str_ip();
     //$data['user_money'] = $data['user_money'] - $money;
     if ($data['user_money'] < 0) {
         return -4;
     }
     if (!$logobj->validate($data, FALSE)) {
         return -5;
     }
     $logobj->save();
     if (!$logobj->saved) {
         return -6;
     }
     if (!empty($arrmoney['USER_MONEY'])) {
         $user_moneys['user_money'] = $user_moneys['user_money'] - $arrmoney['USER_MONEY'];
     }
     if (!empty($arrmoney['BONUS_MONEY'])) {
         $user_moneys['bonus_money'] = $user_moneys['bonus_money'] - $arrmoney['BONUS_MONEY'];
     }
     if (!empty($arrmoney['FREE_MONEY'])) {
         $user_moneys['free_money'] = $user_moneys['free_money'] - $arrmoney['FREE_MONEY'];
     }
     //更新会员资金
     if (!$userobj->update_moneys($user_id, $user_moneys)) {
         return -7;
     }
     //当资金记录有变化时则记录详细日志
     $this->add_detail_log($user_moneys, $old_user_moneys, $user_id, $logobj->id);
     return $money;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:62,代码来源:user_money.php

示例7: header

 *
 * @author Matt Beall
 * @since 0.0.1
 */
global $the_title;
$the_title = 'Profile';
include_once 'header.php';
$user_id = $_REQUEST['id'] ?: $_SESSION['user_id'];
if (!is_logged_in() || $_SESSION['user_level'] < 100 && $user_id !== $_REQUEST['id']) {
    if ($_REQUEST['subs']) {
        header("Location: ../../login.php?goto=.%2fuser%2f{$user_id}%2fsubs");
    } else {
        header("Location: ../login.php?goto=.%2fuser%2f{$user_id}");
    }
}
$user = user::get_instance($user_id);
?>
<style type="text/css">
  a.edit {
    float:right; margin-top: -3.5em
  }
</style>
<div class="content-area container" id="primary">
  <div class="row">
    <div class="site-content col-xs-12" id="content">
      <div class="row">
        <div class="col-xs-12 col-sm-12 hidden-md hidden-lg"></div>

        <article class="col-xs-12 post-1230 page type-page status-publish hentry" id="post-1230">
          <header class="entry-header">
            <h1 class="entry-title"><?php 
开发者ID:xornob,项目名称:fcc-signup,代码行数:31,代码来源:users.php

示例8: recharge_virtual_money

 /**
  * 虚拟充值
  * @param unknown_type $id
  */
 function recharge_virtual_money($id)
 {
     //权限检查 得到所有可管理站点ID列表
     role::check('user_recharge');
     if ($_POST) {
         //标签过滤
         tool::filter_strip_tags($_POST);
         $userobj = user::get_instance();
         $usermoney = $userobj->get_user_virtual_money($id);
         if ($_POST['money'] > 0) {
             $money_type_name = '竞波币';
             //记录日志
             $data_log = array();
             $data_log['order_num'] = date('YmdHis') . rand(0, 99999);
             $data_log['user_id'] = $id;
             $data_log['log_type'] = 6;
             //参照config acccount_type 设置
             $data_log['is_in'] = 0;
             $data_log['price'] = $_POST['money'];
             $data_log['user_money'] = $usermoney;
             $data_log['memo'] = $_POST['memo'];
             account_virtual_log::get_instance()->add($data_log);
             //$um = user_money::get_instance()->update_money($data_log['is_in'], $data_log['user_id'], $data_log['price'], $data_log['log_type'], $data_log['order_num'], $money_type, $data_log['memo']);
             //添加日志
             $logs_data = array();
             $logs_data['manager_id'] = $this->manager_id;
             $logs_data['user_log_type'] = 29;
             $logs_data['ip'] = tool::get_long_ip();
             $logs_data['memo'] = "成功为用户{$id}充值{$money_type_name}{$_POST['money']}";
             ulog::instance()->add($logs_data);
             remind::set($money_type_name . '充值成功', request::referrer(), 'success');
         }
     }
     $this->template->content = new View("user/user_recharge_virtual");
     $this->template->content->data = Myuser::instance($id)->get();
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:40,代码来源:user.php

示例9: chk

 public function chk($id)
 {
     if (empty($id)) {
         return false;
     }
     $where = array();
     $where['id'] = $id;
     $rpt = ORM::factory('ag_settle_month', $id);
     if ($rpt->loaded) {
         if ($rpt->flag != 2) {
             return 1;
         } else {
             if ($rpt->agent_type == 2) {
                 return 2;
             }
         }
         $userid = $rpt->user_id;
         $logtypexx = 9;
         $rpt->flag = 3;
         $rpt->date_add = date('Y-m-d H:i:s', time());
         $rpt->save();
         $userobj = user::get_instance();
         $usermoney = $userobj->get_user_money($userid);
         $money_type = 'BONUS_MONEY';
         $money_type_set = Kohana::config('money_type');
         if (array_key_exists($money_type, $money_type_set)) {
             $money_type_name = $money_type_set[$money_type];
             //记录日志
             $data_log = array();
             $data_log['order_num'] = 0;
             $data_log['user_id'] = $userid;
             $data_log['log_type'] = $logtypexx;
             //参照config acccount_type 设置
             $data_log['is_in'] = 0;
             $data_log['price'] = $rpt->bonus;
             $data_log['user_money'] = $usermoney;
             $data_log['memo'] = '月结返利';
             if ($rpt->bonus < 0) {
                 $data_log['price'] = $rpt->bonus * -1;
                 $data_log['is_in'] = 1;
                 if ($rpt->taxflag == 90) {
                     $data_log['memo'] = '月结扣税';
                 } else {
                     $data_log['memo'] = '其他';
                 }
             }
             $user_money = user_money::get_instance();
             $um = $user_money->update_money($data_log['is_in'], $data_log['user_id'], $data_log['price'], $data_log['log_type'], $data_log['order_num'], $money_type, $data_log['memo']);
             if (!$um) {
                 $rpt->flag = 91;
                 $rpt->date_add = date('Y-m-d H:i:s', time());
                 $rpt->save();
                 return 4;
             } else {
                 //添加日志
                 $logs_data = array();
                 $logs_data['manager_id'] = 0;
                 // $this->manager_id;
                 $logs_data['user_log_type'] = 29;
                 $logs_data['ip'] = tool::get_long_ip();
                 $logs_data['memo'] = "成功为代理商{$id}返利{$money_type_name}{$rpt->bonus}";
                 ulog::instance()->add($logs_data);
                 //					remind::set($money_type_name.'返利成功',request::referrer(),'success');
                 $rpt->flag = 4;
                 $rpt->date_add = date('Y-m-d H:i:s', time());
                 $rpt->save();
             }
         }
     } else {
         return 3;
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:72,代码来源:Mysettlemonthrpt.php

示例10: get_result


//.........这里部分代码省略.........
                 $result['plan_bonus'] = $result['detail']['bonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_jclq . $result['detail']['basic_id'];
                 if ($result['detail']['parent_id'] > 0) {
                     $result['parent'] = $this->get_result_jclq($result['detail']['parent_id'], FALSE);
                 }
             }
             break;
         case 7:
             $result['detail'] = $this->get_result_bjdc($result['order_num']);
             if (!empty($result['detail'])) {
                 $result['detail']['total_price'] = $result['detail']['total_price'];
                 //总价格
                 $result['plan_copies'] = $result['detail']['zhushu'];
                 //总份数
                 $result['plan_priceone'] = $result['detail']['price_one'];
                 //每份价格
                 $result['plan_buyed'] = $result['detail']['buyed'];
                 //已购买数量
                 $result['plan_bonus'] = $result['detail']['bonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_bjdc . $result['detail']['basic_id'];
                 if ($result['detail']['parent_id'] > 0) {
                     $result['parent'] = $this->get_result_bjdc($result['detail']['parent_id'], FALSE);
                 }
             }
             break;
         case 8:
             $result['detail'] = $this->get_result_dlt($result['order_num']);
             if (!empty($result['detail'])) {
                 //d($result,false);
                 $result['detail']['total_price'] = $result['detail']['total_price'];
                 //总价格
                 $result['plan_copies'] = $result['detail']['nums'];
                 //总份数
                 $result['plan_priceone'] = $result['detail']['onemoney'];
                 //每份价格
                 $result['plan_buyed'] = $result['detail']['rgnum'];
                 //已购买数量
                 $result['plan_bonus'] = $result['detail']['afterbonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_dlt . $result['detail']['id'];
             }
             break;
         case 9:
             $result['detail'] = $this->get_result_dlt($result['order_num']);
             if (!empty($result['detail'])) {
                 //d($result,false);
                 $result['detail']['total_price'] = $result['detail']['total_price'];
                 //总价格
                 $result['plan_copies'] = $result['detail']['nums'];
                 //总份数
                 $result['plan_priceone'] = $result['detail']['onemoney'];
                 //每份价格
                 $result['plan_buyed'] = $result['detail']['rgnum'];
                 //已购买数量
                 $result['plan_bonus'] = $result['detail']['afterbonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_plw . $result['detail']['id'];
             }
             break;
         case 10:
             $result['detail'] = $this->get_result_dlt($result['order_num']);
             if (!empty($result['detail'])) {
                 //d($result,false);
                 $result['detail']['total_price'] = $result['detail']['total_price'];
                 //总价格
                 $result['plan_copies'] = $result['detail']['nums'];
                 //总份数
                 $result['plan_priceone'] = $result['detail']['onemoney'];
                 //每份价格
                 $result['plan_buyed'] = $result['detail']['rgnum'];
                 //已购买数量
                 $result['plan_bonus'] = $result['detail']['afterbonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_qxc . $result['detail']['id'];
             }
             break;
         case 11:
             $result['detail'] = $this->get_result_dlt($result['order_num']);
             if (!empty($result['detail'])) {
                 //d($result,false);
                 $result['detail']['total_price'] = $result['detail']['total_price'];
                 //总价格
                 $result['plan_copies'] = $result['detail']['nums'];
                 //总份数
                 $result['plan_priceone'] = $result['detail']['onemoney'];
                 //每份价格
                 $result['plan_buyed'] = $result['detail']['rgnum'];
                 //已购买数量
                 $result['plan_bonus'] = $result['detail']['afterbonus'];
                 //奖金
                 $result['plan_detail'] = $this->detail_url_pls . $result['detail']['id'];
             }
             break;
         default:
             break;
     }
     $needuser && ($result['user'] = user::get_instance()->get($result['user_id']));
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:101,代码来源:plan.php

示例11:

    </div><!-- #masthead -->


    <div class="stripe">
      <div class="container">
        <p><?php 
echo $the_title;
?>
</p>
        <?php 
if (is_logged_in()) {
    ?>
        <div class="btn-group userdropdown">
        <?php 
    if ($the_title === 'Profile' && $_REQUEST['id'] != $_SESSION['user_id']) {
        $a = user::get_instance($_REQUEST['id']);
        ?>
          <div class="btn-group">
            <a href="<?php 
        echo SITE_URL . "user/{$a->user_id}";
        ?>
" class="btn btn-default"><i class="fa fa-users"></i> <?php 
        echo "{$a->user_name_first} {$a->user_name_last}";
        ?>
</a>
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              <i class="fa fa-cogs"></i>
              <span class="caret"></span>
              <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
开发者ID:xornob,项目名称:fcc-signup,代码行数:31,代码来源:header.php

示例12: set_bonus

 public function set_bonus($id, $page = 1)
 {
     /* 权限检查 订单列表 */
     role::check('order_list');
     if (empty($id)) {
         remind::set(Kohana::lang('o_global.bad_request'), 'order/ticketnum/');
     }
     $ticketobj = ticket::get_instance();
     $result = $ticketobj->get($id);
     if (empty($result)) {
         remind::set(Kohana::lang('o_global.bad_request'), 'order/ticketnum/');
     }
     //提交操作
     if (!empty($_POST)) {
         tool::filter_strip_tags($_POST);
         $bonus = $_POST['money'];
         $num = $_POST['num'];
         $password = $_POST['password'];
         $flag = $ticketobj->update_bonus($id, $bonus, $num, $password, $this->manager_id);
         $addchar = '成功';
         if (!$flag) {
             $addchar = '失败';
         }
         //添加日志
         $logs_data = array();
         $logs_data['manager_id'] = $this->manager_id;
         $logs_data['user_log_type'] = 28;
         $logs_data['ip'] = tool::get_long_ip();
         $logs_data['memo'] = "为id:{$result['id']}的彩票录入奖金:{$bonus}{$addchar}";
         ulog::instance()->add($logs_data);
         if ($flag) {
             remind::set("成功为id:{$result['id']}的彩票录入奖金:{$bonus}", '/order/ticketnum/index/hasticket/?page=' . $page, 'success');
         } else {
             remind::set("为id:{$result['id']}的彩票录入奖金:{$bonus}失败", '/order/ticketnum/?page=' . $page, 'error');
         }
     }
     if ($result['status'] != 1 && !($result['status'] == 2 && $result['bonus'] == -9999)) {
         remind::set(Kohana::lang('o_global.bad_request'), 'order/ticketnum/');
     }
     //获取更多信息
     $result['plan'] = plan::get_instance()->get_plan_by_tid($result['plan_id'], $result['ticket_type']);
     $result['user'] = user::get_instance()->get($result['plan']['user_id']);
     $result['manager'] = '';
     if (!empty($result['manager_id'])) {
         $manager = Mymanager::instance($result['manager_id'])->get();
         $result['manager'] = $manager['username'];
     }
     $this->template->content = new View("order/order_set_bonus", $result);
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:49,代码来源:detail.php

示例13: index

 /**
  * 订单列表
  */
 public function index($status = 'all')
 {
     /* 权限检查 订单列表 */
     role::check('user_draw_money_review');
     //初始化默认查询结构体
     $query_struct_default = array('orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => 10, 'page' => 1));
     switch ($status) {
         case 'review':
             role::check('user_draw_money_review');
             $query_struct_default['where']['status'] = 0;
             break;
         case 'hasreview':
             role::check('user_draw_money_review');
             $query_struct_default['where']['status'] = 1;
             break;
         case 'reviewfail':
             role::check('user_draw_money_input');
             $query_struct_default['where']['status'] = 2;
             break;
         case 'hascharge':
             role::check('user_draw_money_charge');
             $query_struct_default['where']['status'] = 3;
             break;
         case 'chargefail':
             $query_struct_default['where']['status'] = 4;
             break;
         case 'chargewin':
             $query_struct_default['where']['status'] = 5;
             break;
         default:
     }
     /* 搜索功能 */
     $search_arr = array('id', 'money', 'account', 'truename', 'bank_name', 'province', 'city', 'bank_found');
     $search_value = $this->input->get('search_value');
     $search_type = $this->input->get('search_type');
     $where_view = array();
     if ($search_arr) {
         foreach ($search_arr as $value) {
             if ($search_type == $value && strlen($search_value) > 0) {
                 $query_struct_default['like'][$value] = $search_value;
             }
         }
         $where_view['search_type'] = $search_type;
         $where_view['search_value'] = $search_value;
     }
     $request_data = $this->input->get();
     //初始化当前查询结构体
     $query_struct_current = array();
     //设置合并默认查询条件到当前查询结构体
     $query_struct_current = array_merge($query_struct_current, $query_struct_default);
     //列表排序
     $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'));
     $orderby = controller_tool::orderby($orderby_arr);
     // 排序处理
     if (isset($request_data['orderby']) && is_numeric($request_data['orderby'])) {
         $query_struct_current['orderby'] = $orderby;
     }
     $query_struct_current['orderby'] = $orderby;
     //每页条目数
     controller_tool::request_per_page($query_struct_current, $request_data);
     //调用服务执行查询
     $acobj = User_draw_moneyService::get_instance();
     $return_data['count'] = $acobj->count($query_struct_current);
     //统计数量
     /* 调用分页 */
     $this->pagination = new Pagination(array('total_items' => $return_data['count'], 'items_per_page' => $query_struct_current['limit']['per_page']));
     $query_struct_current['limit']['page'] = $this->pagination->current_page;
     $return_data['list'] = $acobj->query_assoc($query_struct_current);
     $return_data['account_type'] = Kohana::config('ticket_type');
     $i = 0;
     $managers = array();
     $users = array();
     foreach ($return_data['list'] as $rowlist) {
         $return_data['list'][$i] = $rowlist;
         $return_data['list'][$i]['other'] = json_decode($rowlist['other']);
         $users[$rowlist['user_id']] = $rowlist['user_id'];
         if (!empty($rowlist['manager_id'])) {
             $managers[$rowlist['manager_id']] = $rowlist['manager_id'];
         }
         $i++;
     }
     $userobj = user::get_instance();
     $return_data['users'] = array();
     $return_data['managers'] = array();
     foreach ($users as $rowuser) {
         $return_data['users'][$rowuser] = $userobj->get($rowuser);
     }
     foreach ($managers as $rowman) {
         $managers[$rowman] = Mymanager::instance($rowman)->get();
         if (!empty($managers[$rowman])) {
             $return_data['managers'][$rowman] = $managers[$rowman]['username'];
         }
     }
     $return_data['managers'] = $managers;
     $return_data['status'] = $status;
     $this->template->content = new View("order/user_draw_money", $return_data);
     $this->template->content->where = $where_view;
//.........这里部分代码省略.........
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:101,代码来源:user_draw_money.php

示例14:

            <h1 class="entry-title"></h1>


            <div class="entry-meta">
            </div>
            <!-- .entry-meta -->
          </header>
          <!-- .entry-header -->


          <div class="entry-content">
            <form action="./<?php 
        echo $_REQUEST['id'];
        ?>
" method="POST"> <?php 
        $u = user::get_instance(+$_REQUEST['id']);
        ?>
              <label>Email: </label> <input type="text" name="email" value="<?php 
        echo $u->user_email;
        ?>
" /> <br />
              <label>First Name: </label> <input type="text" name="first" value="<?php 
        echo $u->user_name_first;
        ?>
" /> <br />
              <label>Last Name:</label> <input type="text" name="last" value="<?php 
        echo $u->user_name_last;
        ?>
" /> <br />
              <label>Company</label> <input type="text" name="company" value="<?php 
        echo $u->user_company;
开发者ID:xornob,项目名称:fcc-signup,代码行数:31,代码来源:edituser.php

示例15: __construct

 public function __construct()
 {
     $this->_db = user::get_instance();
 }
开发者ID:JaxCavalera,项目名称:westcoastauto-php-mysql,代码行数:4,代码来源:db.php


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