提交 ee9eb9a7 编写于 作者: D devil_gong

linux大小写,错误处理

上级 4293336e
<?php
namespace app\admin\controller;
use app\service\ConfigService;
/**
* 手机端 - 配置
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class AppConfig extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 配置列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 配置信息
$this->assign('data', ConfigService::ConfigList());
// 是否
$this->assign('common_is_text_list', lang('common_is_text_list'));
return $this->fetch();
}
/**
* [Save 配置数据保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-02T23:08:19+0800
*/
public function Save()
{
return ConfigService::ConfigSave($_POST);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\AppNavService;
/**
* 手机管理-首页导航管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class AppHomeNav extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 手机管理-首页导航列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 参数
$params = input();
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = AppNavService::AppHomeNavListWhere($params);
// 获取总数
$total = AppNavService::AppHomeNavTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('admin/apphomenav/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
'field' => '*',
);
$data = AppNavService::AppHomeNavList($data_params);
$this->assign('data_list', $data['data']);
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 所属平台
$this->assign('common_platform_type', lang('common_platform_type'));
// app事件类型
$this->assign('common_app_event_type', lang('common_app_event_type'));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
/**
* [SaveInfo 添加/编辑页面]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function SaveInfo()
{
// 参数
$params = input();
// 数据
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$data = AppNavService::AppHomeNavList($data_params);
$this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]);
}
// 所属平台
$this->assign('common_platform_type', lang('common_platform_type'));
// app事件类型
$this->assign('common_app_event_type', lang('common_app_event_type'));
// 参数
$this->assign('params', $params);
// 编辑器文件存放地址
$this->assign('editor_path_type', 'app_nav');
return $this->fetch();
}
/**
* [Save 手机管理-首页导航添加/编辑]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$ret = AppNavService::AppHomeNavSave($params);
return json($ret);
}
/**
* [Delete 手机管理-首页导航删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public function Delete()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$params['user_type'] = 'admin';
$ret = AppNavService::AppHomeNavDelete($params);
return json($ret);
}
/**
* [StatusUpdate 状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
public function StatusUpdate()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$ret = AppNavService::AppHomeNavStatusUpdate($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\ConfigService;
/**
* 支付宝小程序 - 配置
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class AppMiniAlipayConfig extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 配置列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 配置信息
$this->assign('data', ConfigService::ConfigList());
return $this->fetch();
}
/**
* [Save 配置数据保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-02T23:08:19+0800
*/
public function Save()
{
return ConfigService::ConfigSave($_POST);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\AppMiniService;
/**
* 支付宝小程序管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class AppMiniAlipayList extends Common
{
private $application_name;
private $old_path;
private $new_path;
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
// 参数
$this->params = input();
$params['application_name'] = 'alipay';
}
/**
* [Index 列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
$this->assign('data', AppMiniService::DataList($this->params));
return $this->fetch();
}
/**
* [Created 生成]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-05T20:12:30+0800
*/
public function Created()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = AppMiniService::Created($this->params);
return json($ret);
}
/**
* [Delete 删除包]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-09T21:13:47+0800
*/
public function Delete()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = AppMiniService::Delete($this->params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\ArticleService;
/**
* 文章分类管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class ArticleCategory extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 文章分类列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
return $this->fetch();
}
/**
* [GetNodeSon 获取节点子列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:19:45+0800
*/
public function GetNodeSon()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = ArticleService::ArticleCategoryNodeSon(input());
return json($ret);
}
/**
* [Save 文章分类保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = ArticleService::ArticleCategorySave(input());
return json($ret);
}
/**
* [Delete 文章分类删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Delete()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
$params = input('post.');
$params['admin'] = $this->admin;
$ret = ArticleService::ArticleCategoryDelete($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\BrandService;
/**
* 品牌分类管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class BrandCategory extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 品牌分类列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
return $this->fetch();
}
/**
* [GetNodeSon 获取节点子列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:19:45+0800
*/
public function GetNodeSon()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = BrandService::BrandCategoryNodeSon(input());
return json($ret);
}
/**
* [Save 品牌分类保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = BrandService::BrandCategorySave(input());
return json($ret);
}
/**
* [Delete 品牌分类删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Delete()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
$params = input('post.');
$params['admin'] = $this->admin;
$ret = BrandService::BrandCategoryDelete($params);
return json($ret);
}
}
?>
\ No newline at end of file
......@@ -157,72 +157,23 @@ class Common extends Controller
}
}
/**
* 文件删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-10
* @desc description
* @param [string] $img [图片地址 path+name]
*/
protected function FileDelete($img)
{
if(empty($img)) return false;
if(file_exists(ROOT_PATH.$img))
{
return unlink(ROOT_PATH.$img);
}
return false;
}
/**
* 文件批量删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-10
* @desc description
* @param [array] $img_all [图片地址 path+name]
*/
protected function FileDeleteAll($img_all)
{
if(!empty($img_all) && is_array($img_all))
{
for($i=0; $i<config($img_all); $i++)
{
$this->FileDelete($img_all[$i]);
$this->FileDelete(str_replace(['compr', 'small'], 'small', $img_all[$i]));
$this->FileDelete(str_replace(['compr', 'small'], 'compr', $img_all[$i]));
$this->FileDelete(str_replace(['compr', 'small'], 'original', $img_all[$i]));
}
}
}
/**
* 文件存储
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-11
* @desc description
* @param [string] $field [name名称]
* @param [string] $post_name [file form name名称]
* @param [string] $dir [存储路径标记]
*/
protected function FileSave($field, $post_name, $dir = 'common')
{
if(isset($_FILES[$post_name]['error']))
{
$path = DS.'static'.DS.'upload'.DS.$dir.DS.date('Y').DS.date('m').DS.date('d').DS;
$file_obj = new \base\FileUpload(['root_path'=>ROOT_PATH, 'path'=>$path]);
$ret = $file_obj->Save($post_name);
if($ret['status'] === true)
{
$_POST[$field] = $ret['data']['url'];
}
}
}
/**
* [_empty 空方法操作]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-25T15:47:50+0800
* @param [string] $name [方法名称]
*/
public function _empty($name)
{
if(IS_AJAX)
{
exit(json_encode(DataReturn($name.' 非法访问', -1000)));
} else {
$this->assign('msg', $name.' 非法访问');
return $this->fetch('public/error');
}
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\CustomViewService;
/**
* 自定义页面管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class CustomView extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 文章列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 参数
$params = input();
// 分页
$number = 10;
// 条件
$where = CustomViewService::CustomViewListWhere($params);
// 获取总数
$total = CustomViewService::CustomViewTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('admin/customview/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
'field' => '*',
);
$data = CustomViewService::CustomViewList($data_params);
$this->assign('data_list', $data['data']);
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 是否包含头部
$this->assign('common_is_header_list', lang('common_is_header_list'));
// 是否包含尾部
$this->assign('common_is_footer_list', lang('common_is_footer_list'));
// 是否满屏
$this->assign('common_is_full_screen_list', lang('common_is_full_screen_list'));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
/**
* [SaveInfo 添加/编辑页面]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function SaveInfo()
{
// 参数
$params = input();
// 数据
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$data = CustomViewService::CustomViewList($data_params);
$this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]);
}
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 是否包含头部
$this->assign('common_is_header_list', lang('common_is_header_list'));
// 是否包含尾部
$this->assign('common_is_footer_list', lang('common_is_footer_list'));
// 是否满屏
$this->assign('common_is_full_screen_list', lang('common_is_full_screen_list'));
return $this->fetch();
}
/**
* [Save 添加/编辑]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$ret = CustomViewService::CustomViewSave($params);
return json($ret);
}
/**
* [Delete 删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public function Delete()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$params['user_type'] = 'admin';
$ret = CustomViewService::CustomViewDelete($params);
return json($ret);
}
/**
* [StatusUpdate 状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
public function StatusUpdate()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
$ret = CustomViewService::CustomViewStatusUpdate($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use think\Request;
/**
* 空控制器响应
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
class Error extends Common
{
/**
* 空控制器响应
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
* @param Request $request [参数]
*/
public function index(Request $request)
{
if(IS_AJAX)
{
exit(json_encode(DataReturn($request->controller().' 控制器不存在', -1000)));
} else {
$this->assign('msg', $request->controller().' 控制器不存在');
return $this->fetch('public/error');
}
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\GoodsService;
/**
* 分类管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class GoodsCategory extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 分类列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
// 是否
$this->assign('common_is_text_list', lang('common_is_text_list'));
// 编辑器文件存放地址
$this->assign('editor_path_type', 'goods_category');
return $this->fetch();
}
/**
* [GetNodeSon 获取节点子列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:19:45+0800
*/
public function GetNodeSon()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = GoodsService::GoodsCategoryNodeSon(input());
return json($ret);
}
/**
* [Save 分类保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = GoodsService::GoodsCategorySave(input());
return json($ret);
}
/**
* [Delete 分类删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Delete()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
$params = input('post.');
$params['admin'] = $this->admin;
$ret = GoodsService::GoodsCategoryDelete($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\IntegralService;
/**
* 用户积分日志管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class IntegralLog extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 用户积分日志列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = IntegralService::AdminIntegralListWhere($params);
// 获取总数
$total = IntegralService::AdminIntegralTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('admin/integrallog/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = IntegralService::AdminIntegralList($data_params);
$this->assign('data_list', $data['data']);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 操作类型
$this->assign('common_integral_log_type_list', lang('common_integral_log_type_list'));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\PayLogService;
/**
* 支付日志管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class PayLog extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 支付日志列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->admin;
$params['user_type'] = 'admin';
// 分页
$number = MyC('admin_page_number', 10, true);
// 条件
$where = PayLogService::AdminPayLogListWhere($params);
// 获取总数
$total = PayLogService::AdminPayLogTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('admin/paylog/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = PayLogService::AdminPayLogList($data_params);
$this->assign('data_list', $data['data']);
// 性别
$this->assign('common_gender_list', lang('common_gender_list'));
// 业务类型
$this->assign('common_business_type_list', lang('common_business_type_list'));
// 支付日志类型
$pay_type_list = PayLogService::PayLogTypeList($params);
$this->assign('common_pay_type_list', $pay_type_list['data']);
// 参数
$this->assign('params', $params);
return $this->fetch();
}
}
?>
\ No newline at end of file
<?php
namespace app\admin\controller;
use app\service\ScreeningPriceService;
/**
* 筛选价格管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class ScreeningPrice extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 筛选价格列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 是否启用
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
return $this->fetch();
}
/**
* [GetNodeSon 获取节点子列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:19:45+0800
*/
public function GetNodeSon()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = ScreeningPriceService::ScreeningPriceNodeSon(input());
return json($ret);
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
}
/**
* [Save 筛选价格保存]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始操作
$ret = ScreeningPriceService::ScreeningPriceSave(input());
return json($ret);
}
/**
* [Delete 筛选价格删除]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T22:36:12+0800
*/
public function Delete()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
$params = input('post.');
$params['admin'] = $this->admin;
$ret = ScreeningPriceService::ScreeningPriceDelete($params);
return json($ret);
}
}
?>
\ No newline at end of file
......@@ -247,10 +247,15 @@ class Common extends Controller
* @datetime 2017-02-25T15:47:50+0800
* @param [string] $name [方法名称]
*/
protected function _empty($name)
public function _empty($name)
{
$this->assign('msg', '非法访问');
return $this->fetch('public/error');
if(IS_AJAX)
{
exit(json_encode(DataReturn($name.' 非法访问', -1000)));
} else {
$this->assign('msg', $name.' 非法访问');
return $this->fetch('public/error');
}
}
/**
......
<?php
namespace app\index\controller;
use app\service\CustomViewService;
/**
* 自定义页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class CustomView extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
}
/**
* [Index 文章详情]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 获取页面
$id = input('id');
$params = [
'where' => ['is_enable'=>1, 'id'=>$id],
'field' => 'id,title,content,is_header,is_footer,is_full_screen,access_count',
'm' => 0,
'n' => 1,
];
$data = CustomViewService::CustomViewList($params);
if(!empty($data['data'][0]))
{
// 访问统计
CustomViewService::CustomViewAccessCountInc(['id'=>$id]);
// 浏览器标题
$this->assign('home_seo_site_title', $this->GetBrowserSeoTitle($data['data'][0]['title'], 1));
$this->assign('data', $data['data'][0]);
return $this->fetch();
} else {
$this->assign('msg', '页面不存在或已删除');
return $this->fetch('public/tips_error');
}
}
}
?>
\ No newline at end of file
......@@ -24,7 +24,13 @@ class Error extends Common
*/
public function index(Request $request)
{
exit($request->controller().' 控制器不存在');
if(IS_AJAX)
{
exit(json_encode(DataReturn($request->controller().' 控制器不存在', -1000)));
} else {
$this->assign('msg', $request->controller().' 控制器不存在');
return $this->fetch('public/error');
}
}
}
?>
\ No newline at end of file
<?php
namespace app\index\controller;
/**
* 二维码生成控制层
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class QrCode extends Common
{
/**
* [__construct 构造方法]
*/
public function __construct()
{
parent::__construct();
}
/**
* [Index 首页方法]
*/
public function Index()
{
require_once ROOT.'extend'.DS.'qrcode'.DS.'phpqrcode.php';
$level = isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H')) ? $_REQUEST['level'] : 'L';
$point_size = isset($_REQUEST['size']) ? min(max(intval($_REQUEST['size']), 1), 10) : 6;
$mr = isset($_REQUEST['mr']) ? intval($_REQUEST['mr']) : 1;
$content = isset($_REQUEST['content']) ? urldecode(trim($_REQUEST['content'])) : __MY_URL__;
\QRcode::png($content, false, $level, $point_size, $mr);
}
}
?>
\ No newline at end of file
<?php
namespace app\index\controller;
use app\service\UserService;
/**
* 用户地址管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class UserAddress extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
// 是否登录
$this->Is_Login();
}
/**
* [Index 首页]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-22T16:50:32+0800
*/
public function Index()
{
$data = UserService::UserAddressList(['user'=>$this->user]);
$this->assign('user_address_list', $data['data']);
return $this->fetch();
}
/**
* [SaveInfo 地址添加/编辑页面]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-14T21:37:02+0800
*/
public function SaveInfo()
{
$this->assign('is_header', 0);
$this->assign('is_footer', 0);
if(input())
{
$params = input();
$params['user'] = $this->user;
$data = UserService::UserAddressRow($params);
$this->assign('data', $data['data']);
}
return $this->fetch();
}
/**
* [Save 用户地址保存]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-09-23T22:36:18+0800
*/
public function Save()
{
$params = input('post.');
$params['user'] = $this->user;
$ret = UserService::UserAddressSave($params);
return json($ret);
}
/**
* 删除地址
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-18
* @desc description
*/
public function Delete()
{
$params = $_POST;
$params['user'] = $this->user;
$ret = UserService::UserAddressDelete($params);
return json($ret);
}
/**
* 默认地址设置
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-18
* @desc description
*/
public function SetDefault()
{
$params = $_POST;
$params['user'] = $this->user;
$ret = UserService::UserAddressDefault($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\index\controller;
use app\service\GoodsService;
/**
* 用户收藏
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class UserFavor extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
// 是否登录
$this->Is_Login();
}
/**
* 商品收藏
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-09
* @desc description
*/
public function Goods()
{
// 参数
$params = input();
$params['user'] = $this->user;
// 分页
$number = 10;
// 条件
$where = GoodsService::UserGoodsFavorListWhere($params);
// 获取总数
$total = GoodsService::GoodsFavorTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('index/userfavor/goods'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = GoodsService::GoodsFavorList($data_params);
$this->assign('data_list', $data['data']);
// 参数
$this->assign('params', $params);
return $this->fetch();
}
/**
* 商品收藏取消
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-13
* @desc description
*/
public function Cancel()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始处理
$params = input('post.');
$params['user'] = $this->user;
$ret = GoodsService::GoodsFavor($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\index\controller;
use app\service\GoodsService;
/**
* 用户商品浏览
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class UserGoodsBrowse extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
// 是否登录
$this->Is_Login();
}
/**
* 商品浏览列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-09
* @desc description
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->user;
// 分页
$number = 10;
// 条件
$where = GoodsService::UserGoodsBrowseListWhere($params);
// 获取总数
$total = GoodsService::GoodsBrowseTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('index/usergoodsbrowse/Goods'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = GoodsService::GoodsBrowseList($data_params);
$this->assign('data_list', $data['data']);
$this->assign('ids', empty($data['data']) ? '' : implode(',', array_column($data['data'], 'id')));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
/**
* 商品浏览删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
*/
public function Delete()
{
// 是否ajax请求
if(!IS_AJAX)
{
$this->error('非法访问');
}
// 开始处理
$params = input('post.');
$params['user'] = $this->user;
$ret = GoodsService::GoodsBrowseDelete($params);
return json($ret);
}
}
?>
\ No newline at end of file
<?php
namespace app\index\controller;
use app\service\IntegralService;
/**
* 用户积分管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class UserIntegral extends Common
{
/**
* [_initialize 前置操作-继承公共前置方法]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function _initialize()
{
// 调用父类前置方法
parent::_initialize();
// 是否登录
$this->Is_Login();
}
/**
* 用户积分列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-28
* @desc description
*/
public function Index()
{
// 参数
$params = input();
$params['user'] = $this->user;
// 分页
$number = 10;
// 条件
$where = IntegralService::UserIntegralLogListWhere($params);
// 获取总数
$total = IntegralService::UserIntegralLogTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => url('index/userintegral/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = IntegralService::UserIntegralLogList($data_params);
$this->assign('data_list', $data['data']);
// 操作类型
$this->assign('common_integral_log_type_list', lang('common_integral_log_type_list'));
// 参数
$this->assign('params', $params);
return $this->fetch();
}
}
?>
\ No newline at end of file
<include file="Public/Header" />
{{include file="public/header" /}}
<notempty name="is_header">
<!-- header top nav -->
<include file="Public/HeaderTopNav" />
<!-- nav start -->
{{include file="public/nav" /}}
<!-- nav end -->
<!-- search -->
<include file="Public/NavSearch" />
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- header nav -->
<include file="Public/HeaderNav" />
<!-- search -->
{{include file="public/nav_search" /}}
<!-- goods category -->
<include file="Public/GoodsCategory" />
</notempty>
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content start -->
<div class="am-g my-content">
......@@ -25,5 +27,5 @@
<!-- content end -->
<!-- footer start -->
<include file="Public/Footer" />
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
......@@ -58,13 +58,13 @@ return [
// 禁止访问模块
'deny_module_list' => ['common', 'service'],
// 默认控制器名
'default_controller' => 'Index',
'default_controller' => 'index',
// 默认操作名
'default_action' => 'index',
// 默认验证器
'default_validate' => '',
// 默认的空模块名
'empty_module' => '',
'empty_module' => 'index',
// 默认的空控制器名
'empty_controller' => 'Error',
// 操作方法前缀
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册