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


PHP CommonController::checkUser方法代码示例

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


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

示例1: order

 public function order()
 {
     if (isset($_GET['uid']) && isset($_GET['token'])) {
         $_SESSION['uid'] = $_GET['uid'];
         $_SESSION['token'] = $_GET['token'];
     }
     parent::checkUser();
     if (IS_AJAX) {
         parent::checkUser();
         $goods = M('goods')->where('id=' . $_POST['id'])->select();
         $order_details['gid'] = $_POST['id'];
         $order_details['gonum'] = $_POST['num'];
         M('gorder_details')->startTrans();
         $order['uid'] = $_SESSION['uid'];
         $time = explode('-', date('Y-m-d', time()));
         $order['gordernumber'] = $order_details['oid'] = $time[0] . $time[1] . $time[2] . $_SESSION['uid'] . rand(100000, 999999);
         $order['create_time'] = time();
         $order['gostatus'] = 0;
         $order['name'] = $_POST['name'];
         $order['telephone'] = $_POST['telephone'];
         $order['address'] = $_POST['address'];
         $order_details['gdprice'] = $goods[0]['gprice'];
         $order['gototal'] = $_POST['num'] * $goods[0]['gprice'];
         // 生成订单
         if (M('orders')->data($order)->add() && M('gorder_details')->data($order_details)->add()) {
             M('gorder_details')->commit();
             echo json_encode(1);
             exit;
         } else {
             M('gorder_details')->rollback();
             echo json_encode(0);
             exit;
         }
     }
     if (isset($_GET['uid'])) {
         $_SESSION['uid'] = $_GET['uid'];
     }
     if (isset($_SESSION['uid'])) {
         //分配手机号
         $telephone = M('users')->field('telephone')->where('id=' . $_SESSION['uid'])->select();
         //代付款
         $not_paying = M()->field('orders.id as orders_id,orders.gordernumber,orders.create_time,orders.gototal,goods.gname,goods.gprice,goods.gsize,goods.gcolor,goods.gnum as gnum,goods.id as goods_id,order_details.gonum,order_details.gdprice,goods_face.location_status,goods_face.g_faceurl,goods_face.g_face')->table('kxw_goods as goods,kxw_orders as orders,kxw_gorder_details as order_details,kxw_goods_face as goods_face')->where("orders.gostatus=0 and orders.uid=" . $_SESSION['uid'] . " and orders.gordernumber=order_details.oid and order_details.gid=goods.id and order_details.gid=goods_face.gid and goods_face.status=2")->order('orders.create_time desc')->select();
         //已付款代发货
         $not_send = M()->field('orders.id as orders_id,orders.gordernumber,orders.create_time,orders.gototal,goods.gname,goods.gprice,goods.gsize,goods.gcolor,goods.id as goods_id,order_details.gonum,order_details.gdprice,goods_face.location_status,goods_face.g_faceurl,goods_face.g_face')->table('kxw_goods as goods,kxw_orders as orders,kxw_gorder_details as order_details,kxw_goods_face as goods_face')->where("orders.gostatus=1 and orders.uid=" . $_SESSION['uid'] . " and orders.gordernumber=order_details.oid and order_details.gid=goods.id and order_details.gid=goods_face.gid and goods_face.status=2")->order('orders.create_time desc')->select();
         //待收货
         $success_paying = M()->field('orders.create_time,orders.gordernumber,orders.Logistics_code,orders.logistics_number,orders.gototal,goods.gname,goods.gprice,orders.id,goods.gsize,goods.gcolor,order_details.gonum,order_details.gdprice,goods_face.location_status,goods_face.g_faceurl,goods_face.g_face,goods.id as goods_id,orders.Logistics_code as Logistics_code,orders.logistics_number as logistics_number')->table('kxw_goods as goods,kxw_orders as orders,kxw_gorder_details as order_details,kxw_goods_face as goods_face')->where("orders.gostatus=2 and orders.uid=" . $_SESSION['uid'] . " and orders.gordernumber=order_details.oid and order_details.gid=goods.id and order_details.gid=goods_face.gid and goods_face.status=2")->order('orders.create_time desc')->select();
         //已完成订单
         $complete_paying = M()->field('orders.create_time,orders.logistics_number,orders.Logistics_code,orders.gordernumber,goods.id,goods.gname,goods.gprice,goods.gsize,goods.id,gcolor,order_details.gonum,order_details.gdprice,goods_face.location_status,goods_face.g_faceurl,goods_face.g_face')->table('kxw_goods as goods,kxw_orders as orders,kxw_gorder_details as order_details,kxw_goods_face as goods_face')->where("orders.gostatus=5 and orders.uid=" . $_SESSION['uid'] . " and orders.gordernumber=order_details.oid and order_details.gid=goods.id and order_details.gid=goods_face.gid and goods_face.status=2")->order('orders.pay_time desc')->select();
         if (!$telephone[0]['telephone']) {
             $telephone[0]['telephone'] = '';
         }
         //$tel_q3=substr($telephone[0]['telephone'],0,3);
         //$tel_h4=substr($telephone[0]['telephone'],7);
         $this->assign('tel', $telephone[0]['telephone']);
         $this->assign('telephone', $telephone);
         $this->assign('uid', $_SESSION['uid']);
         $this->assign('not_paying', $not_paying);
         $this->assign('not_send', $not_send);
         $this->assign('success_paying', $success_paying);
         $this->assign('complete_paying', $complete_paying);
         $this->display();
     }
 }
开发者ID:283541486,项目名称:kaixinwa2.0,代码行数:63,代码来源:IndexController.class.php


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