コード例 #1
0
 /**
  * @brief 请求执行方法,是application执行的入口方法
  */
 public function execRequest()
 {
     IUrl::beginUrl();
     $this->controller = $this->createController();
     IInterceptor::run("onCreateController");
     $this->controller->run();
     IInterceptor::run("onFinishController");
 }
コード例 #2
0
 /**
  * @brief 请求执行方法,是application执行的入口方法
  */
 public function execRequest()
 {
     echo IWeb::exeTime() . "<br><br><br>";
     IUrl::beginUrl();
     $this->controller = $this->createController();
     IInterceptor::run("onCreateController", $this->controller);
     $this->controller->run();
     IInterceptor::run("onFinishController");
 }
コード例 #3
0
ファイル: goods.php プロジェクト: zhendeguoke1008/shop
 public function init()
 {
     if (IReq::get('action') == 'goods_img_upload') {
         $admin_name = IFilter::act(IReq::get('admin_name'));
         $admin_pwd = IFilter::act(IReq::get('admin_pwd'));
         $adminObj = new IModel('admin');
         $adminRow = $adminObj->getObj("admin_name = '" . $admin_name . "'", 'password');
         if (empty($adminRow) || $adminRow['password'] != $admin_pwd) {
             exit;
         }
     } else {
         IInterceptor::reg('CheckRights@onCreateAction');
     }
 }
コード例 #4
0
ファイル: view_action.php プロジェクト: xzdesk/iwebshop.com
 /**
  * @brief 执行视图渲染
  * @return 视图
  */
 public function run()
 {
     $controller = $this->getController();
     IInterceptor::run("onCreateView", $controller);
     $this->resolveView($this->getView());
     $data = null;
     if (file_exists($this->view . $controller->extend)) {
         $controller->render($this->view, $data);
     } else {
         $path = $this->view . $controller->extend;
         $path = IException::pathFilter($path);
         IError::show("not found this view page({$path})", 404);
     }
     IInterceptor::run("onFinishView");
 }
コード例 #5
0
ファイル: view_action.php プロジェクト: yongge666/sunupedu
 /**
  * @brief 执行视图渲染
  * @return 视图
  */
 public function run()
 {
     $controller = $this->getController();
     IInterceptor::run("onCreateView", $controller);
     $this->resolveView($this->getView());
     $data = null;
     if (file_exists($this->view . $controller->extend)) {
         $controller->render($this->view, $data);
     } else {
         $path = $this->view . $controller->extend;
         $path = IException::pathFilter($path);
         $data = array('title' => 'HTTP 404', 'heading' => 'not found', 'message' => "not found this view page({$path})");
         throw new IHttpException($data, 404);
     }
     IInterceptor::run("onFinishView");
 }
コード例 #6
0
ファイル: tools.php プロジェクト: yongge666/sunupedu
 function init()
 {
     IInterceptor::reg('CheckRights@onCreateAction');
 }
コード例 #7
0
 /**
  * 清空所有拦截器
  */
 public static function delAll()
 {
     self::$obj = array();
 }
コード例 #8
0
 /**
  * @brief 应用运行的方法
  * @return Void
  */
 public function run()
 {
     IInterceptor::run("onCreateApp");
     $this->execRequest();
     IInterceptor::run("onFinishApp");
 }
