本文整理汇总了PHP中Core\Helper\Utility\Route::getRefer方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::getRefer方法的具体用法?PHP Route::getRefer怎么用?PHP Route::getRefer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core\Helper\Utility\Route
的用法示例。
在下文中一共展示了Route::getRefer方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get($f3)
{
// 清除客户端所有数据
ClientData::clearClientData();
// 清除服务器端数据
AuthHelper::removeAuthUser();
$f3->clear('SESSION');
$this->addFlashMessage('成功退出登陆');
$backUrl = RouteHelper::getRefer();
if (Utils::isBlank($backUrl)) {
// 没有来路域名则返回首页
$backUrl = '/';
}
// 刷新当前页面
RouteHelper::reRoute($this, $backUrl, false);
}
示例2: get
public function get($f3)
{
// 权限检查
$this->requirePrivilege('manage_goods_edit_edit_get');
// 参数验证
$validator = new Validator($f3->get('GET'));
$goods_id = $validator->required('商品ID不能为空')->digits()->min(1)->validate('goods_id');
if (!$this->validate($validator)) {
goto out;
}
// 清除商品缓存
ClearHelper::clearGoodsCacheById($goods_id);
$this->addFlashMessage('商品[' . $goods_id . '] 缓存清除成功');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例3: clearArticleCacheById
public function clearArticleCacheById($f3)
{
// 权限检查
$this->requirePrivilege('manage_misc_cache');
// 参数验证
$validator = new Validator($f3->get('POST'));
$article_id = $validator->required('商品ID不能为空')->digits()->validate('article_id');
if (!$this->validate($validator)) {
goto out;
}
ClearHelper::clearArticleCacheById($article_id);
$this->addFlashMessage('商品[' . $article_id . ']页面清理成功');
out:
// 从这里退出
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例4: get
public function get($f3)
{
global $smarty;
$privilegeKey = $f3->get('GET[privilege]');
$privilegeItem = array();
if (!empty($privilegeKey)) {
if (UserAdminService::privilegeAll == $privilegeKey) {
$privilegeItem['meta_name'] = '最高权限';
$privilegeItem['meta_desc'] = '系统的最高权限';
} else {
$metaPrivilegeService = new MetaPrivilegeService();
$privilege = $metaPrivilegeService->loadPrivilegeItem($privilegeKey);
$privilegeItem = $privilege->toArray();
}
}
$smarty->assign('privilegeItem', $privilegeItem);
$smarty->assign('refer_url', RouteHelper::getRefer());
$smarty->display('error_privilege.tpl');
}
示例5: AttrItemRemove
public function AttrItemRemove($f3)
{
// 权限检查
$this->requirePrivilege('manage_goods_type_listtype');
// 参数验证
$validator = new Validator($f3->get('GET'));
$meta_id = $validator->required()->digits()->min(1)->validate('meta_id');
if (!$this->validate($validator)) {
goto out;
}
$goodsTypeService = new GoodsTypeService();
$goodsTypeService->removeGoodsTypeAttrItem($meta_id);
$this->addFlashMessage('成功删除属性[' . $meta_id . ']');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例6: Update
/**
* 更新 goods_gallery 的内容
*
* @param $f3
*/
public function Update($f3)
{
// 权限检查
$this->requirePrivilege('manage_goods_edit_edit_post');
// 参数验证
$validator = new Validator($f3->get('POST'));
$img_id = $validator->required('图片ID不能为空')->digits()->min(1)->validate('img_id');
$img_sort_order = $validator->digits('图片排序必须是数字')->min(0)->validate('img_sort_order');
$img_desc = $validator->validate('img_desc');
if (!$this->validate($validator)) {
goto out;
}
//操作 goods_gallery 记录
$goodsGalleryService = new GoodsGalleryService();
$goodsGallery = $goodsGalleryService->_loadById('goods_gallery', 'img_id = ?', $img_id);
$goodsGallery->img_desc = $img_desc;
$goodsGallery->img_sort_order = $img_sort_order;
$goodsGallery->save();
$this->addFlashMessage('图片 [' . $img_id . '] 修改成功');
//清除缓存,确保商品显示正确
ClearHelper::clearGoodsCacheById($goodsGallery->goods_id);
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例7: SetRefund
/**
* 设置订单为 退款中 状态
*
* 即:确认已经收到用户的退货了,告知财务这个订单可以给用户退款了
*
* @param $f3
*/
public function SetRefund($f3)
{
// 参数验证
$validator = new Validator($f3->get('GET'));
$rec_id = $validator->required()->digits()->min(1)->validate('rec_id');
if (!$this->validate($validator)) {
goto out;
}
// 取得当前供货商
$authSupplierUser = AuthHelper::getAuthUser();
$orderBasicService = new OrderBasicService();
$orderGoods = $orderBasicService->loadOrderGoodsById($rec_id);
if ($orderGoods->isEmpty() || OrderGoodsService::OGS_ASKREFUND != $orderGoods->order_goods_status || $orderGoods['suppliers_id'] != $authSupplierUser['suppliers_id']) {
$this->addFlashMessage('订单ID非法');
goto out;
}
$orderInfo = $orderBasicService->loadOrderInfoById($orderGoods['order_id']);
if ($orderInfo->isEmpty() || $orderInfo->pay_status != OrderBasicService::PS_PAYED) {
$this->addFlashMessage('订单ID非法');
goto out;
}
// 设置订单状态为 退款中
$orderGoods->order_goods_status = OrderGoodsService::OGS_REFUNDING;
$orderGoods->save();
// 更新 order_info 的 update_time 字段
$orderInfo->update_time = Time::gmTime();
$orderInfo->save();
$action_note = '设置为退款中' . "\n";
$action_note .= '操作人:[' . $authSupplierUser['suppliers_id'] . ']' . $authSupplierUser['suppliers_name'] . "\n";
// 添加订单操作日志
$orderActionService = new OrderActionService();
$orderActionService->logOrderAction($orderGoods['order_id'], $orderGoods['rec_id'], $orderInfo['order_status'], $orderInfo['pay_status'], $orderGoods['order_goods_status'], $action_note, $authSupplierUser['suppliers_name'], 0, $orderInfo['shipping_status']);
$this->addFlashMessage('订单状态设置为[退款中]');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例8: UpdateTheme
public function UpdateTheme($f3)
{
// 权限检查,有权限安装就有权限升级
$this->requirePrivilege('manage_plugin_theme_installtheme');
// 参数验证
$validator = new Validator($f3->get('GET'));
$themeDirName = $validator->required()->validate('themeDirName');
if (!$this->validate($validator)) {
goto out;
}
$themeInstance = ThemeHelper::loadPluginInstance($themeDirName);
if (!$themeInstance) {
$this->addFlashMessage('主题[' . $themeDirName . ']无效');
goto out;
}
// 调用主题操作
$ret = $themeInstance->pluginUpdate();
if (true !== $ret) {
$this->addFlashMessage('主题[' . $themeDirName . ']升级失败:' . $ret);
goto out;
}
$this->addFlashMessage('主题升级成功');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例9: Remove
public function Remove($f3)
{
// 权限检查
$this->requirePrivilege('manage_misc_cron');
// 参数验证
$validator = new Validator($f3->get('GET'));
$task_id = $validator->required('任务ID不能为空')->digits('任务ID非法')->min(1)->filter('ValidatorIntValue')->validate('task_id');
if (!$this->validate($validator)) {
goto out;
}
$cronTaskService = new CronTaskService();
if ($cronTaskService->removeCronTaskById($task_id)) {
$this->addFlashMessage('定时任务删除成功');
} else {
$this->addFlashMessage('定时任务删除失败');
}
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例10: GoodsComment
/**
* 订单商品评价
*
* @param $f3
*/
public function GoodsComment($f3)
{
global $smarty;
$errorMessage = '';
// 参数验证
$validator = new Validator($f3->get('GET'));
$rec_id = $validator->required()->digits()->min(1)->validate('rec_id');
if (!$this->validate($validator)) {
$errorMessage = '订单ID非法';
goto out_fail;
}
$orderBasicService = new OrderBasicService();
// 查询 order_goods
$orderGoods = $orderBasicService->loadOrderGoodsById($rec_id, 10);
// 缓存 10 秒钟
if ($orderGoods->isEmpty()) {
$errorMessage = '订单ID非法';
goto out_fail;
}
// 查询 order_info
$orderInfo = $orderBasicService->loadOrderInfoById($orderGoods['order_id'], 10);
// 缓存 10 秒钟
// 权限检查,用户只能查看自己的订单
$userInfo = AuthHelper::getAuthUser();
if ($orderInfo->isEmpty() || $userInfo['user_id'] != $orderInfo['user_id'] || !$this->verifyOrderSystem($orderInfo)) {
$errorMessage = '订单ID非法';
goto out_fail;
}
// 加载订单评论
$goodsCommentService = new GoodsCommentService();
$goodsComment = $goodsCommentService->loadGoodsCommentByOrderGoodsRecId($rec_id, 1);
// 缓存1秒
if ($goodsComment->isEmpty() || $goodsComment['user_id'] != $userInfo['user_id']) {
$errorMessage = '无法评论此订单';
goto out_fail;
}
// post 请求
if (Request::isRequestPost()) {
goto do_post;
}
// 赋值评论信息
$smarty->assign('goodsComment', $goodsComment->toArray());
out_fail:
// GET 从这里退出
$smarty->assign('errorMessage', $errorMessage);
$smarty->display('my_order_goodscomment.tpl');
return;
do_post:
// 这里处理 post 请求
// 用户评论缺省不显示,需要等管理员审核通过才能显示
$goodsComment->is_show = 0;
$goodsComment->comment_time = Time::gmTime();
// 过滤用户提交的数据
unset($validator);
$validator = new Validator($f3->get('POST'));
$goodsComment->comment_rate = $validator->filter('ValidatorIntValue')->validate('comment_rate');
$goodsComment->comment = $validator->validate('comment');
$goodsComment->save();
$this->addFlashMessage('评论发表成功,请等待管理员审核通过才能显示');
// 回到前面的页面
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例11: Refuse
/**
* 拒绝退款请求
*
* @param $f3
*/
public function Refuse($f3)
{
// 权限检查
$this->requirePrivilege('manage_order_refund_confirm');
// 参数验证
$validator = new Validator($f3->get('POST'));
$rec_id = $validator->required()->digits()->min(1)->validate('rec_id');
$refund_finish_note = $validator->required()->validate('refund_finish_note');
if (!$this->validate($validator)) {
goto out;
}
$orderBasicService = new OrderBasicService();
$orderGoods = $orderBasicService->loadOrderGoodsById($rec_id);
if ($orderGoods->isEmpty() || OrderGoodsService::OGS_REFUNDING != $orderGoods->order_goods_status) {
$this->addFlashMessage('订单ID非法');
goto out;
}
$orderInfo = $orderBasicService->loadOrderInfoById($orderGoods['order_id']);
if ($orderInfo->isEmpty() || $orderInfo->pay_status != OrderBasicService::PS_PAYED) {
$this->addFlashMessage('订单ID非法');
goto out;
}
// 标记订单为 付款
$orderGoods->order_goods_status = OrderGoodsService::OGS_PAY;
// 清除退款记录
$orderGoods->refund = 0;
// 我们给顾客退款
$orderGoods->refund_time = 0;
$orderGoods->refund_finish_time = Time::gmTime();
$orderGoods->refund_finish_note = $refund_finish_note;
$orderGoods->suppliers_refund = 0;
// 供货商给我们退款
$orderGoods->save();
// 更新 order_info 的 update_time 字段
$orderInfo->update_time = Time::gmTime();
$orderInfo->save();
$authAdminUser = AuthHelper::getAuthUser();
$action_note = '拒绝退款' . "\n";
$action_note .= '操作人:[' . $authAdminUser['user_id'] . ']' . $authAdminUser['user_name'] . "\n";
$action_note .= '备注:' . $refund_finish_note . "\n";
// 添加订单操作日志
$orderActionService = new OrderActionService();
$orderActionService->logOrderAction($orderGoods['order_id'], $orderGoods['rec_id'], $orderInfo['order_status'], $orderInfo['pay_status'], $orderGoods['order_goods_status'], $action_note, $authAdminUser['user_name'], 0, $orderInfo['shipping_status']);
$this->addFlashMessage('拒绝退款成功');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例12: TransferGoods
/**
* 把商品从一个分类转移到另外一个分类
* @param $f3
*/
public function TransferGoods($f3)
{
// 权限检查
$this->requirePrivilege('manage_goods_category_edit');
// 参数验证
$validator = new Validator($f3->get('POST'));
$meta_id = $validator->required()->digits()->min(1)->validate('meta_id');
$target_meta_id = $validator->required('必须选择一个目标分类')->digits()->min(1)->validate('target_meta_id');
if (!$this->validate($validator)) {
goto out;
}
if ($meta_id == $target_meta_id) {
$this->addFlashMessage('目标分类不能是自己');
goto out;
}
$goodsCategoryService = new GoodsCategoryService();
$goodsCategoryService->transferGoodsToNewCategory($meta_id, $target_meta_id);
$this->addFlashMessage('商品转移成功');
$this->addFlashMessage('注意:商品转移只是当前分类商品,不包括子分类的商品');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例13: Charge
/**
* 给用户余额充值
* @param $f3
*/
public function Charge($f3)
{
// 权限检查
$this->requirePrivilege('manage_account_user_charge');
$validator = new Validator($f3->get('POST'));
$user_id = $validator->required()->digits()->validate('user_id');
$chargeMoney = Money::toStorage($validator->validate('chargeMoney'));
$chargeMoneyDesc = $validator->validate('chargeMoneyDesc');
if (!$this->validate($validator)) {
goto out;
}
if (0 == $chargeMoney) {
$this->addFlashMessage('充值为0,不操作');
goto out;
}
// 加载用户信息
$userBasicService = new UserBasicService();
$userInfo = $userBasicService->loadUserById($user_id);
if ($userInfo->isEmpty()) {
$this->addFlashMessage('用户ID非法[' . $user_id . ']');
goto out;
}
// 当前操作的管理员
$authAdminUser = AuthHelper::getAuthUser();
// 给用户充值
$accountLog = new AccountLog();
$accountLog->logChange($user_id, $chargeMoney, 0, 0, 0, '管理员[' . $authAdminUser['user_name'] . ']充值[' . Money::toSmartyDisplay($chargeMoney) . ']元' . "\n" . $chargeMoneyDesc, $chargeMoney > 0 ? AccountLog::ACT_SAVING : AccountLog::ACT_DRAWING, $authAdminUser['user_id']);
$this->addFlashMessage('充值 [' . Money::toSmartyDisplay($chargeMoney) . '] 元成功');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}
示例14: Update
/**
* 更新结算详情记录
*
* @param $f3
*/
public function Update($f3)
{
// 权限检查
$this->requirePrivilege('manage_order_settle_update');
// 参数验证
$validator = new Validator($f3->get('GET'));
$settle_id = $validator->required()->digits()->min(1)->validate('settle_id');
if (!$this->validate($validator)) {
$this->addFlashMessage('结算ID非法');
goto out;
}
// 加载 order_settle 记录
$orderSettleService = new OrderSettleService();
$orderSettle = $orderSettleService->loadOrderSettleBySettleId($settle_id);
if ($orderSettle->isEmpty()) {
$this->addFlashMessage('结算ID非法');
goto out;
}
// 表单验证
$validator = new Validator($f3->get('POST[orderSettle]'));
$orderSettle->pay_type = $validator->validate('pay_type');
$orderSettle->pay_no = $validator->validate('pay_no');
$orderSettle->pay_time = Time::gmStrToTime($validator->validate('pay_time'));
$orderSettle->memo = $validator->validate('memo');
$orderSettle->save();
$this->addFlashMessage('结算记录设置成功');
out:
RouteHelper::reRoute($this, RouteHelper::getRefer(), false);
}