mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-29 10:29:27 +08:00
底层框架升级到tp6
This commit is contained in:
parent
9df901387c
commit
43f5e15413
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,7 +2,7 @@
|
||||
.DS_Store
|
||||
.ide
|
||||
*.log
|
||||
*.lock
|
||||
.env
|
||||
.tea
|
||||
.idea
|
||||
.htaccess
|
||||
|
@ -1,21 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 ShopXO
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 ShopXO
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -13,7 +13,7 @@
|
||||
namespace think;
|
||||
|
||||
// 加载基础文件
|
||||
require __DIR__ . '/thinkphp/base.php';
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// 根目录入口
|
||||
define('IS_ROOT_ACCESS', true);
|
||||
@ -21,6 +21,9 @@ define('IS_ROOT_ACCESS', true);
|
||||
// 引入公共入口文件
|
||||
require __DIR__.'/public/core.php';
|
||||
|
||||
// 执行应用并响应
|
||||
Container::get('app')->bind('admin')->run()->send();
|
||||
// 执行HTTP应用并响应
|
||||
$http = (new App())->http;
|
||||
$response = $http->name('admin')->run();
|
||||
$response->send();
|
||||
$http->end($response);
|
||||
?>
|
10
application/middleware.php → api.php
Executable file → Normal file
10
application/middleware.php → api.php
Executable file → Normal file
@ -9,9 +9,9 @@
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 中间件配置
|
||||
return [
|
||||
// 系统环境检查
|
||||
app\http\middleware\SystemEnvCheck::class,
|
||||
];
|
||||
// [ API入口文件 ]
|
||||
define('IS_ROOT_ACCESS', true);
|
||||
|
||||
// 引入公共入口文件
|
||||
require './public/api.php';
|
||||
?>
|
1
app/.gitignore
vendored
Normal file
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
event.php
|
44
application/tags.php → app/AppService.php
Executable file → Normal file
44
application/tags.php → app/AppService.php
Executable file → Normal file
@ -8,29 +8,25 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types = 1);
|
||||
|
||||
// 应用行为扩展定义文件
|
||||
return array (
|
||||
'app_init' =>
|
||||
array (
|
||||
),
|
||||
'app_begin' =>
|
||||
array (
|
||||
),
|
||||
'module_init' =>
|
||||
array (
|
||||
),
|
||||
'action_begin' =>
|
||||
array (
|
||||
),
|
||||
'view_filter' =>
|
||||
array (
|
||||
),
|
||||
'app_end' =>
|
||||
array (
|
||||
),
|
||||
'log_write' =>
|
||||
array (
|
||||
),
|
||||
);
|
||||
namespace app;
|
||||
|
||||
use think\Service;
|
||||
|
||||
/**
|
||||
* 应用服务类
|
||||
*/
|
||||
class AppService extends Service
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
// 服务注册
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
// 服务启动
|
||||
}
|
||||
}
|
||||
?>
|
104
app/BaseController.php
Normal file
104
app/BaseController.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app;
|
||||
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
*/
|
||||
abstract class BaseController
|
||||
{
|
||||
/**
|
||||
* Request实例
|
||||
* @var \think\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* 应用实例
|
||||
* @var \think\App
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* 是否批量验证
|
||||
* @var bool
|
||||
*/
|
||||
protected $batchValidate = false;
|
||||
|
||||
/**
|
||||
* 控制器中间件
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [];
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @access public
|
||||
* @param App $app 应用对象
|
||||
*/
|
||||
public function __construct(App $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->request = $this->app->request;
|
||||
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
protected function initialize()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 验证数据
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @param string|array $validate 验证器名或者验证规则数组
|
||||
* @param array $message 提示信息
|
||||
* @param bool $batch 是否批量验证
|
||||
* @return array|string|true
|
||||
* @throws ValidateException
|
||||
*/
|
||||
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
|
||||
{
|
||||
if (is_array($validate)) {
|
||||
$v = new Validate();
|
||||
$v->rule($validate);
|
||||
} else {
|
||||
if (strpos($validate, '.')) {
|
||||
// 支持场景
|
||||
[$validate, $scene] = explode('.', $validate);
|
||||
}
|
||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||
$v = new $class();
|
||||
if (!empty($scene)) {
|
||||
$v->scene($scene);
|
||||
}
|
||||
}
|
||||
|
||||
$v->message($message);
|
||||
|
||||
// 是否批量验证
|
||||
if ($batch || $this->batchValidate) {
|
||||
$v->batch(true);
|
||||
}
|
||||
|
||||
return $v->failException(true)->check($data);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
65
application/common/Http.php → app/ExceptionHandle.php
Executable file → Normal file
65
application/common/Http.php → app/ExceptionHandle.php
Executable file → Normal file
@ -8,34 +8,58 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\common;
|
||||
namespace app;
|
||||
|
||||
use Exception;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\Handle;
|
||||
use think\exception\HttpException;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\exception\ValidateException;
|
||||
use think\Response;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 异常处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
* 应用异常处理类
|
||||
*/
|
||||
class Http extends Handle
|
||||
class ExceptionHandle extends Handle
|
||||
{
|
||||
/**
|
||||
* 异常处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-01-14
|
||||
* @desc description
|
||||
* @param Exception $e [错误对象]
|
||||
* 不需要记录信息(日志)的异常类列表
|
||||
* @var array
|
||||
*/
|
||||
public function render(Exception $e)
|
||||
protected $ignoreReport = [
|
||||
HttpException::class,
|
||||
HttpResponseException::class,
|
||||
ModelNotFoundException::class,
|
||||
DataNotFoundException::class,
|
||||
ValidateException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* 记录异常信息(包括日志或者其它方式记录)
|
||||
*
|
||||
* @access public
|
||||
* @param Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $exception): void
|
||||
{
|
||||
// ajax请求处理
|
||||
// 使用内置的方式记录异常日志
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @access public
|
||||
* @param \think\Request $request
|
||||
* @param Throwable $e
|
||||
* @return Response
|
||||
*/
|
||||
public function render($request, Throwable $e): Response
|
||||
{
|
||||
// 添加自定义异常处理机制
|
||||
if(IS_AJAX)
|
||||
{
|
||||
// 参数验证错误
|
||||
@ -66,11 +90,10 @@ class Http extends Handle
|
||||
}
|
||||
}
|
||||
exit(json_encode(DataReturn($msg, $code)));
|
||||
|
||||
// web错误交给系统处理
|
||||
} else {
|
||||
return parent::render($e);
|
||||
}
|
||||
|
||||
// 其他错误交给系统处理
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
?>
|
8
application/command.php → app/Request.php
Executable file → Normal file
8
application/command.php → app/Request.php
Executable file → Normal file
@ -8,6 +8,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app;
|
||||
|
||||
return [];
|
||||
?>
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
|
||||
}
|
@ -12,25 +12,24 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 模板引擎类型 支持 php think 支持扩展
|
||||
'type' => 'Think',
|
||||
// 模板引擎类型使用Think
|
||||
'type' => 'Think',
|
||||
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
|
||||
'auto_rule' => 1,
|
||||
// 模板路径
|
||||
'view_path' => APP_PATH.'install'.DS.'view'.DS,
|
||||
'auto_rule' => 1,
|
||||
// 模板目录名
|
||||
'view_dir_name' => 'view'.DS.'default',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => DIRECTORY_SEPARATOR,
|
||||
'view_depr' => DIRECTORY_SEPARATOR,
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{{',
|
||||
'tpl_begin' => '{{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}}',
|
||||
'tpl_end' => '}}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '{{',
|
||||
'taglib_begin' => '{{',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '}}',
|
||||
'taglib_end' => '}}',
|
||||
];
|
||||
?>
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\AdminService;
|
||||
use app\service\SystemBaseService;
|
||||
|
||||
@ -76,10 +75,10 @@ class Admin extends Common
|
||||
$ret = AdminService::AdminList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,9 +106,9 @@ class Admin extends Common
|
||||
];
|
||||
$ret = AdminService::AdminList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -158,15 +157,15 @@ class Admin extends Common
|
||||
'field' => 'id,name',
|
||||
];
|
||||
$role = AdminService::RoleList($role_params);
|
||||
$this->assign('role_list', $role['data']);
|
||||
MyViewAssign('role_list', $role['data']);
|
||||
|
||||
$this->assign('id', isset($params['id']) ? $params['id'] : 0);
|
||||
$this->assign('common_gender_list', lang('common_gender_list'));
|
||||
$this->assign('common_admin_status_list', lang('common_admin_status_list'));
|
||||
MyViewAssign('id', isset($params['id']) ? $params['id'] : 0);
|
||||
MyViewAssign('common_gender_list', lang('common_gender_list'));
|
||||
MyViewAssign('common_admin_status_list', lang('common_admin_status_list'));
|
||||
|
||||
// 管理员编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_admin_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -177,9 +176,9 @@ class Admin extends Common
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,11 +256,11 @@ class Admin extends Common
|
||||
// 是否已登录
|
||||
if(AdminService::LoginInfo() !== null)
|
||||
{
|
||||
return redirect(MyUrl('admin/index/index'));
|
||||
return MyRedirect(MyUrl('admin/index/index'));
|
||||
}
|
||||
|
||||
// 登录方式
|
||||
$this->assign('admin_login_type', MyC('admin_login_type', [], true));
|
||||
MyViewAssign('admin_login_type', MyC('admin_login_type', [], true));
|
||||
|
||||
// 背景图片
|
||||
$host = SystemBaseService::AttachmentHost();
|
||||
@ -282,17 +281,17 @@ class Admin extends Common
|
||||
$host.'/static/admin/default/images/login/14.jpg',
|
||||
$host.'/static/admin/default/images/login/15.jpg',
|
||||
];
|
||||
$this->assign('bg_images_list', $bg_images_list);
|
||||
MyViewAssign('bg_images_list', $bg_images_list);
|
||||
|
||||
// 管理员登录页面钩子
|
||||
$hook_name = 'plugins_view_admin_login_info';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
]));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -366,7 +365,7 @@ class Admin extends Common
|
||||
public function Logout()
|
||||
{
|
||||
AdminService::LoginLogout();
|
||||
return redirect(MyUrl('admin/admin/logininfo'));
|
||||
return MyRedirect(MyUrl('admin/admin/logininfo'));
|
||||
}
|
||||
}
|
||||
?>
|
@ -52,10 +52,10 @@ class Agreement extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('agreement'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('agreement'));
|
||||
|
||||
// 导航数据
|
||||
$nav_data = [
|
||||
@ -68,12 +68,12 @@ class Agreement extends Common
|
||||
'type' => 'privacy',
|
||||
]
|
||||
];
|
||||
$this->assign('nav_data', $nav_data);
|
||||
MyViewAssign('nav_data', $nav_data);
|
||||
|
||||
// 导航/视图
|
||||
$nav_type = input('nav_type', 'register');
|
||||
$this->assign('nav_type', $nav_type);
|
||||
return $this->fetch($nav_type);
|
||||
MyViewAssign('nav_type', $nav_type);
|
||||
return MyView($nav_type);
|
||||
}
|
||||
|
||||
/**
|
@ -73,10 +73,10 @@ class Answer extends Common
|
||||
$ret = AnswerService::AnswerList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,9 +105,9 @@ class Answer extends Common
|
||||
];
|
||||
$ret = AnswerService::AnswerList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,16 +150,16 @@ class Answer extends Common
|
||||
|
||||
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_is_show_list', lang('common_is_show_list'));
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_show_list', lang('common_is_show_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 参数
|
||||
unset($params['id']);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -73,10 +73,10 @@ class AppCenterNav extends Common
|
||||
$ret = AppCenterNavService::AppCenterNavList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,9 +103,9 @@ class AppCenterNav extends Common
|
||||
];
|
||||
$ret = AppCenterNavService::AppCenterNavList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,17 +136,17 @@ class AppCenterNav extends Common
|
||||
}
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
$this->assign('common_app_event_type', lang('common_app_event_type'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_app_event_type', lang('common_app_event_type'));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('app_center_nav'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('app_center_nav'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('params', $params);
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $params);
|
||||
MyViewAssign('data', $data);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,15 +50,15 @@ class AppConfig extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
// 是否
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 导航/视图
|
||||
$nav_type = input('nav_type', 'base');
|
||||
$this->assign('nav_type', $nav_type);
|
||||
return $this->fetch($nav_type);
|
||||
MyViewAssign('nav_type', $nav_type);
|
||||
return MyView($nav_type);
|
||||
}
|
||||
|
||||
/**
|
@ -73,10 +73,10 @@ class AppHomeNav extends Common
|
||||
$ret = AppHomeNavService::AppHomeNavList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,9 +103,9 @@ class AppHomeNav extends Common
|
||||
];
|
||||
$ret = AppHomeNavService::AppHomeNavList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,17 +136,17 @@ class AppHomeNav extends Common
|
||||
}
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
$this->assign('common_app_event_type', lang('common_app_event_type'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_app_event_type', lang('common_app_event_type'));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('app_nav'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('app_nav'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('params', $params);
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $params);
|
||||
MyViewAssign('data', $data);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -75,15 +75,15 @@ class Appmini extends Common
|
||||
// 首页
|
||||
case 'index' :
|
||||
// 默认主题
|
||||
$this->assign('theme', AppMiniService::DefaultTheme());
|
||||
MyViewAssign('theme', AppMiniService::DefaultTheme());
|
||||
|
||||
// 获取主题列表
|
||||
$data = AppMiniService::ThemeList($this->params);
|
||||
$this->assign('data_list', $data);
|
||||
MyViewAssign('data_list', $data);
|
||||
|
||||
// 插件更新信息
|
||||
$upgrade = AppMiniService::AppMiniUpgradeInfo(['terminal'=>$this->params['application_name'], 'data'=>$data]);
|
||||
$this->assign('upgrade_info', $upgrade['data']);
|
||||
MyViewAssign('upgrade_info', $upgrade['data']);
|
||||
break;
|
||||
|
||||
// 源码包列表
|
||||
@ -91,7 +91,7 @@ class Appmini extends Common
|
||||
$this->Package();
|
||||
break;
|
||||
}
|
||||
return $this->fetch($this->view_type);
|
||||
return MyView($this->view_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,7 +104,7 @@ class Appmini extends Common
|
||||
*/
|
||||
public function Package()
|
||||
{
|
||||
$host = config('shopxo.website_url');
|
||||
$host = MyConfig('shopxo.website_url');
|
||||
$nav_dev_tips = [
|
||||
// 微信
|
||||
'weixin' => [
|
||||
@ -132,11 +132,11 @@ class Appmini extends Common
|
||||
'url' => $host.'qq.html',
|
||||
],
|
||||
];
|
||||
$this->assign('nav_dev_tips', $nav_dev_tips);
|
||||
MyViewAssign('nav_dev_tips', $nav_dev_tips);
|
||||
|
||||
// 源码包列表
|
||||
$ret = AppMiniService::DownloadDataList($this->params);
|
||||
$this->assign('data_list', $ret['data']);
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,19 +150,19 @@ class Appmini extends Common
|
||||
public function CurrentViewInit()
|
||||
{
|
||||
// 操作导航类型
|
||||
$this->assign('nav_type', $this->params['application_name']);
|
||||
MyViewAssign('nav_type', $this->params['application_name']);
|
||||
|
||||
// 操作页面类型
|
||||
$this->assign('view_type', $this->view_type);
|
||||
MyViewAssign('view_type', $this->view_type);
|
||||
|
||||
// 应用商店
|
||||
$this->assign('store_theme_url', StoreService::StoreThemeUrl());
|
||||
MyViewAssign('store_theme_url', StoreService::StoreThemeUrl());
|
||||
|
||||
// 小程序平台
|
||||
$this->assign('common_appmini_type', lang('common_appmini_type'));
|
||||
MyViewAssign('common_appmini_type', lang('common_appmini_type'));
|
||||
|
||||
// 是否
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 基础导航
|
||||
$base_nav = [
|
||||
@ -179,7 +179,7 @@ class Appmini extends Common
|
||||
'name' => '源码包下载',
|
||||
],
|
||||
];
|
||||
$this->assign('base_nav', $base_nav);
|
||||
MyViewAssign('base_nav', $base_nav);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -234,8 +234,8 @@ class Appmini extends Common
|
||||
$ret = AppMiniService::ThemeDownload($params);
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $ret['msg']);
|
||||
return MyView('public/tips_error');
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
@ -276,8 +276,8 @@ class Appmini extends Common
|
||||
$this->CurrentViewInit();
|
||||
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\ArticleService;
|
||||
use app\service\ResourcesService;
|
||||
|
||||
@ -74,10 +73,10 @@ class Article extends Common
|
||||
$ret = ArticleService::ArticleList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,9 +103,9 @@ class Article extends Common
|
||||
];
|
||||
$ret = ArticleService::ArticleList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,11 +136,11 @@ class Article extends Common
|
||||
|
||||
// 文章分类
|
||||
$article_category = ArticleService::ArticleCategoryList(['field'=>'id,name']);
|
||||
$this->assign('article_category_list', $article_category['data']);
|
||||
MyViewAssign('article_category_list', $article_category['data']);
|
||||
|
||||
// 文章编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_article_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -151,13 +150,13 @@ class Article extends Common
|
||||
]));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('article'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('article'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,9 +50,9 @@ class ArticleCategory extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\BrandService;
|
||||
use app\service\BrandCategoryService;
|
||||
use app\service\ResourcesService;
|
||||
@ -75,10 +74,10 @@ class Brand extends Common
|
||||
$ret = BrandService::BrandList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,9 +104,9 @@ class Brand extends Common
|
||||
];
|
||||
$ret = BrandService::BrandList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -138,15 +137,15 @@ class Brand extends Common
|
||||
}
|
||||
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
// 品牌分类
|
||||
$brand_category = BrandCategoryService::BrandCategoryList(['field'=>'id,name']);
|
||||
$this->assign('brand_category', $brand_category['data']);
|
||||
MyViewAssign('brand_category', $brand_category['data']);
|
||||
|
||||
// 编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_brand_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -156,13 +155,13 @@ class Brand extends Common
|
||||
]));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('brand'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('brand'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,9 +50,9 @@ class BrandCategory extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,9 +50,9 @@ class Cache extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 缓存类型
|
||||
$this->assign('cache_type_list', CacheService::AdminCacheTypeList());
|
||||
MyViewAssign('cache_type_list', CacheService::AdminCacheTypeList());
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,10 +65,13 @@ class Cache extends Common
|
||||
public function StatusUpdate()
|
||||
{
|
||||
// 模板 cache
|
||||
// 数据 temp
|
||||
// 系统配置缓存 data
|
||||
// 模板数据 temp
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'cache');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'data');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'admin'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'temp');
|
||||
|
||||
// 缓存操作清除
|
||||
\think\facade\Cache::clear();
|
||||
@ -86,7 +89,9 @@ class Cache extends Common
|
||||
public function TemplateUpdate()
|
||||
{
|
||||
// 模板 cache
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'cache');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'admin'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'temp');
|
||||
|
||||
return $this->success('更新成功');
|
||||
}
|
||||
@ -112,7 +117,9 @@ class Cache extends Common
|
||||
*/
|
||||
public function LogDelete()
|
||||
{
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'log');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'admin'.DS.'log');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'log');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'log');
|
||||
|
||||
return $this->success('更新成功');
|
||||
}
|
@ -10,15 +10,15 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use think\Controller;
|
||||
use app\BaseController;
|
||||
use app\module\FormHandleModule;
|
||||
use app\service\SystemService;
|
||||
use app\service\SystemBaseService;
|
||||
use app\service\AdminService;
|
||||
use app\service\AdminPowerService;
|
||||
use app\service\ConfigService;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\StoreService;
|
||||
use app\service\SystemBaseService;
|
||||
|
||||
/**
|
||||
* 管理员公共控制器
|
||||
@ -27,7 +27,7 @@ use app\service\SystemBaseService;
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Common extends Controller
|
||||
class Common extends BaseController
|
||||
{
|
||||
// 管理员
|
||||
protected $admin;
|
||||
@ -68,7 +68,8 @@ class Common extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 检测是否是新安装
|
||||
SystemService::SystemInstallCheck();
|
||||
|
||||
// 输入参数
|
||||
$this->data_post = input('post.');
|
||||
@ -95,72 +96,6 @@ class Common extends Controller
|
||||
$this->CommonPluginsInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共钩子初始化
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-07
|
||||
* @desc description
|
||||
*/
|
||||
private function CommonPluginsInit()
|
||||
{
|
||||
// css钩子
|
||||
$this->assign('plugins_admin_css_data', Hook::listen('plugins_admin_css', ['hook_name'=>'plugins_admin_css', 'is_backend'=>true]));
|
||||
|
||||
// js钩子
|
||||
$this->assign('plugins_admin_js_data', Hook::listen('plugins_admin_js', ['hook_name'=>'plugins_admin_js', 'is_backend'=>true]));
|
||||
|
||||
// 公共header内钩子
|
||||
$this->assign('plugins_admin_common_header_data', Hook::listen('plugins_admin_common_header', ['hook_name'=>'plugins_admin_common_header', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共页面底部钩子
|
||||
$this->assign('plugins_admin_common_page_bottom_data', Hook::listen('plugins_admin_common_page_bottom', ['hook_name'=>'plugins_admin_common_page_bottom', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共顶部钩子
|
||||
$this->assign('plugins_admin_view_common_top_data', Hook::listen('plugins_admin_view_common_top', ['hook_name'=>'plugins_admin_view_common_top', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共底部钩子
|
||||
$this->assign('plugins_admin_view_common_bottom_data', Hook::listen('plugins_admin_view_common_bottom', ['hook_name'=>'plugins_admin_view_common_bottom', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共表格钩子名称动态处理
|
||||
$current = 'plugins_view_admin_'.$this->controller_name;
|
||||
|
||||
// 是否插件默认下
|
||||
if($this->controller_name == 'plugins')
|
||||
{
|
||||
if(!empty($this->data_request['pluginsname']))
|
||||
{
|
||||
$current .= '_'.trim($this->data_request['pluginsname']);
|
||||
}
|
||||
}
|
||||
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_content_top', $current.'_content_top');
|
||||
// 内容外部底部
|
||||
$this->assign('hook_name_content_bottom', $current.'_content_bottom');
|
||||
// 内容内部顶部
|
||||
$this->assign('hook_name_content_inside_top', $current.'_content_inside_top');
|
||||
// 内容内部底部
|
||||
$this->assign('hook_name_content_inside_bottom', $current.'_content_inside_bottom');
|
||||
// 表格列表顶部操作
|
||||
$this->assign('hook_name_form_top_operate', $current.'_top_operate');
|
||||
// 表格列表底部操作
|
||||
$this->assign('hook_name_form_bottom_operate', $current.'_bottom_operate');
|
||||
// 表格列表后面操作栏
|
||||
$this->assign('hook_name_form_list_operate', $current.'_list_operate');
|
||||
|
||||
// 公共详情页面钩子名称动态处理
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_detail_top', $current.'_detail_top');
|
||||
// 内容外部底部
|
||||
$this->assign('hook_name_detail_bottom', $current.'_detail_bottom');
|
||||
// 内容内部顶部
|
||||
$this->assign('hook_name_detail_inside_top', $current.'_detail_inside_top');
|
||||
// 内容内部底部
|
||||
$this->assign('hook_name_detail_inside_bottom', $current.'_detail_inside_bottom');
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统初始化
|
||||
* @author Devil
|
||||
@ -173,9 +108,6 @@ class Common extends Controller
|
||||
{
|
||||
// 配置信息初始化
|
||||
ConfigService::ConfigInit();
|
||||
|
||||
// url模式,后端采用兼容模式
|
||||
\think\facade\Url::root(__MY_ROOT_PUBLIC__.CurrentScriptName().'?s=');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,75 +141,75 @@ class Common extends Controller
|
||||
{
|
||||
// 主题
|
||||
$default_theme = 'default';
|
||||
$this->assign('default_theme', $default_theme);
|
||||
MyViewAssign('default_theme', $default_theme);
|
||||
|
||||
// 当前操作名称
|
||||
$this->module_name = strtolower(request()->module());
|
||||
$this->controller_name = strtolower(request()->controller());
|
||||
$this->action_name = strtolower(request()->action());
|
||||
$this->module_name = RequestModule();
|
||||
$this->controller_name = RequestController();
|
||||
$this->action_name = RequestAction();
|
||||
|
||||
// 当前操作名称
|
||||
$this->assign('module_name', $this->module_name);
|
||||
$this->assign('controller_name', $this->controller_name);
|
||||
$this->assign('action_name', $this->action_name);
|
||||
MyViewAssign('module_name', $this->module_name);
|
||||
MyViewAssign('controller_name', $this->controller_name);
|
||||
MyViewAssign('action_name', $this->action_name);
|
||||
|
||||
// 管理员
|
||||
$this->assign('admin', $this->admin);
|
||||
MyViewAssign('admin', $this->admin);
|
||||
|
||||
// 权限菜单
|
||||
$this->assign('left_menu', $this->left_menu);
|
||||
MyViewAssign('left_menu', $this->left_menu);
|
||||
|
||||
// 分页信息
|
||||
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
|
||||
$this->page_size = MyC('common_page_size', 10, true);
|
||||
$this->assign('page', $this->page);
|
||||
$this->assign('page_size', $this->page_size);
|
||||
MyViewAssign('page', $this->page);
|
||||
MyViewAssign('page_size', $this->page_size);
|
||||
|
||||
// 货币符号
|
||||
$this->assign('currency_symbol', ResourcesService::CurrencyDataSymbol());
|
||||
MyViewAssign('currency_symbol', ResourcesService::CurrencyDataSymbol());
|
||||
|
||||
// 控制器静态文件状态css,js
|
||||
$module_css = $this->module_name.DS.$default_theme.DS.'css'.DS.$this->controller_name;
|
||||
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$this->action_name.'.css') ? '.'.$this->action_name.'.css' : '.css';
|
||||
$this->assign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
|
||||
MyViewAssign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
|
||||
|
||||
$module_js = $this->module_name.DS.$default_theme.DS.'js'.DS.$this->controller_name;
|
||||
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$this->action_name.'.js') ? '.'.$this->action_name.'.js' : '.js';
|
||||
$this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
|
||||
MyViewAssign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
|
||||
|
||||
// 价格正则
|
||||
$this->assign('default_price_regex', lang('common_regex_price'));
|
||||
MyViewAssign('default_price_regex', lang('common_regex_price'));
|
||||
|
||||
// 附件host地址
|
||||
$this->assign('attachment_host', SystemBaseService::AttachmentHost());
|
||||
MyViewAssign('attachment_host', SystemBaseService::AttachmentHost());
|
||||
|
||||
// css/js引入host地址
|
||||
$this->assign('public_host', config('shopxo.public_host'));
|
||||
MyViewAssign('public_host', MyConfig('shopxo.public_host'));
|
||||
|
||||
// 当前url地址
|
||||
$this->assign('my_url', __MY_URL__);
|
||||
MyViewAssign('my_url', __MY_URL__);
|
||||
|
||||
// 项目public目录URL地址
|
||||
$this->assign('my_public_url', __MY_PUBLIC_URL__);
|
||||
MyViewAssign('my_public_url', __MY_PUBLIC_URL__);
|
||||
|
||||
// 当前http类型
|
||||
$this->assign('my_http', __MY_HTTP__);
|
||||
MyViewAssign('my_http', __MY_HTTP__);
|
||||
|
||||
// 开发模式
|
||||
$this->assign('shopxo_is_develop', config('shopxo.is_develop'));
|
||||
MyViewAssign('shopxo_is_develop', MyConfig('shopxo.is_develop'));
|
||||
|
||||
// 默认不加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 0);
|
||||
MyViewAssign('is_load_baidu_map_api', 0);
|
||||
|
||||
// 布局样式+管理
|
||||
$this->assign('is_load_layout', 0);
|
||||
$this->assign('is_load_layout_admin', 0);
|
||||
MyViewAssign('is_load_layout', 0);
|
||||
MyViewAssign('is_load_layout_admin', 0);
|
||||
|
||||
// 是否加载附件组件
|
||||
$this->assign('is_load_upload_editor', !empty($this->admin) ? 1 : 0);
|
||||
MyViewAssign('is_load_upload_editor', !empty($this->admin) ? 1 : 0);
|
||||
|
||||
// 站点名称
|
||||
$this->assign('admin_theme_site_name', MyC('admin_theme_site_name', 'ShopXO', true));
|
||||
MyViewAssign('admin_theme_site_name', MyC('admin_theme_site_name', 'ShopXO', true));
|
||||
|
||||
// 站点商店信息
|
||||
$site_store_info = StoreService::SiteStoreInfo();
|
||||
@ -289,11 +221,11 @@ class Common extends Controller
|
||||
$site_store_info = StoreService::SiteStoreInfo();
|
||||
}
|
||||
}
|
||||
$this->assign('site_store_info', $site_store_info);
|
||||
MyViewAssign('site_store_info', $site_store_info);
|
||||
|
||||
// 系统基础信息
|
||||
$is_system_show_base = (empty($site_store_info) || empty($site_store_info['vip']) || !isset($site_store_info['vip']['status']) || $site_store_info['vip']['status'] == 0 || ($site_store_info['vip']['status'] == 1 && (AdminIsPower('index', 'storeaccountsbind') || AdminIsPower('index', 'inspectupgrade')))) ? 1 : 0;
|
||||
$this->assign('is_system_show_base', $is_system_show_base);
|
||||
MyViewAssign('is_system_show_base', $is_system_show_base);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -323,14 +255,14 @@ class Common extends Controller
|
||||
$this->form_user_fields = $ret['data']['user_fields'];
|
||||
$this->form_order_by = $ret['data']['order_by'];
|
||||
|
||||
$this->assign('form_table', $this->form_table);
|
||||
$this->assign('form_params', $this->form_params);
|
||||
$this->assign('form_md5_key', $this->form_md5_key);
|
||||
$this->assign('form_user_fields', $this->form_user_fields);
|
||||
$this->assign('form_order_by', $this->form_order_by);
|
||||
MyViewAssign('form_table', $this->form_table);
|
||||
MyViewAssign('form_params', $this->form_params);
|
||||
MyViewAssign('form_md5_key', $this->form_md5_key);
|
||||
MyViewAssign('form_user_fields', $this->form_user_fields);
|
||||
MyViewAssign('form_order_by', $this->form_order_by);
|
||||
} else {
|
||||
$this->form_error = $ret['msg'];
|
||||
$this->assign('form_error', $this->form_error);
|
||||
MyViewAssign('form_error', $this->form_error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -358,22 +290,130 @@ class Common extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* [_empty 空方法操作]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-02-25T15:47:50+0800
|
||||
* @param [string] $name [方法名称]
|
||||
* 成功提示
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-07-15
|
||||
* @desc description
|
||||
* @param [string] $msg [提示信息、默认(操作成功)]
|
||||
*/
|
||||
public function _empty($name)
|
||||
public function success($msg)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
{
|
||||
exit(json_encode(DataReturn($name.' 非法访问', -1000)));
|
||||
return DataReturn($msg, 0);
|
||||
} else {
|
||||
$this->assign('msg', $name.' 非法访问');
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $msg);
|
||||
return MyView('public/jump_success');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误提示
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-07-15
|
||||
* @desc description
|
||||
* @param [string] $msg [提示信息、默认(操作失败)]
|
||||
*/
|
||||
public function error($msg)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
{
|
||||
return DataReturn($msg, -1);
|
||||
} else {
|
||||
MyViewAssign('msg', $msg);
|
||||
return MyView('public/jump_error');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 空方法响应
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
* @param [string] $method [方法名称]
|
||||
* @param [array] $args [参数]
|
||||
*/
|
||||
public function __call($method, $args)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
{
|
||||
return DataReturn($method.' 非法访问', -1000);
|
||||
} else {
|
||||
MyViewAssign('msg', $method.' 非法访问');
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共钩子初始化
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-07
|
||||
* @desc description
|
||||
*/
|
||||
private function CommonPluginsInit()
|
||||
{
|
||||
// css钩子
|
||||
MyViewAssign('plugins_admin_css_data', MyEventTrigger('plugins_admin_css', ['hook_name'=>'plugins_admin_css', 'is_backend'=>true]));
|
||||
|
||||
// js钩子
|
||||
MyViewAssign('plugins_admin_js_data', MyEventTrigger('plugins_admin_js', ['hook_name'=>'plugins_admin_js', 'is_backend'=>true]));
|
||||
|
||||
// 公共header内钩子
|
||||
MyViewAssign('plugins_admin_common_header_data', MyEventTrigger('plugins_admin_common_header', ['hook_name'=>'plugins_admin_common_header', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共页面底部钩子
|
||||
MyViewAssign('plugins_admin_common_page_bottom_data', MyEventTrigger('plugins_admin_common_page_bottom', ['hook_name'=>'plugins_admin_common_page_bottom', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共顶部钩子
|
||||
MyViewAssign('plugins_admin_view_common_top_data', MyEventTrigger('plugins_admin_view_common_top', ['hook_name'=>'plugins_admin_view_common_top', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共底部钩子
|
||||
MyViewAssign('plugins_admin_view_common_bottom_data', MyEventTrigger('plugins_admin_view_common_bottom', ['hook_name'=>'plugins_admin_view_common_bottom', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共表格钩子名称动态处理
|
||||
$current = 'plugins_view_admin_'.$this->controller_name;
|
||||
|
||||
// 是否插件默认下
|
||||
if($this->controller_name == 'plugins')
|
||||
{
|
||||
if(!empty($this->data_request['pluginsname']))
|
||||
{
|
||||
$current .= '_'.trim($this->data_request['pluginsname']);
|
||||
}
|
||||
}
|
||||
|
||||
// 内容外部顶部
|
||||
MyViewAssign('hook_name_content_top', $current.'_content_top');
|
||||
// 内容外部底部
|
||||
MyViewAssign('hook_name_content_bottom', $current.'_content_bottom');
|
||||
// 内容内部顶部
|
||||
MyViewAssign('hook_name_content_inside_top', $current.'_content_inside_top');
|
||||
// 内容内部底部
|
||||
MyViewAssign('hook_name_content_inside_bottom', $current.'_content_inside_bottom');
|
||||
// 表格列表顶部操作
|
||||
MyViewAssign('hook_name_form_top_operate', $current.'_top_operate');
|
||||
// 表格列表底部操作
|
||||
MyViewAssign('hook_name_form_bottom_operate', $current.'_bottom_operate');
|
||||
// 表格列表后面操作栏
|
||||
MyViewAssign('hook_name_form_list_operate', $current.'_list_operate');
|
||||
|
||||
// 公共详情页面钩子名称动态处理
|
||||
// 内容外部顶部
|
||||
MyViewAssign('hook_name_detail_top', $current.'_detail_top');
|
||||
// 内容外部底部
|
||||
MyViewAssign('hook_name_detail_bottom', $current.'_detail_bottom');
|
||||
// 内容内部顶部
|
||||
MyViewAssign('hook_name_detail_inside_top', $current.'_detail_inside_top');
|
||||
// 内容内部底部
|
||||
MyViewAssign('hook_name_detail_inside_bottom', $current.'_detail_inside_bottom');
|
||||
}
|
||||
}
|
||||
?>
|
@ -50,16 +50,16 @@ class Config extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 静态数据
|
||||
$this->assign('common_excel_charset_list', lang('common_excel_charset_list'));
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
$this->assign('common_login_type_list', lang('common_login_type_list'));
|
||||
$this->assign('common_close_open_list', lang('common_close_open_list'));
|
||||
MyViewAssign('common_excel_charset_list', lang('common_excel_charset_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_login_type_list', lang('common_login_type_list'));
|
||||
MyViewAssign('common_close_open_list', lang('common_close_open_list'));
|
||||
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
$this->assign('view_type', 'index');
|
||||
return $this->fetch();
|
||||
MyViewAssign('view_type', 'index');
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,10 +72,10 @@ class Config extends Common
|
||||
public function Store()
|
||||
{
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
$this->assign('view_type', 'store');
|
||||
return $this->fetch();
|
||||
MyViewAssign('view_type', 'store');
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -72,10 +72,10 @@ class CustomView extends Common
|
||||
$ret = CustomViewService::CustomViewList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,9 +102,9 @@ class CustomView extends Common
|
||||
];
|
||||
$ret = CustomViewService::CustomViewList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,9 +134,9 @@ class CustomView extends Common
|
||||
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
|
||||
}
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -77,10 +77,10 @@ class Design extends Common
|
||||
$ret = DesignService::DesignList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,10 +99,10 @@ class Design extends Common
|
||||
$ret = DesignService::DesignSave();
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
return redirect(MyUrl('admin/design/saveinfo', ['id'=>$ret['data']]));
|
||||
return MyRedirect(MyUrl('admin/design/saveinfo', ['id'=>$ret['data']]));
|
||||
} else {
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $ret['msg']);
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,50 +117,50 @@ class Design extends Common
|
||||
$ret = DesignService::DesignList($data_params);
|
||||
if(empty($ret['data']) || empty($ret['data'][0]))
|
||||
{
|
||||
$this->assign('to_title', '去添加 >>');
|
||||
$this->assign('to_url', MyUrl('admin/design/saveinfo'));
|
||||
$this->assign('msg', '编辑数据为空、请重新添加');
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('to_title', '去添加 >>');
|
||||
MyViewAssign('to_url', MyUrl('admin/design/saveinfo'));
|
||||
MyViewAssign('msg', '编辑数据为空、请重新添加');
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
$data = $ret['data'][0];
|
||||
|
||||
// 配置处理
|
||||
$layout_data = BaseLayout::ConfigAdminHandle($data['config']);
|
||||
$this->assign('layout_data', $layout_data);
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('layout_data', $layout_data);
|
||||
MyViewAssign('data', $data);
|
||||
unset($data['config']);
|
||||
|
||||
// 页面列表
|
||||
$pages_list = BaseLayout::PagesList();
|
||||
$this->assign('pages_list', $pages_list);
|
||||
MyViewAssign('pages_list', $pages_list);
|
||||
|
||||
// 商品分类
|
||||
$goods_category = GoodsService::GoodsCategoryAll();
|
||||
$this->assign('goods_category_list', $goods_category);
|
||||
MyViewAssign('goods_category_list', $goods_category);
|
||||
|
||||
// 商品搜索分类(分类)
|
||||
$this->assign('layout_goods_category', $goods_category);
|
||||
$this->assign('layout_goods_category_field', 'gci.category_id');
|
||||
MyViewAssign('layout_goods_category', $goods_category);
|
||||
MyViewAssign('layout_goods_category_field', 'gci.category_id');
|
||||
|
||||
// 品牌
|
||||
$this->assign('brand_list', BrandService::CategoryBrand());
|
||||
MyViewAssign('brand_list', BrandService::CategoryBrand());
|
||||
|
||||
// 静态数据
|
||||
$this->assign('border_style_type_list', BaseLayout::$border_style_type_list);
|
||||
$this->assign('goods_view_list_show_style', BaseLayout::$goods_view_list_show_style);
|
||||
$this->assign('many_images_view_list_show_style', BaseLayout::$many_images_view_list_show_style);
|
||||
MyViewAssign('border_style_type_list', BaseLayout::$border_style_type_list);
|
||||
MyViewAssign('goods_view_list_show_style', BaseLayout::$goods_view_list_show_style);
|
||||
MyViewAssign('many_images_view_list_show_style', BaseLayout::$many_images_view_list_show_style);
|
||||
|
||||
// 首页商品排序规则
|
||||
$this->assign('goods_order_by_type_list', lang('goods_order_by_type_list'));
|
||||
$this->assign('goods_order_by_rule_list', lang('goods_order_by_rule_list'));
|
||||
MyViewAssign('goods_order_by_type_list', lang('goods_order_by_type_list'));
|
||||
MyViewAssign('goods_order_by_rule_list', lang('goods_order_by_rule_list'));
|
||||
|
||||
// 加载布局样式+管理
|
||||
$this->assign('is_load_layout', 1);
|
||||
$this->assign('is_load_layout_admin', 1);
|
||||
MyViewAssign('is_load_layout', 1);
|
||||
MyViewAssign('is_load_layout_admin', 1);
|
||||
|
||||
// 编辑器文件存放地址定义
|
||||
$this->assign('editor_path_type', DesignService::AttachmentPathTypeValue($data['id']));
|
||||
return $this->fetch();
|
||||
MyViewAssign('editor_path_type', DesignService::AttachmentPathTypeValue($data['id']));
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,19 +50,19 @@ class Email extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
$type = input('type', 'email');
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 导航
|
||||
$this->assign('nav_type', $type);
|
||||
MyViewAssign('nav_type', $type);
|
||||
if($type == 'email')
|
||||
{
|
||||
return $this->fetch('index');
|
||||
return MyView('index');
|
||||
} else {
|
||||
return $this->fetch('message');
|
||||
return MyView('message');
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 空控制器响应
|
||||
* @author Devil
|
||||
@ -29,16 +27,17 @@ class Error extends Common
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
* @param Request $request [参数]
|
||||
* @param [string] $method [方法名称]
|
||||
* @param [array] $args [参数]
|
||||
*/
|
||||
public function Index(Request $request)
|
||||
public function __call($method, $args)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
{
|
||||
exit(json_encode(DataReturn($request->controller().' 控制器不存在', -1000)));
|
||||
return DataReturn(RequestController().' 控制器不存在', -1000);
|
||||
} else {
|
||||
$this->assign('msg', $request->controller().' 控制器不存在');
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', RequestController().' 控制器不存在');
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
}
|
||||
}
|
@ -51,12 +51,12 @@ class Express extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('express'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('express'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\SystemBaseService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\RegionService;
|
||||
@ -79,10 +78,10 @@ class Goods extends Common
|
||||
$ret = GoodsService::GoodsList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,20 +118,20 @@ class Goods extends Common
|
||||
|
||||
// 获取商品编辑规格
|
||||
$specifications = GoodsService::GoodsEditSpecifications($data['id']);
|
||||
$this->assign('specifications', $specifications);
|
||||
MyViewAssign('specifications', $specifications);
|
||||
|
||||
// 获取商品编辑参数
|
||||
$parameters = GoodsService::GoodsEditParameters($data['id']);
|
||||
|
||||
// 商品参数类型
|
||||
$this->assign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
|
||||
$this->assign('parameters', $parameters);
|
||||
MyViewAssign('parameters', $parameters);
|
||||
}
|
||||
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,33 +174,33 @@ class Goods extends Common
|
||||
|
||||
// 获取商品编辑规格
|
||||
$specifications = GoodsService::GoodsEditSpecifications($data['id']);
|
||||
$this->assign('specifications', $specifications);
|
||||
MyViewAssign('specifications', $specifications);
|
||||
|
||||
// 获取商品编辑参数
|
||||
$parameters = GoodsService::GoodsEditParameters($data['id']);
|
||||
$this->assign('parameters', $parameters);
|
||||
MyViewAssign('parameters', $parameters);
|
||||
}
|
||||
|
||||
// 地区信息
|
||||
$this->assign('region_province_list', RegionService::RegionItems(['pid'=>0]));
|
||||
MyViewAssign('region_province_list', RegionService::RegionItems(['pid'=>0]));
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
// 品牌
|
||||
$this->assign('brand_list', BrandService::CategoryBrand());
|
||||
MyViewAssign('brand_list', BrandService::CategoryBrand());
|
||||
|
||||
// 规格扩展数据
|
||||
$goods_spec_extends = GoodsService::GoodsSpecificationsExtends($params);
|
||||
$this->assign('goods_specifications_extends', $goods_spec_extends['data']);
|
||||
MyViewAssign('goods_specifications_extends', $goods_spec_extends['data']);
|
||||
|
||||
// 站点类型
|
||||
$this->assign('common_site_type_list', lang('common_site_type_list'));
|
||||
MyViewAssign('common_site_type_list', lang('common_site_type_list'));
|
||||
// 当前系统设置的站点类型
|
||||
$this->assign('common_site_type', SystemBaseService::SiteTypeValue());
|
||||
MyViewAssign('common_site_type', SystemBaseService::SiteTypeValue());
|
||||
|
||||
// 商品参数类型
|
||||
$this->assign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
|
||||
// 商品参数模板
|
||||
$data_params = array(
|
||||
@ -214,14 +213,14 @@ class Goods extends Common
|
||||
'field' => 'id,name',
|
||||
);
|
||||
$template = GoodsParamsService::GoodsParamsTemplateList($data_params);
|
||||
$this->assign('goods_template_list', $template['data']);
|
||||
MyViewAssign('goods_template_list', $template['data']);
|
||||
|
||||
// 是否拷贝
|
||||
$this->assign('is_copy', (isset($params['is_copy']) && $params['is_copy'] == 1) ? 1 : 0);
|
||||
MyViewAssign('is_copy', (isset($params['is_copy']) && $params['is_copy'] == 1) ? 1 : 0);
|
||||
|
||||
// 商品编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_goods_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -231,13 +230,13 @@ class Goods extends Common
|
||||
]));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('goods'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('goods'));
|
||||
|
||||
// 数据
|
||||
unset($params['id'], $params['is_copy']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -76,10 +76,10 @@ class GoodsBrowse extends Common
|
||||
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,9 +109,9 @@ class GoodsBrowse extends Common
|
||||
];
|
||||
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -51,15 +51,15 @@ class GoodsCategory extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 静态数据
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('goods_category'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('goods_category'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -73,10 +73,10 @@ class Goodscomments extends Common
|
||||
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,11 +103,11 @@ class Goodscomments extends Common
|
||||
];
|
||||
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
$this->assign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list'));
|
||||
MyViewAssign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list'));
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,18 +136,18 @@ class Goodscomments extends Common
|
||||
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
|
||||
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_is_show_list', lang('common_is_show_list'));
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
$this->assign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list'));
|
||||
$this->assign('common_goods_comments_business_type_list', lang('common_goods_comments_business_type_list'));
|
||||
MyViewAssign('common_is_show_list', lang('common_is_show_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list'));
|
||||
MyViewAssign('common_goods_comments_business_type_list', lang('common_goods_comments_business_type_list'));
|
||||
|
||||
// 参数
|
||||
unset($params['id']);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -76,10 +76,10 @@ class Goodsfavor extends Common
|
||||
$ret = GoodsFavorService::GoodsFavorList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,9 +109,9 @@ class Goodsfavor extends Common
|
||||
];
|
||||
$ret = GoodsFavorService::GoodsFavorList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\GoodsParamsService;
|
||||
|
||||
/**
|
||||
@ -76,10 +75,10 @@ class GoodsParamsTemplate extends Common
|
||||
$ret = GoodsParamsService::GoodsParamsTemplateList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,15 +106,15 @@ class GoodsParamsTemplate extends Common
|
||||
];
|
||||
$ret = GoodsParamsService::GoodsParamsTemplateList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 商品参数类型
|
||||
$this->assign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
|
||||
// 参数配置
|
||||
$this->assign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
|
||||
MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -147,14 +146,14 @@ class GoodsParamsTemplate extends Common
|
||||
}
|
||||
|
||||
// 商品参数类型
|
||||
$this->assign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
|
||||
// 参数配置
|
||||
$this->assign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
|
||||
MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
|
||||
|
||||
// 编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_goods_params_template_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -165,9 +164,9 @@ class GoodsParamsTemplate extends Common
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -57,8 +57,8 @@ class Index extends Common
|
||||
$to_url = base64_decode(urldecode($this->data_request['to_url']));
|
||||
}
|
||||
|
||||
$this->assign('to_url', $to_url);
|
||||
return $this->fetch();
|
||||
MyViewAssign('to_url', $to_url);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +71,7 @@ class Index extends Common
|
||||
public function Init()
|
||||
{
|
||||
// 系统信息
|
||||
$mysql_ver = db()->query('SELECT VERSION() AS `ver`');
|
||||
$mysql_ver = \think\facade\Db::query('SELECT VERSION() AS `ver`');
|
||||
$data = array(
|
||||
'server_ver' => php_sapi_name(),
|
||||
'php_ver' => PHP_VERSION,
|
||||
@ -80,41 +80,41 @@ class Index extends Common
|
||||
'host' => isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '',
|
||||
'ver' => 'ShopXO'.' '.APPLICATION_VERSION,
|
||||
);
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 用户
|
||||
$user = StatisticalService::UserYesterdayTodayTotal();
|
||||
$this->assign('user', $user['data']);
|
||||
MyViewAssign('user', $user['data']);
|
||||
|
||||
// 订单总数
|
||||
$order_number = StatisticalService::OrderNumberYesterdayTodayTotal();
|
||||
$this->assign('order_number', $order_number['data']);
|
||||
MyViewAssign('order_number', $order_number['data']);
|
||||
|
||||
// 订单成交总量
|
||||
$order_complete_number = StatisticalService::OrderCompleteYesterdayTodayTotal();
|
||||
$this->assign('order_complete_number', $order_complete_number['data']);
|
||||
MyViewAssign('order_complete_number', $order_complete_number['data']);
|
||||
|
||||
// 订单收入总计
|
||||
$order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal();
|
||||
$this->assign('order_complete_money', $order_complete_money['data']);
|
||||
MyViewAssign('order_complete_money', $order_complete_money['data']);
|
||||
|
||||
// 近30日订单成交金额走势
|
||||
$order_profit_chart = StatisticalService::OrderProfitSevenTodayTotal();
|
||||
$this->assign('order_profit_chart', $order_profit_chart['data']);
|
||||
MyViewAssign('order_profit_chart', $order_profit_chart['data']);
|
||||
|
||||
// 近30日订单交易走势
|
||||
$order_trading_trend = StatisticalService::OrderTradingTrendSevenTodayTotal();
|
||||
$this->assign('order_trading_trend', $order_trading_trend['data']);
|
||||
MyViewAssign('order_trading_trend', $order_trading_trend['data']);
|
||||
|
||||
// 近30日支付方式
|
||||
$pay_type_number = StatisticalService::PayTypeSevenTodayTotal();
|
||||
$this->assign('pay_type_number', $pay_type_number['data']);
|
||||
MyViewAssign('pay_type_number', $pay_type_number['data']);
|
||||
|
||||
// 近30日热销商品
|
||||
$goods_hot_sale = StatisticalService::GoodsHotSaleSevenTodayTotal();
|
||||
$this->assign('goods_hot_sale', $goods_hot_sale['data']);
|
||||
MyViewAssign('goods_hot_sale', $goods_hot_sale['data']);
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -74,10 +74,10 @@ class IntegralLog extends Common
|
||||
$ret = IntegralService::IntegralLogList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,9 +107,9 @@ class IntegralLog extends Common
|
||||
];
|
||||
$ret = IntegralService::IntegralLogList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
}
|
||||
?>
|
@ -55,8 +55,8 @@ class Link extends Common
|
||||
'order_by' => $this->form_order_by['data'],
|
||||
];
|
||||
$ret = LinkService::LinkList($data_params);
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,9 +83,9 @@ class Link extends Common
|
||||
];
|
||||
$ret = LinkService::LinkList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -74,10 +74,10 @@ class Message extends Common
|
||||
$ret = MessageService::MessageList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +106,9 @@ class Message extends Common
|
||||
];
|
||||
$ret = MessageService::MessageList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -13,6 +13,7 @@ namespace app\admin\controller;
|
||||
use app\service\ArticleService;
|
||||
use app\service\NavigationService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\CustomViewService;
|
||||
|
||||
/**
|
||||
* 导航管理
|
||||
@ -63,23 +64,24 @@ class Navigation extends Common
|
||||
];
|
||||
$data_params['where'][] = ['nav_type', '=', $this->nav_type];
|
||||
$ret = NavigationService::NavList($data_params);
|
||||
$this->assign('data_list', $ret['data']);
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
|
||||
// 一级分类
|
||||
$this->assign('nav_header_pid_list', NavigationService::LevelOneNav(['nav_type'=>$this->nav_type]));
|
||||
MyViewAssign('nav_header_pid_list', NavigationService::LevelOneNav(['nav_type'=>$this->nav_type]));
|
||||
|
||||
// 获取分类和文章
|
||||
$article_category_content = ArticleService::ArticleCategoryListContent();
|
||||
$this->assign('article_list', $article_category_content['data']);
|
||||
MyViewAssign('article_list', $article_category_content['data']);
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
// 自定义页面
|
||||
$this->assign('customview_list', db('CustomView')->field(array('id', 'title'))->where(array('is_enable'=>1))->select());
|
||||
$custom_view = CustomViewService::CustomViewList(['where'=>['is_enable'=>1], 'field'=>'id,title', 'n'=>0]);
|
||||
MyViewAssign('customview_list', $custom_view['data']);
|
||||
|
||||
$this->assign('nav_type', $this->nav_type);
|
||||
return $this->fetch();
|
||||
MyViewAssign('nav_type', $this->nav_type);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -79,21 +79,21 @@ class Order extends Common
|
||||
|
||||
// 发起支付 - 支付方式
|
||||
$pay_where = [
|
||||
'where' => ['is_enable'=>1, 'payment'=>config('shopxo.under_line_list')],
|
||||
'where' => ['is_enable'=>1, 'payment'=>MyConfig('shopxo.under_line_list')],
|
||||
];
|
||||
$this->assign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
|
||||
MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
|
||||
|
||||
// 快递公司
|
||||
$this->assign('express_list', ExpressService::ExpressList());
|
||||
MyViewAssign('express_list', ExpressService::ExpressList());
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -124,12 +124,12 @@ class Order extends Common
|
||||
];
|
||||
$ret = OrderService::OrderList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -76,13 +76,13 @@ class Orderaftersale extends Common
|
||||
$ret = OrderAftersaleService::OrderAftersaleList($data_params);
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list'));
|
||||
MyViewAssign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list'));
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,9 +110,9 @@ class Orderaftersale extends Common
|
||||
);
|
||||
$ret = OrderAftersaleService::OrderAftersaleList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -52,8 +52,8 @@ class PackageInstall extends Common
|
||||
public function Index()
|
||||
{
|
||||
$data = PackageInstallService::RequestInstallParams($this->data_request);
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -74,10 +74,10 @@ class PayLog extends Common
|
||||
$ret = PayLogService::PayLogList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +106,9 @@ class PayLog extends Common
|
||||
];
|
||||
$ret = PayLogService::PayLogList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -53,24 +53,24 @@ class Payment extends Common
|
||||
{
|
||||
// 插件列表
|
||||
$ret = PaymentService::PlugPaymentList();
|
||||
$this->assign('data_list', $ret['data']);
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
|
||||
// 不能删除的支付方式
|
||||
$this->assign('cannot_deleted_list', PaymentService::$cannot_deleted_list);
|
||||
MyViewAssign('cannot_deleted_list', PaymentService::$cannot_deleted_list);
|
||||
|
||||
// 适用平台
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
|
||||
// 应用商店
|
||||
$this->assign('store_payment_url', StoreService::StorePaymentUrl());
|
||||
MyViewAssign('store_payment_url', StoreService::StorePaymentUrl());
|
||||
|
||||
// 插件更新信息
|
||||
$upgrade = PaymentService::PaymentUpgradeInfo($ret['data']);
|
||||
$this->assign('upgrade_info', $upgrade['data']);
|
||||
MyViewAssign('upgrade_info', $upgrade['data']);
|
||||
// print_r($upgrade);
|
||||
// print_r($ret['data']);
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,19 +98,19 @@ class Payment extends Common
|
||||
{
|
||||
return $this->error('没有相关支付方式', MyUrl('admin/payment/index'));
|
||||
}
|
||||
$this->assign('data', $data[0]);
|
||||
MyViewAssign('data', $data[0]);
|
||||
}
|
||||
|
||||
// 适用平台
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
MyViewAssign('params', $params);
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('payment'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('payment'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -74,10 +74,10 @@ class PayRequestLog extends Common
|
||||
$ret = PayRequestLogService::PayRequestLogList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +106,9 @@ class PayRequestLog extends Common
|
||||
];
|
||||
$ret = PayRequestLogService::PayRequestLogList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
}
|
||||
?>
|
@ -78,8 +78,8 @@ class Plugins extends Common
|
||||
{
|
||||
return DataReturn($ret, -5000);
|
||||
} else {
|
||||
$this->assign('msg', $ret);
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $ret);
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ class Plugins extends Common
|
||||
$this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction);
|
||||
|
||||
// 编辑器文件存放地址定义
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('plugins_'.$pluginsname));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('plugins_'.$pluginsname));
|
||||
|
||||
// 调用
|
||||
$ret = PluginsService::PluginsControlCall($pluginsname, $pluginscontrol, $pluginsaction, 'admin', $params);
|
||||
@ -106,8 +106,8 @@ class Plugins extends Common
|
||||
{
|
||||
return $ret;
|
||||
} else {
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('msg', $ret['msg']);
|
||||
return MyView();
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,9 +146,9 @@ class Plugins extends Common
|
||||
public function PluginsViewInit($plugins_name, $plugins_control, $plugins_action)
|
||||
{
|
||||
// 应用名称/控制器/方法
|
||||
$this->assign('plugins_name', $plugins_name);
|
||||
$this->assign('plugins_control', $plugins_control);
|
||||
$this->assign('plugins_action', $plugins_action);
|
||||
MyViewAssign('plugins_name', $plugins_name);
|
||||
MyViewAssign('plugins_control', $plugins_control);
|
||||
MyViewAssign('plugins_action', $plugins_action);
|
||||
|
||||
// 当前操作名称
|
||||
$module_name = 'plugins';
|
||||
@ -159,17 +159,17 @@ class Plugins extends Common
|
||||
// 控制器静态文件状态css,js
|
||||
$module_css = $module_name.DS.'css'.DS.$plugins_name.DS.$group.DS.$plugins_control;
|
||||
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$plugins_action.'.css') ? '.'.$plugins_action.'.css' : '.css';
|
||||
$this->assign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
|
||||
MyViewAssign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
|
||||
|
||||
$module_js = $module_name.DS.'js'.DS.$plugins_name.DS.$group.DS.$plugins_control;
|
||||
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$plugins_action.'.js') ? '.'.$plugins_action.'.js' : '.js';
|
||||
$this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
|
||||
MyViewAssign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
|
||||
|
||||
// 应用公共css,js
|
||||
$plugins_css = $module_name.DS.'css'.DS.$plugins_name.DS.$group.DS.'common.css';
|
||||
$this->assign('plugins_css', file_exists(ROOT_PATH.'static'.DS.$plugins_css) ? $plugins_css : '');
|
||||
MyViewAssign('plugins_css', file_exists(ROOT_PATH.'static'.DS.$plugins_css) ? $plugins_css : '');
|
||||
$plugins_js = $module_name.DS.'js'.DS.$plugins_name.DS.$group.DS.'common.js';
|
||||
$this->assign('plugins_js', file_exists(ROOT_PATH.'static'.DS.$plugins_js) ? $plugins_js : '');
|
||||
MyViewAssign('plugins_js', file_exists(ROOT_PATH.'static'.DS.$plugins_js) ? $plugins_js : '');
|
||||
}
|
||||
}
|
||||
?>
|
@ -57,28 +57,28 @@ class Pluginsadmin extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 导航参数
|
||||
$this->assign('view_type', $this->view_type);
|
||||
MyViewAssign('view_type', $this->view_type);
|
||||
|
||||
// 参数
|
||||
$params = $this->data_request;
|
||||
|
||||
// 应用商店地址
|
||||
$this->assign('store_url', StoreService::StoreUrl());
|
||||
MyViewAssign('store_url', StoreService::StoreUrl());
|
||||
|
||||
// 页面类型
|
||||
if($this->view_type == 'home')
|
||||
{
|
||||
// 插件列表
|
||||
$ret = PluginsAdminService::PluginsList();
|
||||
$this->assign('data_list', $ret['data']);
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
|
||||
// 插件更新信息
|
||||
$upgrade = PluginsService::PluginsUpgradeInfo($ret['data']);
|
||||
$this->assign('upgrade_info', $upgrade['data']);
|
||||
MyViewAssign('upgrade_info', $upgrade['data']);
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
} else {
|
||||
return $this->fetch('upload');
|
||||
return MyView('upload');
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ class Pluginsadmin extends Common
|
||||
$params = $this->data_request;
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
MyViewAssign('params', $params);
|
||||
|
||||
// 获取数据
|
||||
$data = [];
|
||||
@ -113,7 +113,7 @@ class Pluginsadmin extends Common
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 名称校验
|
||||
if(!empty($params['plugins']))
|
||||
@ -121,22 +121,22 @@ class Pluginsadmin extends Common
|
||||
$ret = PluginsAdminService::PluginsVerification($params, $params['plugins']);
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
$this->assign('verification_msg', $ret['msg']);
|
||||
return $this->fetch('first_step');
|
||||
MyViewAssign('verification_msg', $ret['msg']);
|
||||
return MyView('first_step');
|
||||
}
|
||||
}
|
||||
|
||||
// 标记为空或等于view 并且 编辑数据为空则走第一步
|
||||
if(empty($params['plugins']) && empty($data['data'][0]))
|
||||
{
|
||||
return $this->fetch('first_step');
|
||||
return MyView('first_step');
|
||||
} else {
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('plugins_'.$params['plugins']));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('plugins_'.$params['plugins']));
|
||||
|
||||
// 唯一标记
|
||||
$this->assign('plugins', $params['plugins']);
|
||||
return $this->fetch('save_info');
|
||||
MyViewAssign('plugins', $params['plugins']);
|
||||
return MyView('save_info');
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,8 +230,8 @@ class Pluginsadmin extends Common
|
||||
$ret = PluginsAdminService::PluginsDownload($this->data_request);
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $ret['msg']);
|
||||
return MyView('public/tips_error');
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
@ -56,9 +56,9 @@ class Power extends Common
|
||||
];
|
||||
$data = AdminPowerService::PowerList($data_params);
|
||||
|
||||
$this->assign('data', $data);
|
||||
$this->assign('common_is_show_list', lang('common_is_show_list'));
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('common_is_show_list', lang('common_is_show_list'));
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -73,10 +73,10 @@ class QuickNav extends Common
|
||||
$ret = QuickNavService::QuickNavList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,9 +103,9 @@ class QuickNav extends Common
|
||||
];
|
||||
$ret = QuickNavService::QuickNavList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,19 +134,19 @@ class QuickNav extends Common
|
||||
$ret = QuickNavService::QuickNavList($data_params);
|
||||
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 静态数据
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
$this->assign('common_app_event_type', lang('common_app_event_type'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_app_event_type', lang('common_app_event_type'));
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
MyViewAssign('params', $params);
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('quick_nav'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('quick_nav'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -74,10 +74,10 @@ class RefundLog extends Common
|
||||
$ret = RefundLogService::RefundLogList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +106,9 @@ class RefundLog extends Common
|
||||
];
|
||||
$ret = RefundLogService::RefundLogList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
}
|
||||
?>
|
@ -50,9 +50,9 @@ class Region extends Common
|
||||
$this->IsPower();
|
||||
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\AdminRoleService;
|
||||
|
||||
/**
|
||||
@ -73,10 +72,10 @@ class Role extends Common
|
||||
$ret = AdminRoleService::RoleList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,9 +102,9 @@ class Role extends Common
|
||||
];
|
||||
$ret = AdminRoleService::RoleList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,11 +138,11 @@ class Role extends Common
|
||||
|
||||
// 菜单列表
|
||||
$power = AdminRoleService::RolePowerEditData($params);
|
||||
$this->assign('power', $power);
|
||||
MyViewAssign('power', $power);
|
||||
|
||||
// 角色编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_role_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -154,9 +153,9 @@ class Role extends Common
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,9 +50,9 @@ class ScreeningPrice extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,18 +50,18 @@ class Seo extends Common
|
||||
public function Index()
|
||||
{
|
||||
// url模式
|
||||
$this->assign('seo_url_model_list', lang('seo_url_model_list'));
|
||||
MyViewAssign('seo_url_model_list', lang('seo_url_model_list'));
|
||||
|
||||
// 文章标题seo方案
|
||||
$this->assign('seo_article_browser_list', lang('seo_article_browser_list'));
|
||||
MyViewAssign('seo_article_browser_list', lang('seo_article_browser_list'));
|
||||
|
||||
// 频道标题seo方案
|
||||
$this->assign('seo_channel_browser_list', lang('seo_channel_browser_list'));
|
||||
MyViewAssign('seo_channel_browser_list', lang('seo_channel_browser_list'));
|
||||
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -71,7 +71,7 @@ class Site extends Common
|
||||
|
||||
// 配置信息
|
||||
$data = ConfigService::ConfigList();
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 数据处理
|
||||
switch($this->nav_type)
|
||||
@ -82,11 +82,11 @@ class Site extends Common
|
||||
if(!empty($data['common_self_extraction_address']) && !empty($data['common_self_extraction_address']['value']))
|
||||
{
|
||||
$address = ConfigService::SiteTypeExtractionAddressList($data['common_self_extraction_address']['value']);
|
||||
$this->assign('sitetype_address_list', $address['data']);
|
||||
MyViewAssign('sitetype_address_list', $address['data']);
|
||||
}
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
break;
|
||||
|
||||
// 网站设置
|
||||
@ -120,23 +120,23 @@ class Site extends Common
|
||||
$c['config_category_ids'] = array_key_exists($c['id'], $floor_category) ? explode(',', $floor_category[$c['id']]) : [];
|
||||
}
|
||||
}
|
||||
$this->assign('goods_category_list', $category);
|
||||
MyViewAssign('goods_category_list', $category);
|
||||
|
||||
// 楼层自定义商品
|
||||
if(!empty($data['home_index_floor_manual_mode_goods']) && !empty($data['home_index_floor_manual_mode_goods']['value']))
|
||||
{
|
||||
$ret = SiteService::FloorManualModeGoodsViewHandle(json_decode($data['home_index_floor_manual_mode_goods']['value'], true));
|
||||
$this->assign('floor_manual_mode_goods_list', $ret['data']);
|
||||
MyViewAssign('floor_manual_mode_goods_list', $ret['data']);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('common'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('common'));
|
||||
|
||||
// 视图
|
||||
$view = 'site/'.$this->nav_type.'/'.$this->view_type;
|
||||
return $this->fetch($view);
|
||||
return MyView($view);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,51 +150,51 @@ class Site extends Common
|
||||
public function CurrentViewInit()
|
||||
{
|
||||
// 主/子导航
|
||||
$this->assign('nav_type', $this->nav_type);
|
||||
$this->assign('view_type', $this->view_type);
|
||||
MyViewAssign('nav_type', $this->nav_type);
|
||||
MyViewAssign('view_type', $this->view_type);
|
||||
|
||||
// 时区
|
||||
$this->assign('site_timezone_list', lang('site_timezone_list'));
|
||||
MyViewAssign('site_timezone_list', lang('site_timezone_list'));
|
||||
|
||||
// 关闭开启
|
||||
$this->assign('common_close_open_list', lang('common_close_open_list'));
|
||||
MyViewAssign('common_close_open_list', lang('common_close_open_list'));
|
||||
|
||||
// 登录方式
|
||||
$this->assign('common_login_type_list', lang('common_login_type_list'));
|
||||
MyViewAssign('common_login_type_list', lang('common_login_type_list'));
|
||||
|
||||
// 用户注册类型列表
|
||||
$this->assign('common_user_reg_type_list', lang('common_user_reg_type_list'));
|
||||
MyViewAssign('common_user_reg_type_list', lang('common_user_reg_type_list'));
|
||||
|
||||
// 图片验证码规则
|
||||
$this->assign('site_images_verify_rules_list', lang('site_images_verify_rules_list'));
|
||||
MyViewAssign('site_images_verify_rules_list', lang('site_images_verify_rules_list'));
|
||||
|
||||
// 热门搜索关键字
|
||||
$this->assign('common_search_keywords_type_list', lang('common_search_keywords_type_list'));
|
||||
MyViewAssign('common_search_keywords_type_list', lang('common_search_keywords_type_list'));
|
||||
|
||||
// 是否
|
||||
$this->assign('common_is_text_list', lang('common_is_text_list'));
|
||||
MyViewAssign('common_is_text_list', lang('common_is_text_list'));
|
||||
|
||||
// 站点类型
|
||||
$this->assign('common_site_type_list', lang('common_site_type_list'));
|
||||
MyViewAssign('common_site_type_list', lang('common_site_type_list'));
|
||||
|
||||
// 扣除库存规则
|
||||
$this->assign('common_deduction_inventory_rules_list', lang('common_deduction_inventory_rules_list'));
|
||||
MyViewAssign('common_deduction_inventory_rules_list', lang('common_deduction_inventory_rules_list'));
|
||||
|
||||
// 增加销量规则
|
||||
$this->assign('common_sales_count_inc_rules_list', lang('common_sales_count_inc_rules_list'));
|
||||
MyViewAssign('common_sales_count_inc_rules_list', lang('common_sales_count_inc_rules_list'));
|
||||
|
||||
// 首页商品排序规则
|
||||
$this->assign('goods_order_by_type_list', lang('goods_order_by_type_list'));
|
||||
$this->assign('goods_order_by_rule_list', lang('goods_order_by_rule_list'));
|
||||
MyViewAssign('goods_order_by_type_list', lang('goods_order_by_type_list'));
|
||||
MyViewAssign('goods_order_by_rule_list', lang('goods_order_by_rule_list'));
|
||||
|
||||
// 首页楼层数据类型
|
||||
$this->assign('common_site_floor_data_type_list', lang('common_site_floor_data_type_list'));
|
||||
MyViewAssign('common_site_floor_data_type_list', lang('common_site_floor_data_type_list'));
|
||||
|
||||
// 搜索参数类型
|
||||
$this->assign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list'));
|
||||
|
||||
// 主导航
|
||||
$this->assign('second_nav_list', [
|
||||
MyViewAssign('second_nav_list', [
|
||||
[
|
||||
'name' => '基础配置',
|
||||
'type' => 'base',
|
||||
@ -242,7 +242,7 @@ class Site extends Common
|
||||
]);
|
||||
|
||||
// 网站设置导航
|
||||
$this->assign('siteset_nav_list', [
|
||||
MyViewAssign('siteset_nav_list', [
|
||||
[
|
||||
'name' => '首页',
|
||||
'type' => 'index',
|
||||
@ -359,18 +359,8 @@ class Site extends Common
|
||||
// 缓存
|
||||
case 'cache' :
|
||||
// session是否使用缓存
|
||||
if(isset($params['common_session_is_use_cache']) && $params['common_session_is_use_cache'] == 1)
|
||||
{
|
||||
// 连接测试
|
||||
$ret = SiteService::RedisCheckConnectPing($params['common_cache_session_redis_host'], $params['common_cache_session_redis_port'], $params['common_cache_session_redis_password']);
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// 数据是否使用缓存
|
||||
if(isset($params['common_data_is_use_cache']) && $params['common_data_is_use_cache'] == 1)
|
||||
if((isset($params['common_session_is_use_cache']) && $params['common_session_is_use_cache'] == 1) || (isset($params['common_data_is_use_cache']) && $params['common_data_is_use_cache'] == 1))
|
||||
{
|
||||
// 连接测试
|
||||
$ret = SiteService::RedisCheckConnectPing($params['common_cache_data_redis_host'], $params['common_cache_data_redis_port'], $params['common_cache_data_redis_password']);
|
||||
@ -404,11 +394,11 @@ class Site extends Common
|
||||
{
|
||||
// 登录
|
||||
case 'login' :
|
||||
cache(config('shopxo.cache_user_login_left_key'), null);
|
||||
MyCache(MyConfig('shopxo.cache_user_login_left_key'), null);
|
||||
|
||||
// 密码找回
|
||||
case 'forgetpwd' :
|
||||
cache(config('shopxo.cache_user_forgetpwd_left_key'), null);
|
||||
MyCache(MyConfig('shopxo.cache_user_forgetpwd_left_key'), null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -436,8 +426,8 @@ class Site extends Common
|
||||
$ret = SiteService::GoodsSearchList($this->data_post);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']['data']);
|
||||
$ret['data']['data'] = $this->fetch('site/public/goods_search');
|
||||
MyViewAssign('data', $ret['data']['data']);
|
||||
$ret['data']['data'] = MyView('site/public/goods_search');
|
||||
}
|
||||
return $ret;
|
||||
}
|
@ -73,10 +73,10 @@ class Slide extends Common
|
||||
$ret = SlideService::SlideList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,9 +103,9 @@ class Slide extends Common
|
||||
];
|
||||
$ret = SlideService::SlideList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,18 +136,18 @@ class Slide extends Common
|
||||
}
|
||||
|
||||
// 静态资源
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
$this->assign('common_platform_type', lang('common_platform_type'));
|
||||
$this->assign('common_app_event_type', lang('common_app_event_type'));
|
||||
MyViewAssign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
MyViewAssign('common_platform_type', lang('common_platform_type'));
|
||||
MyViewAssign('common_app_event_type', lang('common_app_event_type'));
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('slide'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('slide'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('params', $params);
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $params);
|
||||
MyViewAssign('data', $data);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -50,16 +50,16 @@ class Sms extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
MyViewAssign('data', ConfigService::ConfigList());
|
||||
|
||||
// 导航
|
||||
$type = input('type', 'sms');
|
||||
$this->assign('nav_type', $type);
|
||||
MyViewAssign('nav_type', $type);
|
||||
if($type == 'sms')
|
||||
{
|
||||
return $this->fetch('index');
|
||||
return MyView('index');
|
||||
} else {
|
||||
return $this->fetch('message');
|
||||
return MyView('message');
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class Sqlconsole extends Common
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -48,8 +48,8 @@ class Store extends Common
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
$this->assign('store_url', StoreService::StoreUrl());
|
||||
return $this->fetch();
|
||||
MyViewAssign('store_url', StoreService::StoreUrl());
|
||||
return MyView();
|
||||
}
|
||||
}
|
||||
?>
|
@ -57,26 +57,26 @@ class Theme extends Common
|
||||
public function Index()
|
||||
{
|
||||
// 导航参数
|
||||
$this->assign('view_type', $this->view_type);
|
||||
MyViewAssign('view_type', $this->view_type);
|
||||
|
||||
// 应用商店
|
||||
$this->assign('store_theme_url', StoreService::StoreThemeUrl());
|
||||
MyViewAssign('store_theme_url', StoreService::StoreThemeUrl());
|
||||
|
||||
// 是否默认首页
|
||||
if($this->view_type == 'index')
|
||||
{
|
||||
// 默认主题
|
||||
$this->assign('theme', ThemeService::DefaultTheme());
|
||||
MyViewAssign('theme', ThemeService::DefaultTheme());
|
||||
|
||||
// 获取主题列表
|
||||
$data = ThemeService::ThemeList();
|
||||
$this->assign('data_list', $data);
|
||||
MyViewAssign('data_list', $data);
|
||||
|
||||
// 插件更新信息
|
||||
$upgrade = ThemeService::ThemeUpgradeInfo($data);
|
||||
$this->assign('upgrade_info', $upgrade['data']);
|
||||
MyViewAssign('upgrade_info', $upgrade['data']);
|
||||
}
|
||||
return $this->fetch($this->view_type);
|
||||
return MyView($this->view_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -149,8 +149,8 @@ class Theme extends Common
|
||||
$ret = ThemeService::ThemeDownload($this->data_request);
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/tips_error');
|
||||
MyViewAssign('msg', $ret['msg']);
|
||||
return MyView('public/tips_error');
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\IntegralService;
|
||||
use app\service\UserService;
|
||||
|
||||
@ -74,13 +73,13 @@ class User extends Common
|
||||
$ret = UserService::UserList($data_params);
|
||||
|
||||
// Excel地址
|
||||
$this->assign('excel_url', MyUrl('admin/user/excelexport', $this->data_request));
|
||||
MyViewAssign('excel_url', MyUrl('admin/user/excelexport', $this->data_request));
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,9 +106,9 @@ class User extends Common
|
||||
];
|
||||
$ret = UserService::UserList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -169,7 +168,7 @@ class User extends Common
|
||||
|
||||
// 用户编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_user_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -179,13 +178,13 @@ class User extends Common
|
||||
]));
|
||||
|
||||
// 性别
|
||||
$this->assign('common_gender_list', lang('common_gender_list'));
|
||||
MyViewAssign('common_gender_list', lang('common_gender_list'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
|
@ -73,13 +73,13 @@ class UserAddress extends Common
|
||||
$ret = UserAddressService::UserAddressAdminList($data_params);
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,12 +106,12 @@ class UserAddress extends Common
|
||||
];
|
||||
$ret = UserAddressService::UserAddressAdminList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,19 +142,19 @@ class UserAddress extends Common
|
||||
}
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
|
||||
// 编辑器文件存放地址
|
||||
if(!empty($data['user_id']))
|
||||
{
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue(UserAddressService::EditorAttachmentPathType($data['user_id'])));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue(UserAddressService::EditorAttachmentPathType($data['user_id'])));
|
||||
}
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\WarehouseService;
|
||||
use app\service\ResourcesService;
|
||||
|
||||
@ -60,14 +59,14 @@ class Warehouse extends Common
|
||||
'order_by' => $this->form_order_by['data'],
|
||||
];
|
||||
$ret = WarehouseService::WarehouseList($data_params);
|
||||
$this->assign('data_list', $ret['data']);
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,12 +93,12 @@ class Warehouse extends Common
|
||||
];
|
||||
$ret = WarehouseService::WarehouseList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
MyViewAssign('data', $data);
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
}
|
||||
return $this->fetch();
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,7 +128,7 @@ class Warehouse extends Common
|
||||
|
||||
// 编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_warehouse_save';
|
||||
$this->assign($hook_name.'_data', Hook::listen($hook_name,
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
@ -139,16 +138,16 @@ class Warehouse extends Common
|
||||
]));
|
||||
|
||||
// 加载百度地图api
|
||||
$this->assign('is_load_baidu_map_api', 1);
|
||||
MyViewAssign('is_load_baidu_map_api', 1);
|
||||
|
||||
// 编辑器文件存放地址
|
||||
$this->assign('editor_path_type', ResourcesService::EditorPathTypeValue('warehouse'));
|
||||
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('warehouse'));
|
||||
|
||||
// 数据
|
||||
unset($params['id']);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\Hook;
|
||||
use app\service\WarehouseGoodsService;
|
||||
use app\service\WarehouseService;
|
||||
use app\service\GoodsService;
|
||||
@ -86,16 +85,16 @@ class WarehouseGoods extends Common
|
||||
],
|
||||
];
|
||||
$warehouse = WarehouseService::WarehouseList($data_params);
|
||||
$this->assign('warehouse_list', $warehouse['data']);
|
||||
MyViewAssign('warehouse_list', $warehouse['data']);
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
MyViewAssign('params', $this->data_request);
|
||||
MyViewAssign('page_html', $page->GetPageHtml());
|
||||
MyViewAssign('data_list', $ret['data']);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,9 +128,9 @@ class WarehouseGoods extends Common
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assign('spec', $spec);
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
MyViewAssign('spec', $spec);
|
||||
MyViewAssign('data', $data);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -156,9 +155,9 @@ class WarehouseGoods extends Common
|
||||
}
|
||||
|
||||
// 数据
|
||||
$this->assign('data', $data);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
MyViewAssign('data', $data);
|
||||
MyViewAssign('params', $params);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -246,8 +245,8 @@ class WarehouseGoods extends Common
|
||||
$ret = WarehouseGoodsService::GoodsSearchList($this->data_request);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']['data']);
|
||||
$ret['data']['data'] = $this->fetch();
|
||||
MyViewAssign('data', $ret['data']['data']);
|
||||
$ret['data']['data'] = MyView();
|
||||
}
|
||||
return $ret;
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 问答动态表格
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\BrandService;
|
||||
use app\service\BrandCategoryService;
|
||||
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\GoodsService;
|
||||
use app\service\RegionService;
|
||||
use app\service\BrandService;
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 商品浏览管理动态表格
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 商品评论动态表格
|
||||
@ -275,7 +275,7 @@ class GoodsComments
|
||||
if(!empty($value))
|
||||
{
|
||||
// 获取关联的商品 id
|
||||
$ids = Db::name('GoodsComments')->alias('gc')->join(['__GOODS__'=>'g'], 'gc.goods_id=g.id')->where('g.title|g.model', 'like', '%'.$value.'%')->column('gc.id');
|
||||
$ids = Db::name('GoodsComments')->alias('gc')->join('goods g', 'gc.goods_id=g.id')->where('g.title|g.model', 'like', '%'.$value.'%')->column('gc.id');
|
||||
|
||||
// 避免空条件造成无效的错觉
|
||||
return empty($ids) ? [0] : $ids;
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 商品收藏管理动态表格
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 积分日志动态表格
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 消息管理动态表格
|
||||
@ -250,7 +250,7 @@ class Message
|
||||
*/
|
||||
public function MessageBusinessTypeList()
|
||||
{
|
||||
return Db::name('Message')->field('business_type as name')->group('business_type')->select();
|
||||
return Db::name('Message')->field('business_type as name')->group('business_type')->select()->toArray();
|
||||
}
|
||||
}
|
||||
?>
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\PaymentService;
|
||||
use app\service\ExpressService;
|
||||
|
||||
@ -483,7 +483,7 @@ class Order
|
||||
{
|
||||
$where = ['id'=>$wids];
|
||||
$order_by = 'level desc, id desc';
|
||||
$data = Db::name('Warehouse')->field('id,name')->where($where)->order($order_by)->select();
|
||||
$data = Db::name('Warehouse')->field('id,name')->where($where)->order($order_by)->select()->toArray();
|
||||
}
|
||||
return $data;
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 订单售后动态表格
|
||||
@ -312,7 +312,7 @@ class OrderAftersale
|
||||
if(!empty($value))
|
||||
{
|
||||
// 获取订单详情搜索的订单售后 id
|
||||
$ids = Db::name('OrderAftersale')->alias('oa')->join(['__ORDER_DETAIL__'=>'od'], 'oa.order_detail_id=od.id')->whereOr('od.title|od.model', 'like', '%'.$value.'%')->whereOr('oa.order_no', '=', $value)->column('oa.id');
|
||||
$ids = Db::name('OrderAftersale')->alias('oa')->join('order_detail od', 'oa.order_detail_id=od.id')->whereOr('od.title|od.model', 'like', '%'.$value.'%')->whereOr('oa.order_no', '=', $value)->column('oa.id');
|
||||
|
||||
// 避免空条件造成无效的错觉
|
||||
return empty($ids) ? [0] : $ids;
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\PayLogService;
|
||||
|
||||
/**
|
||||
@ -278,7 +278,7 @@ class PayLog
|
||||
*/
|
||||
public function PayLogBusinessTypeList()
|
||||
{
|
||||
return Db::name('PayLog')->field('business_type as name')->group('business_type')->select();
|
||||
return Db::name('PayLog')->field('business_type as name')->group('business_type')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 支付请求日志动态表格
|
||||
@ -262,7 +262,7 @@ class PayRequestLog
|
||||
*/
|
||||
public function PayRequestLogFieldWhereList($field)
|
||||
{
|
||||
return Db::name('PayRequestLog')->field($field.' as name')->group($field)->select();
|
||||
return Db::name('PayRequestLog')->field($field.' as name')->group($field)->select()->toArray();
|
||||
}
|
||||
}
|
||||
?>
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\RefundLogService;
|
||||
|
||||
/**
|
||||
@ -247,7 +247,7 @@ class RefundLog
|
||||
*/
|
||||
public function RefundLogBusinessTypeList()
|
||||
{
|
||||
return Db::name('RefundLog')->field('business_type as name')->group('business_type')->select();
|
||||
return Db::name('RefundLog')->field('business_type as name')->group('business_type')->select()->toArray();
|
||||
}
|
||||
}
|
||||
?>
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\RegionService;
|
||||
|
||||
/**
|
@ -10,7 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use think\facade\Db;
|
||||
use app\service\WarehouseService;
|
||||
use app\service\RegionService;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user