コード例 #9
0
 /**
  * @brief 视图重定位
  * @param string $next     下一步要执行的动作或者路径名,注:当首字符为'/'时,则支持跨控制器操作
  * @param bool   $location 是否重定位 true:是 false:否
  */
 public function redirect($nextUrl, $location = true, $data = null)
 {
     if (strpos($nextUrl, 'http') === 0) {
         header('location: ' . $nextUrl);
         IWeb::$app->end(0);
     }
     //获取当前的action动作
     $actionId = IReq::get('action');
     if ($actionId === null) {
         $actionId = $this->defaultAction;
     }
     //分析$nextAction 支持跨控制器跳转
     $nextUrl = strtr($nextUrl, '\\', '/');
     if ($nextUrl[0] != '/') {
         //重定跳转定向
         if ($actionId != $nextUrl && $location == true) {
             $locationUrl = IUrl::creatUrl('/' . $this->ctrlId . '/' . $nextUrl);
             header('location: ' . $locationUrl);
             IWeb::$app->end(0);
         } else {
             $this->action = new IViewAction($this, $nextUrl);
             $this->action->run();
         }
     } else {
         $urlArray = explode('/', $nextUrl, 4);
         $ctrlId = isset($urlArray[1]) ? $urlArray[1] : '';
         $nextAction = isset($urlArray[2]) ? $urlArray[2] : '';
         //重定跳转定向
         if ($location == true) {
             //url参数
             if (isset($urlArray[3])) {
                 $nextAction .= '/' . $urlArray[3];
             }
             $locationUrl = IUrl::creatUrl('/' . $ctrlId . '/' . $nextAction);
             header('location: ' . $locationUrl);
             IWeb::$app->end(0);
         } else {
             $nextCtrlObj = new $ctrlId($this->module, $ctrlId);
             IInterceptor::run("onCreateController", $nextCtrlObj);
             //跨控制器渲染数据
             if ($data) {
                 $nextCtrlObj->setRenderData($data);
             }
             $nextCtrlObj->init();
             $nextViewObj = new IViewAction($nextCtrlObj, $nextAction);
             $nextViewObj->run();
         }
     }
 }
