本文整理匯總了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);
}