1 Star 0 Fork 8

xuegan/diygwcom_app

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
site.php 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
html580 提交于 2018-08-04 17:01 . OK
<?php
/*
* @Author: DIYGWCOM
* @Date: 2018-07-21 23:20:49
* @qq: 287598666
* @Last Modified by: DIYGWCOM
* @Last Modified time: 2018-07-26 00:41:14
*/
defined('IN_IA') or exit('Access Denied');
session_start();
require_once('define.php');
require_once('model.php');
require_once('DiygwcomUtil.class.php');
class diygwcom_appModuleSite extends WeModuleSite {
public function getMenus()
{
global $_W;
return array(
array('title' => '管理后台', 'icon' => 'fa fa-shopping-cart', 'url' => webUrl())
);
}
function __call($name,$arguments)
{
global $_GPC;
global $_W;
$isWeb = stripos($name, 'doWeb') === 0;
$isMobile = stripos($name, 'doMobile') === 0;
$this->modulename = MODULE_NAME;
if(isset($_GPC['r'])){
$r = str_replace('//', '/', trim($_GPC['r'], '/'));
}else{
if($isWeb){
$r = strtolower(substr($name, 5));
$_GPC['do'] ='web';
}else if($isMobile){
$r = strtolower(substr($name, 8));
$_GPC['do'] ='mobile';
}
}
$routes = explode('_', $r);
$segs = count($routes);
if($segs==1){
$_W['routes'] = $r.'/index';
}else{
$_W['routes']= $routes[0].'/'.$routes[1];
}
$dir = IA_ROOT . '/addons/' . $this->modulename . '/inc/';
require_once $dir .'DiygwcomAction.php';
if($isWeb) {
$dir .= 'web/';
}
if($isMobile) {
$dir .= 'mobile/';
require_once $dir .'Interceptor.php';
}
$controller = $dir. ucfirst($routes[0]) . '.php';
if (!(is_file($controller))) {
exit(' 控制器 ' . $name . ' Not Found!');
}
require_once $controller;
$class_name = ucfirst($routes[0])."_Diygwcom";
$instance = new $class_name();
$_modules[$isWeb?"web":"mobile".$name] = $instance;
$method = 'index';
if($segs==2){
$method=$routes[1];
}
if (!(method_exists($instance, $method))) {
message('控制器 ' . $_W['controller'] . ' 方法 ' . $method . ' 未找到!','','error');
}
$instance->$method();
exit();
}
public function doWebIndex()
{
$this->__call('doWeb');
}
public function doMobileIndex()
{
$this->__call('doMobile');
}
public function payResult($params)
{
$dir = IA_ROOT . '/addons/' . $this->modulename . '/inc/';
require_once $dir .'DiygwcomAction.php';
$controller = IA_ROOT . '/addons/' . MODULE_NAME . '/inc/mobile/Pay.php';
require_once $controller;
$class_name = "Pay_Diygwcom";
$method="payResult";
$instance = new $class_name();
include $instance->$method($params);
echo 1;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/null_397_3348/diygwcom_app.git
[email protected]:null_397_3348/diygwcom_app.git
null_397_3348
diygwcom_app
diygwcom_app
master

搜索帮助