コード例 #10
0
ファイル: simple -6-29.php プロジェクト: yongge666/sunupedu
 /**
  * 生成订单
  */
 function cart3()
 {
     $accept_name = IFilter::act(IReq::get('accept_name'));
     $province = IFilter::act(IReq::get('province'), 'int');
     $city = IFilter::act(IReq::get('city'), 'int');
     $area = IFilter::act(IReq::get('area'), 'int');
     $address = IFilter::act(IReq::get('address'));
     $mobile = IFilter::act(IReq::get('mobile'));
     $telphone = IFilter::act(IReq::get('telphone'));
     $zip = IFilter::act(IReq::get('zip'));
     $delivery_id = IFilter::act(IReq::get('delivery_id'), 'int');
     $accept_time = IFilter::act(IReq::get('accept_time'));
     $payment = IFilter::act(IReq::get('payment'), 'int');
     $order_message = IFilter::act(IReq::get('message'));
     $ticket_id = IFilter::act(IReq::get('ticket_id'), 'int');
     $taxes = IFilter::act(IReq::get('taxes'), 'float');
     $insured = IFilter::act(IReq::get('insured'), 'float');
     $tax_title = IFilter::act(IReq::get('tax_title'), 'text');
     $gid = IFilter::act(IReq::get('direct_gid'), 'int');
     $num = IFilter::act(IReq::get('direct_num'), 'int');
     $type = IFilter::act(IReq::get('direct_type'));
     //商品或者货品
     $promo = IFilter::act(IReq::get('direct_promo'));
     $active_id = IFilter::act(IReq::get('direct_active_id'), 'int');
     $takeself = IFilter::act(IReq::get('takeself'), 'int');
     $order_no = Order_Class::createOrderNum();
     $order_type = 0;
     $dataArray = array();
     //pr($_POST);
     //防止表单重复提交
     if (IReq::get('timeKey') != null) {
         if (ISafe::get('timeKey') == IReq::get('timeKey')) {
             IError::show(403, '订单数据不能被重复提交');
             exit;
         } else {
             ISafe::set('timeKey', IReq::get('timeKey'));
         }
     }
     if ($province == 0 || $city == 0 || $area == 0) {
         IError::show(403, '请填写收货地址的省市地区');
     }
     if ($delivery_id == 0) {
         IError::show(403, '请选择配送方式');
     }
     $user_id = $this->user['user_id'] == null ? 0 : $this->user['user_id'];
     //配送方式,判断是否为货到付款
     $deliveryObj = new IModel('delivery');
     $deliveryRow = $deliveryObj->getObj('id = ' . $delivery_id);
     if ($deliveryRow['type'] == 0) {
         if ($payment == 0) {
             IError::show(403, '请选择正确的支付方式');
         }
     } else {
         if ($deliveryRow['type'] == 1) {
             $payment = 0;
         } else {
             if ($deliveryRow['type'] == 2) {
                 if ($takeself == 0) {
                     IError::show(403, '请选择正确的自提点');
                 }
             }
         }
     }
     //如果不是自提方式自动清空自提点
     if ($deliveryRow['type'] != 2) {
         $takeself = 0;
     }
     //计算费用
     $countSumObj = new CountSum($user_id);
     //直接购买商品方式
     if ($type && $gid) {
         //计算$gid商品
         $goodsResult = $countSumObj->direct_count($gid, $type, $num, $promo, $active_id);
     } else {
         //计算购物车中的商品价格$goodsResult
         $goodsResult = $countSumObj->cart_count();
         //清空购物车
         IInterceptor::reg("cart@onFinishAction");
     }
     //判断商品商品是否存在
     if (is_string($goodsResult) || empty($goodsResult['goodsList'])) {
         IError::show(403, '商品数据错误');
         exit;
     }
     //需要选择的地址数
     $need_choose_addr_num = 1;
     if (count($goodsResult['goodsList']) == 1 && $goodsResult['count'] > 1) {
         $need_choose_addr_num = $goodsResult['count'];
     }
     //匹配收获地址
     $address_arr = IFilter::act(IReq::get('radio_address'), 'int');
     if (count($address_arr) != $need_choose_addr_num) {
         IError::show(403, '请选择' . $need_choose_addr_num . '个收货地址');
         exit;
     }
     //加入促销活动
     if ($promo && $active_id) {
         $activeObject = new Active($promo, $active_id, $user_id, $gid, $type, $num);
         $order_type = $activeObject->getOrderType();
     }
     //获取红包减免金额
     if ($ticket_id != '') {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'prop,custom');
         if (ISafe::get('ticket_' . $ticket_id) == $ticket_id || stripos(',' . trim($memberRow['prop'], ',') . ',', ',' . $ticket_id . ',') !== false) {
             $propObj = new IModel('prop');
             $ticketRow = $propObj->getObj('id = ' . $ticket_id . ' and NOW() between start_time and end_time and type = 0 and is_close = 0 and is_userd = 0 and is_send = 1');
             if (!empty($ticketRow)) {
                 $dataArray['prop'] = $ticket_id;
             }
             //锁定红包状态
             $propObj->setData(array('is_close' => 2));
             $propObj->update('id = ' . $ticket_id);
         }
     }
     $paymentObj = new IModel('payment');
     $paymentRow = $paymentObj->getObj('id = ' . $payment, 'type,name');
     $paymentName = $paymentRow['name'];
     $paymentType = $paymentRow['type'];
     //记录seller_id
     $seller_id = 0;
     if ($gid) {
         $goodsObj = new IModel("goods");
         $sell = $goodsObj->getObj("id = " . $gid, 'seller_id');
         if ($sell['seller_id'] > 0) {
             $seller_id = $sell['seller_id'];
         }
     }
     //最终订单金额计算
     $orderData = $countSumObj->countOrderFee($goodsResult['sum'], $goodsResult['final_sum'], $goodsResult['weight'], $province, $delivery_id, $payment, $goodsResult['freeFreight'], $insured, $taxes);
     //生成的订单数据
     $dataArray = array('order_no' => $order_no, 'user_id' => $user_id, 'accept_name' => $accept_name, 'pay_type' => $payment, 'distribution' => $delivery_id, 'postcode' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile, 'create_time' => ITime::getDateTime(), 'postscript' => $order_message, 'accept_time' => $accept_time, 'exp' => $goodsResult['exp'], 'point' => $goodsResult['point'], 'type' => $order_type, 'prop' => isset($dataArray['prop']) ? $dataArray['prop'] : null, 'payable_amount' => $goodsResult['sum'], 'real_amount' => $goodsResult['final_sum'], 'payable_freight' => $orderData['deliveryOrigPrice'], 'real_freight' => $orderData['deliveryPrice'], 'pay_fee' => $orderData['paymentPrice'], 'invoice' => $taxes ? 1 : 0, 'invoice_title' => $tax_title, 'taxes' => $taxes, 'promotions' => $goodsResult['proReduce'] + $goodsResult['reduce'] + (isset($ticketRow['value']) ? $ticketRow['value'] : 0), 'order_amount' => $orderData['orderAmountPrice'] - (isset($ticketRow['value']) ? $ticketRow['value'] : 0), 'if_insured' => $insured ? 1 : 0, 'insured' => $insured, 'takeself' => $takeself, 'active_id' => $active_id, 'seller_id' => $seller_id, 'address_id' => implode(',', $address_arr));
     $dataArray['order_amount'] = $dataArray['order_amount'] <= 0 ? 0 : $dataArray['order_amount'];
     if ($seller_id) {
         $sellerObj = new IModel('seller');
         $seller = $sellerObj->getObj("id = '{$seller_id}'");
         if ($seller) {
             //商家的预存款不足以扣除订单总价的1.2%
             $nedd = floatval($dataArray['order_amount'] * (1.2 * 0.01));
             if ($seller['balance'] <= 0 || $seller['balance'] < $nedd) {
                 IError::show(403, '商家预存款不足,不能进行购买');
                 exit;
             }
         }
     }
     $orderObj = new IModel('order');
     $orderObj->setData($dataArray);
     $this->order_id = $orderObj->add();
     if ($this->order_id == false) {
         IError::show(403, '订单生成错误');
     }
     /*将订单中的商品插入到order_goods表*/
     $orderInstance = new Order_Class();
     $orderInstance->insertOrderGoods($this->order_id, $goodsResult);
     //记录用户默认习惯的数据
     if (!isset($memberRow['custom'])) {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'custom');
     }
     $memberData = array('custom' => serialize(array('payment' => $payment, 'delivery' => $delivery_id, 'takeself' => $takeself)));
     $memberObj->setData($memberData);
     $memberObj->update('user_id = ' . $user_id);
     //收货地址的处理
     /* if($user_id)
     		{
     			$addressObj = new IModel('address');
     
     			//如果用户之前没有收货地址,那么会自动记录此次的地址信息并且为默认
     			$addressRow = $addressObj->getObj('user_id = '.$user_id);
     			if(empty($addressRow))
     			{
     				$addressData = array('default'=>'1','user_id'=>$user_id,'accept_name'=>$accept_name,'province'=>$province,'city'=>$city,'area'=>$area,'address'=>$address,'zip'=>$zip,'telphone'=>$telphone,'mobile'=>$mobile);
     				$addressObj->setData($addressData);
     				$addressObj->add();
     			}
     			else
     			{
     				//如果用户有收货地址,但是没有设置默认项,那么会自动设置此次地址信息为默认
     				$radio_address = intval(IReq::get('radio_address'));
     				if($radio_address != 0)
     				{
     					$addressDefRow = $addressObj->getObj('user_id = '.$user_id.' and `default` = 1');
     					if(empty($addressDefRow))
     					{
     						$addressData = array('default' => 1);
     						$addressObj->setData($addressData);
     						$addressObj->update('user_id = '.$user_id.' and id = '.$radio_address);
     					}
     				}
     			}
     		} */
     //获取备货时间
     $siteConfigObj = new Config("site_config");
     $site_config = $siteConfigObj->getInfo();
     $this->stockup_time = isset($site_config['stockup_time']) ? $site_config['stockup_time'] : 2;
     //数据渲染
     $this->order_num = $dataArray['order_no'];
     $this->final_sum = $dataArray['order_amount'];
     $this->payment = $paymentName;
     $this->paymentType = $paymentType;
     $this->delivery = $deliveryRow['name'];
     $this->tax_title = $tax_title;
     $this->deliveryType = $deliveryRow['type'];
     //订单金额为0时,订单自动完成
     if ($this->final_sum <= 0) {
         $order_id = Order_Class::updateOrderStatus($dataArray['order_no']);
         if ($order_id) {
             if ($user_id) {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货") . '/?callback=ucenter/order_detail/id/' . $order_id);
             } else {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货"));
             }
         } else {
             IError::show(403, '订单修改失败');
         }
     } else {
         $this->setRenderData($dataArray);
         $this->redirect('cart3');
     }
 }
