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


PHP MemberModel::I方法代码示例

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


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

示例1: index

 public function index()
 {
     $op = ggp('op');
     if ($op == 'do') {
         $this->isLogin();
         list($address, $realname) = explode('@', $this->my['device_token']);
         $this->my['decive_token'] = unserialize($this->my['device_token']);
         if (!$address || !$this->my['mobile'] || !$realname) {
             $this->myError('请完善您的收货信息', U('member/address'));
         }
         $jf_goods_id = ggp('jf_goods_id:i');
         $jfitem = M('jf_goods')->where('state=1')->find($jf_goods_id);
         empty($jfitem) && $this->myError('没有该商品');
         $jfitem['jf_goods_jf'] > $this->my['jifen'] && $this->myError('您的积分不足');
         MemberModel::I()->decJf($this->my['uid'], $jfitem['jf_goods_jf']);
         M('jf_log')->add(array('uid' => $this->my['uid'], 'uname' => $this->my['uname'], 'order_id' => $jfitem['jf_goods_id'], 'state' => 0, 'jf_goods_jf' => -$jfitem['jf_goods_jf'], 'ctime' => TIME, 'beizhu' => serialize(array('jf_goods_name' => $jfitem['jf_goods_name'], 'address' => $address, 'realname' => $realname, 'mobile' => $this->my['mobile']))));
         if ($jfitem['jf_goods_num'] > 0) {
             if (intval($jfitem['jf_goods_num']) === 1) {
                 M('jf_goods')->where("jf_goods_id='{$jfitem['jf_goods_id']}'")->save(array('state' => 0));
             }
             M('jf_goods')->where("jf_goods_id='{$jfitem['jf_goods_id']}'")->setDec('jf_goods_num');
         }
         $this->mySuccess('兑换成功');
     }
     $hot_goods = M('goods')->where("state=1")->order('`order` DESC,hits DESC,goods_id DESC')->limit(8)->select();
     $this->assign('hot_goods', $hot_goods);
     $list = M('jf_goods')->where("state=1")->order('`order` desc,jf_goods_id desc')->select();
     $this->a('$list', $list);
     $this->d();
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:30,代码来源:JfmallAction.class.php

示例2: finishOrder

 public function finishOrder()
 {
     $order_id = gg('order_id:i');
     $where = "state=3 and order_id={$order_id} and buy_id={$this->my['uid']}";
     $pay_price = M("order")->where($where)->getField("pay_price");
     if (M('order')->where($where)->save(array('state' => '4'))) {
         $jifen = ceil($this->setting['jifen_order'] * $pay_price);
         MemberModel::I()->addJifen($this->my['uid'], $jifen);
         MemberModel::I()->addjfLog($this->my['uid'], $this->my['uname'], $order_id, 0 - $jifen, '3', "完成订单送积分");
         $this->mySuccess('msg_common_update_success');
     }
     $this->mySuccess('error_common_error');
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:13,代码来源:HomeAction.class.php

示例3: login

 public function login()
 {
     $op = $this->gp['op'];
     $uname = ggp('uname:t2');
     $password = ggp('password:t2');
     if ($op == 'dologin') {
         $member = MemberModel::I()->getUserByUname($uname);
         if (empty($member)) {
             $this->myError('error_member_uname_6');
         }
         if ($member['level'] < 1) {
             $this->myError('error_member_not_admin');
         }
         if (md5($password) != $member['password']) {
             $this->myError('error_member_password_2');
         }
         cookie('authcookie', authcode("{$member['uid']}\t{$member['password']}\t", 'ENCODE'), 31536000);
         $this->mySuccess('登录成功', U('admin/index'));
     }
     C('DEFAULT_THEME', 'a_tpl');
     $this->d();
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:22,代码来源:AdminAction.class.php

示例4: login

 public function login()
 {
     if ($this->my) {
         header("location:http://{$_SERVER['SERVER_NAME']}");
         exit;
     }
     $op = ggp('op');
     if ($op == 'do') {
         $openid = ggp('open_id:t2');
         if ($openid) {
             $nickname = ggp('nickname:t2');
             $user = M('member')->where("openid='{$openid}'")->find();
             if (empty($user)) {
                 header("location:http://{$_SERVER['SERVER_NAME']}/index.php?m=member&a=register&openid={$openid}&nickname={$nickname}");
                 exit;
             }
         } else {
             $uname = ggp('uname:t2');
             $password = md5(ggp('password:t2'));
             $user = MemberModel::I()->getUserByParam(array('uname' => $uname, 'password' => $password));
             empty($user) && $this->myError('用户名不存在或密码错误');
             $user['password'] != $password && $this->myError('密码错误');
         }
         $this->_login($user);
     }
     $this->display();
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:27,代码来源:MemberAction.class.php


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