Files
OMS/app/desktop/lib/router.php
chenping 61783b7d01 1. 【新增】售后单售后原因类型支持搜索
2. 【新增】手工创建订单折扣可输入正数

3. 【优化】盘点申请单确认

4. 【修复】采购退货单模拟出库失败问题

5. 【新增】订单金额客户实付与结算金额

6. 【优化】仓库发货统计报表物料名称显示

7. 【优化】自有仓储虚拟发货逻辑

8. 【修复】基础物料分类管理问题
2026-04-01 11:59:17 +08:00

84 lines
2.5 KiB
PHP

<?php
/**
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class desktop_router implements base_interface_router{
function __construct($app){
$this->app = $app;
}
function gen_url($params=array(),$full=false){
$params = utils::http_build_query($params);
if($params){
return $this->app->base_url($full).'index.php?'.$params;
}else{
return $this->app->base_url($full);
}
}
function dispatch($query){
$_GET['ctl'] = $_GET['ctl']?$_GET['ctl']:'default';
$_GET['act'] = $_GET['act']?$_GET['act']:'index';
$_GET['app'] = $_GET['app']?$_GET['app']:'desktop';
$query_args = $_GET['p'];
$controller = app::get($_GET['app'])->controller($_GET['ctl']);
$arrMethods = get_class_methods($controller);
if (in_array($_GET['act'], $arrMethods))
call_user_func_array(array(&$controller,$_GET['act']),(array)$query_args);
else{
header("HTTP/1.1 404 Not Found");
echo '<h1>404 - Page Not Found</h1>';
echo '<p>请求的页面不存在</p>';
exit;
}
}
/**
* 生成菜单唯一ID finder_vid
* @Author: xueding
* @Vsersion: 2022/9/8 上午10:38
* @param $path
* @return false|string
*/
public static function getFinderVid($path)
{
// if (stripos($path,'?')) {
// $path = mb_substr($path,stripos($path,'?')+1);
// }
$path = stripos($path,'?') ? parse_url($path, PHP_URL_QUERY) : $path;
parse_str($path, $pathArr);
// if (isset($pathArr['view'])) {
// unset($pathArr['view']);
// }
unset($pathArr['finder_vid'],$pathArr['finder_id'],$pathArr['_finder'],$pathArr['view']);
ksort($pathArr);
$newUrl = http_build_query($pathArr);
return substr(md5($newUrl), 5, 6);
}
}