コード例 #11
0
ファイル: simple.php プロジェクト: xzdesk/iwebshop.com
 /**
  * 生成订单
  */
 function cart3()
 {
     $accept_name = IFilter::act(IReq::get('accept_name'));
     $province = IFilter::act(IReq::get('province'), 'int');
     $city = IFilter::act(IReq::get('city'), 'int');
     $area = IFilter::act(IReq::get('area'), 'int');
     $address = IFilter::act(IReq::get('address'));
     $mobile = IFilter::act(IReq::get('mobile'));
     $telphone = IFilter::act(IReq::get('telphone'));
     $zip = IFilter::act(IReq::get('zip'));
     $delivery_id = IFilter::act(IReq::get('delivery_id'), 'int');
     $accept_time = IFilter::act(IReq::get('accept_time'));
     $payment = IFilter::act(IReq::get('payment'), 'int');
     $order_message = IFilter::act(IReq::get('message'));
     $ticket_id = IFilter::act(IReq::get('ticket_id'), 'int');
     $taxes = IFilter::act(IReq::get('taxes'), 'int');
     $tax_title = IFilter::act(IReq::get('tax_title'));
     $gid = IFilter::act(IReq::get('direct_gid'), 'int');
     $num = IFilter::act(IReq::get('direct_num'), 'int');
     $type = IFilter::act(IReq::get('direct_type'));
     //商品或者货品
     $promo = IFilter::act(IReq::get('direct_promo'));
     $active_id = IFilter::act(IReq::get('direct_active_id'), 'int');
     $takeself = IFilter::act(IReq::get('takeself'), 'int');
     $ticketUserd = IFilter::act(IReq::get('ticketUserd'), 'int');
     $order_type = 0;
     $dataArray = array();
     //防止表单重复提交
     if (IReq::get('timeKey') != null) {
         if (ISafe::get('timeKey') == IReq::get('timeKey')) {
             IError::show(403, '订单数据不能被重复提交');
             exit;
         } else {
             ISafe::set('timeKey', IReq::get('timeKey'));
         }
     }
     if ($province == 0 || $city == 0 || $area == 0) {
         IError::show(403, '请填写收货地址的省市地区');
     }
     if ($delivery_id == 0) {
         IError::show(403, '请选择配送方式');
     }
     $user_id = $this->user['user_id'] == null ? 0 : $this->user['user_id'];
     //配送方式,判断是否为货到付款
     $deliveryObj = new IModel('delivery');
     $deliveryRow = $deliveryObj->getObj('id = ' . $delivery_id);
     if ($deliveryRow['type'] == 0) {
         if ($payment == 0) {
             IError::show(403, '请选择正确的支付方式');
         }
     } else {
         if ($deliveryRow['type'] == 1) {
             $payment = 0;
         } else {
             if ($deliveryRow['type'] == 2) {
                 if ($takeself == 0) {
                     IError::show(403, '请选择正确的自提点');
                 }
             }
         }
     }
     //如果不是自提方式自动清空自提点
     if ($deliveryRow['type'] != 2) {
         $takeself = 0;
     }
     //计算费用
     $countSumObj = new CountSum($user_id);
     $goodsResult = $countSumObj->cart_count($gid, $type, $num, $promo, $active_id);
     if (!$gid) {
         //清空购物车
         IInterceptor::reg("cart@onFinishAction");
     }
     //判断商品商品是否存在
     if (is_string($goodsResult) || empty($goodsResult['goodsList'])) {
         IError::show(403, '商品数据错误');
         exit;
     }
     //加入促销活动
     if ($promo && $active_id) {
         $activeObject = new Active($promo, $active_id, $user_id, $gid, $type, $num);
         $order_type = $activeObject->getOrderType();
     }
     $paymentObj = new IModel('payment');
     $paymentRow = $paymentObj->getObj('id = ' . $payment, 'type,name');
     $paymentName = $paymentRow['name'];
     $paymentType = $paymentRow['type'];
     //最终订单金额计算
     $orderData = $countSumObj->countOrderFee($goodsResult, $province, $delivery_id, $payment, $taxes, 0, $promo, $active_id);
     if (is_string($orderData)) {
         IError::show(403, $orderData);
         exit;
     }
     //根据商品所属商家不同批量生成订单
     $orderIdArray = array();
     $orderNumArray = array();
     $final_sum = 0;
     foreach ($orderData as $seller_id => $goodsResult) {
         //生成的订单数据
         $dataArray = array('order_no' => Order_Class::createOrderNum(), 'user_id' => $user_id, 'accept_name' => $accept_name, 'pay_type' => $payment, 'distribution' => $delivery_id, 'postcode' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile, 'create_time' => ITime::getDateTime(), 'postscript' => $order_message, 'accept_time' => $accept_time, 'exp' => $goodsResult['exp'], 'point' => $goodsResult['point'], 'type' => $order_type, 'payable_amount' => $goodsResult['sum'], 'real_amount' => $goodsResult['final_sum'], 'payable_freight' => $goodsResult['deliveryOrigPrice'], 'real_freight' => $goodsResult['deliveryPrice'], 'pay_fee' => $goodsResult['paymentPrice'], 'invoice' => $taxes ? 1 : 0, 'invoice_title' => $tax_title, 'taxes' => $goodsResult['taxPrice'], 'promotions' => $goodsResult['proReduce'] + $goodsResult['reduce'], 'order_amount' => $goodsResult['orderAmountPrice'], 'insured' => $goodsResult['insuredPrice'], 'takeself' => $takeself, 'active_id' => $active_id, 'seller_id' => $seller_id, 'note' => '');
         //获取红包减免金额
         if ($ticket_id && $ticketUserd == $seller_id) {
             $memberObj = new IModel('member');
             $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'prop,custom');
             //游客手动添加或注册用户道具中已有的代金券
             if (ISafe::get('ticket_' . $ticket_id) == $ticket_id || stripos(',' . trim($memberRow['prop'], ',') . ',', ',' . $ticket_id . ',') !== false) {
                 $propObj = new IModel('prop');
                 $ticketRow = $propObj->getObj('id = ' . $ticket_id . ' and NOW() between start_time and end_time and type = 0 and is_close = 0 and is_userd = 0 and is_send = 1');
                 if (!$ticketRow) {
                     IError::show(403, '代金券不可用');
                 }
                 if ($ticketRow['seller_id'] == 0 || $ticketRow['seller_id'] == $seller_id) {
                     $ticketRow['value'] = $ticketRow['value'] >= $goodsResult['final_sum'] ? $goodsResult['final_sum'] : $ticketRow['value'];
                     $dataArray['prop'] = $ticket_id;
                     $dataArray['promotions'] += $ticketRow['value'];
                     $dataArray['order_amount'] -= $ticketRow['value'];
                     $goodsResult['promotion'][] = array("plan" => "代金券", "info" => "使用了¥" . $ticketRow['value'] . "代金券");
                     //锁定红包状态
                     $propObj->setData(array('is_close' => 2));
                     $propObj->update('id = ' . $ticket_id);
                 }
             }
         }
         //促销规则
         if (isset($goodsResult['promotion']) && $goodsResult['promotion']) {
             foreach ($goodsResult['promotion'] as $key => $val) {
                 $dataArray['note'] .= " 【" . $val['info'] . "】 ";
             }
         }
         $dataArray['order_amount'] = $dataArray['order_amount'] <= 0 ? 0 : $dataArray['order_amount'];
         //生成订单插入order表中
         $orderObj = new IModel('order');
         $orderObj->setData($dataArray);
         $order_id = $orderObj->add();
         if ($order_id == false) {
             IError::show(403, '订单生成错误');
         }
         /*将订单中的商品插入到order_goods表*/
         $orderInstance = new Order_Class();
         $orderInstance->insertOrderGoods($order_id, $goodsResult['goodsResult']);
         //订单金额小于等于0直接免单
         if ($dataArray['order_amount'] <= 0) {
             Order_Class::updateOrderStatus($dataArray['order_no']);
         } else {
             $orderIdArray[] = $order_id;
             $orderNumArray[] = $dataArray['order_no'];
             $final_sum += $dataArray['order_amount'];
         }
     }
     //记录用户默认习惯的数据
     if (!isset($memberRow['custom'])) {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'custom');
     }
     $memberData = array('custom' => serialize(array('payment' => $payment, 'delivery' => $delivery_id, 'takeself' => $takeself)));
     $memberObj->setData($memberData);
     $memberObj->update('user_id = ' . $user_id);
     //收货地址的处理
     if ($user_id) {
         $addressObj = new IModel('address');
         $addressDefRow = $addressObj->getObj('user_id = ' . $user_id . ' and `default` = 1');
         if (!$addressDefRow) {
             $radio_address = IFilter::act(IReq::get('radio_address'), 'int');
             $addressObj->setData(array('default' => 1));
             $addressObj->update('user_id = ' . $user_id . ' and id = ' . $radio_address);
         }
     }
     //获取备货时间
     $siteConfigObj = new Config("site_config");
     $site_config = $siteConfigObj->getInfo();
     $this->stockup_time = isset($site_config['stockup_time']) ? $site_config['stockup_time'] : 2;
     //数据渲染
     $this->order_id = join(",", $orderIdArray);
     $this->final_sum = $final_sum;
     $this->order_num = join(",", $orderNumArray);
     $this->payment = $paymentName;
     $this->paymentType = $paymentType;
     $this->delivery = $deliveryRow['name'];
     $this->tax_title = $tax_title;
     $this->deliveryType = $deliveryRow['type'];
     //订单金额为0时,订单自动完成
     if ($this->final_sum <= 0) {
         $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货") . '/?callback=ucenter/order');
     } else {
         $this->setRenderData($dataArray);
         $this->redirect('cart3');
     }
 }
コード例 #12
0
ファイル: pic.php プロジェクト: yongge666/sunupedu
 function init()
 {
     if (!in_array(IReq::get('action'), self::$openAction)) {
         IInterceptor::reg('CheckRights@onCreateAction');
     }
 }
コード例 #13
0
 /**
  * @brief 执行action方法
  */
 public function run()
 {
     //开启缓冲区
     ob_start();
     header("content-type:text/html;charset=" . $this->module->charset);
     //初始化控制器
     $this->init();
     //创建action对象
     $actionObj = $this->createAction();
     IInterceptor::run("onCreateAction");
     $actionObj->run();
     IInterceptor::run("onFinishAction");
     //处理缓冲区
     die(trim(ob_get_clean()));
 }
コード例 #14
0
 /**
  * @brief 执行action方法
  */
 public function run()
 {
     //开启缓冲区
     ob_start();
     ob_implicit_flush(false);
     header("content-type:text/html;charset=" . $this->module->getCharset());
     //初始化控制器
     $this->init();
     //创建action对象
     IInterceptor::run("onCreateAction");
     $actionObj = $this->createAction();
     $actionObj->run();
     IInterceptor::run("onFinishAction");
     flush();
     IWeb::$app->end(0);
 }
コード例 #15
0
 /**
  * @brief 应用运行的方法
  * @return Void
  */
 public function run()
 {
     echo "拦截器注册完成666666666<br>";
     IInterceptor::run("onCreateApp");
     echo "注册onCreateApp拦截器<br>";
     echo "执行IWebApplication:execRequest()方法<br>";
     $this->execRequest();
     IInterceptor::run("onFinishApp");
 }
コード例 #16
0
ファイル: pic.php プロジェクト: zhendeguoke1008/shop
 function init()
 {
     if (IReq::get('action') != 'upload_json') {
         IInterceptor::reg('CheckRights@onCreateAction');
     }
 }