数据列表自动读取+细节优化

This commit is contained in:
gongfuxiang
2022-08-02 17:23:10 +08:00
parent 93805af36e
commit 92cb9bd074
110 changed files with 1884 additions and 2412 deletions

View File

@ -34,10 +34,20 @@ class Admin extends Common
{
// 调用父类前置方法
parent::__construct();
// 需要校验权限
if(in_array($this->action_name, ['index', 'detail', 'delete']))
{
// 登录校验
$this->IsLogin();
// 权限校验
$this->IsPower();
}
}
/**
* 管理员列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@ -46,38 +56,6 @@ class Admin extends Common
*/
public function Index()
{
// 登录校验
$this->IsLogin();
// 权限校验
$this->IsPower();
// 总数
$total = AdminService::AdminTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/admin/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = AdminService::AdminList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -91,23 +69,6 @@ class Admin extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = AdminService::AdminList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
@ -134,26 +95,21 @@ class Admin extends Common
$this->IsPower();
}
// 管理员编辑
$data = [];
// 数据
$data = $this->data_detail;
if(!empty($params['id']))
{
$data_params = [
'where' => ['id'=>$params['id']],
'm' => 0,
'n' => 1,
];
$ret = AdminService::AdminList($data_params);
if(empty($ret['data'][0]))
if(empty($data))
{
return $this->error('管理员信息不存在', MyUrl('admin/index/index'));
}
$data = $ret['data'][0];
}
// 角色
$role_params = [
'where' => ['is_enable'=>1],
'where' => [
['is_enable', '=', 1],
],
'field' => 'id,name',
];
$role = AdminService::RoleList($role_params);
@ -231,12 +187,6 @@ class Admin extends Common
return $this->error('非法访问');
}
// 登录校验
$this->IsLogin();
// 权限校验
$this->IsPower();
// 开始操作
$params = $this->data_post;
$params['admin'] = $this->admin;

View File

@ -41,7 +41,7 @@ class Answer extends Common
}
/**
* 问答列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -49,33 +49,6 @@ class Answer extends Common
*/
public function Index()
{
// 总数
$total = AnswerService::AnswerTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/answer/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
];
$ret = AnswerService::AnswerList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -89,29 +62,11 @@ class Answer extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
];
$ret = AnswerService::AnswerList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -119,36 +74,21 @@ class Answer extends Common
*/
public function SaveInfo()
{
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
$data = $this->data_detail;
if(!empty($data))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
'is_public' => 0,
);
$ret = AnswerService::AnswerList($data_params);
// 内容
if(!empty($ret['data'][0]['content']))
if(!empty($data['content']))
{
$ret['data'][0]['content'] = str_replace('<br />', "\n", $ret['data'][0]['content']);
$data['content'] = str_replace('<br />', "\n", $data['content']);
}
// 回复内容
if(!empty($ret['data'][0]['reply']))
if(!empty($data['reply']))
{
$ret['data'][0]['reply'] = str_replace('<br />', "\n", $ret['data'][0]['reply']);
$data['reply'] = str_replace('<br />', "\n", $data['reply']);
}
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
MyViewAssign('data', $data);
@ -157,13 +97,14 @@ class Answer extends Common
MyViewAssign('common_is_text_list', MyConst('common_is_text_list'));
// 参数
$params = $this->data_request;
unset($params['id']);
MyViewAssign('params', $params);
return MyView();
}
/**
* [Save 保存]
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -42,7 +42,7 @@ class AppCenterNav extends Common
}
/**
* [Index 手机管理-首页导航列表]
*
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class AppCenterNav extends Common
*/
public function Index()
{
// 总数
$total = AppCenterNavService::AppCenterNavTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/appcenternav/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = AppCenterNavService::AppCenterNavList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,28 +62,11 @@ class AppCenterNav extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = AppCenterNavService::AppCenterNavList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -120,21 +77,6 @@ class AppCenterNav extends Common
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$ret = AppCenterNavService::AppCenterNavList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
// 静态数据
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
MyViewAssign('common_app_event_type', MyConst('common_app_event_type'));
@ -145,12 +87,11 @@ class AppCenterNav extends Common
// 数据
unset($params['id']);
MyViewAssign('params', $params);
MyViewAssign('data', $data);
return MyView();
}
/**
* [Save 手机管理-首页导航添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -170,7 +111,7 @@ class AppCenterNav extends Common
}
/**
* [Delete 手机管理-首页导航删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -191,7 +132,7 @@ class AppCenterNav extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -42,7 +42,7 @@ class AppHomeNav extends Common
}
/**
* [Index 手机管理-首页导航列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class AppHomeNav extends Common
*/
public function Index()
{
// 总数
$total = AppHomeNavService::AppHomeNavTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/apphomenav/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = AppHomeNavService::AppHomeNavList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,28 +62,11 @@ class AppHomeNav extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = AppHomeNavService::AppHomeNavList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -120,21 +77,6 @@ class AppHomeNav extends Common
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$ret = AppHomeNavService::AppHomeNavList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
// 静态数据
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
MyViewAssign('common_app_event_type', MyConst('common_app_event_type'));
@ -145,12 +87,11 @@ class AppHomeNav extends Common
// 数据
unset($params['id']);
MyViewAssign('params', $params);
MyViewAssign('data', $data);
return MyView();
}
/**
* [Save 手机管理-首页导航添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -170,7 +111,7 @@ class AppHomeNav extends Common
}
/**
* [Delete 手机管理-首页导航删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -191,7 +132,7 @@ class AppHomeNav extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -42,7 +42,7 @@ class Article extends Common
}
/**
* [Index 文章列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class Article extends Common
*/
public function Index()
{
// 总数
$total = ArticleService::ArticleTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/article/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = ArticleService::ArticleList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,28 +62,11 @@ class Article extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = ArticleService::ArticleList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 文章添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -121,18 +78,7 @@ class Article extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
);
$ret = ArticleService::ArticleList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $this->data_detail;
// 文章分类
$article_category = ArticleService::ArticleCategoryList(['field'=>'id,name']);
@ -160,7 +106,7 @@ class Article extends Common
}
/**
* [Save 文章添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -180,7 +126,7 @@ class Article extends Common
}
/**
* [Delete 文章删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -201,7 +147,7 @@ class Article extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -43,7 +43,7 @@ class Brand extends Common
}
/**
* [Index 品牌列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -51,32 +51,6 @@ class Brand extends Common
*/
public function Index()
{
// 总数
$total = BrandService::BrandTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/brand/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = BrandService::BrandList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -89,25 +63,11 @@ class Brand extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => [
['id', '=', intval($this->data_request['id'])],
],
];
$ret = BrandService::BrandList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -119,20 +79,7 @@ class Brand extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => [
['id', '=', intval($params['id'])]
],
];
$ret = BrandService::BrandList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $this->data_detail;
// 是否启用
MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list'));
@ -163,7 +110,7 @@ class Brand extends Common
}
/**
* [Save 品牌保存]
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -183,7 +130,7 @@ class Brand extends Common
}
/**
* [Delete 品牌删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -204,7 +151,7 @@ class Brand extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -50,10 +50,6 @@ class Common extends BaseController
protected $plugins_controller_name;
protected $plugins_action_name;
// 分页信息
protected $page;
protected $page_size;
// 动态表格
protected $form_table;
protected $form_where;
@ -63,6 +59,18 @@ class Common extends BaseController
protected $form_order_by;
protected $form_error;
// 列表数据
protected $data_total;
protected $data_list;
protected $data_detail;
// 分页信息
protected $page;
protected $page_start;
protected $page_size;
protected $page_html;
protected $page_url;
// 系统类型
protected $system_type;
@ -305,18 +313,38 @@ class Common extends BaseController
$ret = (new FormHandleModule())->Run($module['module'], $module['action'], $params);
if($ret['code'] == 0)
{
// 表格数据
$this->form_table = $ret['data']['table'];
$this->form_where = $ret['data']['where'];
$this->form_params = $ret['data']['params'];
$this->form_md5_key = $ret['data']['md5_key'];
$this->form_user_fields = $ret['data']['user_fields'];
$this->form_order_by = $ret['data']['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);
// 列表数据
$this->data_total = $ret['data']['data_total'];
$this->data_list = $ret['data']['data_list'];
$this->data_detail = $ret['data']['data_detail'];
MyViewAssign('data_total', $this->data_total);
MyViewAssign('data_list', $this->data_list);
MyViewAssign('data', $this->data_detail);
// 分页数据
$this->page = $ret['data']['page'];
$this->page_start = $ret['data']['page_start'];
$this->page_size = $ret['data']['page_size'];
$this->page_html = $ret['data']['page_html'];
$this->page_url = $ret['data']['page_url'];
MyViewAssign('page', $this->page);
MyViewAssign('page_start', $this->page_start);
MyViewAssign('page_size', $this->page_size);
MyViewAssign('page_html', $this->page_html);
MyViewAssign('page_url', $this->page_url);
} else {
$this->form_error = $ret['msg'];
MyViewAssign('form_error', $this->form_error);

View File

@ -41,7 +41,7 @@ class CustomView extends Common
}
/**
* [Index 列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -49,32 +49,6 @@ class CustomView extends Common
*/
public function Index()
{
// 总数
$total = CustomViewService::CustomViewTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/customview/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = CustomViewService::CustomViewList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -87,28 +61,11 @@ class CustomView extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = CustomViewService::CustomViewList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -118,29 +75,13 @@ class CustomView extends Common
{
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
];
$ret = CustomViewService::CustomViewList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
unset($params['id']);
MyViewAssign('data', $data);
MyViewAssign('params', $params);
return MyView();
}
/**
* [Save 添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -160,7 +101,7 @@ class CustomView extends Common
}
/**
* [Delete 删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -181,7 +122,7 @@ class CustomView extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -55,35 +55,9 @@ class Design extends Common
*/
public function Index()
{
// 总数
$total = DesignService::DesignTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/design/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
];
$ret = DesignService::DesignList($data_params);
// 应用商店
MyViewAssign('store_design_url', StoreService::StoreDesignUrl());
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -97,8 +71,9 @@ class Design extends Common
*/
public function SaveInfo()
{
// 是否指定id、不存在则增加数据
if(empty($this->data_request['id']))
// 数据
$data = $this->data_detail;
if(empty($data))
{
$ret = DesignService::DesignSave();
if($ret['code'] == 0)
@ -110,29 +85,11 @@ class Design extends Common
}
}
// 获取数据
$data_params = [
'where' => [
'id' => intval($this->data_request['id']),
],
'm' => 0,
'n' => 1,
];
$ret = DesignService::DesignList($data_params);
if(empty($ret['data']) || empty($ret['data'][0]))
{
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']);
unset($data['config']);
MyViewAssign('layout_data', $layout_data);
MyViewAssign('data', $data);
unset($data['config']);
// 页面列表
$pages_list = BaseLayout::PagesList();

View File

@ -46,7 +46,7 @@ class Goods extends Common
}
/**
* [Index 商品列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -54,33 +54,6 @@ class Goods extends Common
*/
public function Index()
{
// 总数
$total = GoodsService::GoodsTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/goods/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_category' => 1,
];
$ret = GoodsService::GoodsList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -93,49 +66,25 @@ class Goods extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
$data = $this->data_detail;
if(!empty($data))
{
// 条件
$where = [
['is_delete_time', '=', 0],
['id', '=', intval($this->data_request['id'])],
];
// 获取商品编辑规格
$specifications = GoodsService::GoodsEditSpecifications($data['id']);
MyViewAssign('specifications', $specifications);
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_photo' => 1,
'is_content_app' => 1,
'is_category' => 1,
];
$ret = GoodsService::GoodsList($data_params);
$data = [];
if(!empty($ret['data']) && !empty($ret['data'][0]))
{
$data = $ret['data'][0];
// 获取商品编辑参数
$parameters = GoodsService::GoodsEditParameters($data['id']);
MyViewAssign('parameters', $parameters);
// 获取商品编辑规格
$specifications = GoodsService::GoodsEditSpecifications($data['id']);
MyViewAssign('specifications', $specifications);
// 获取商品编辑参数
$parameters = GoodsService::GoodsEditParameters($data['id']);
// 商品参数类型
MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list'));
MyViewAssign('parameters', $parameters);
}
MyViewAssign('data', $data);
// 商品参数类型
MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list'));
}
return MyView();
}
/**
* [SaveInfo 商品添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -147,30 +96,13 @@ class Goods extends Common
$params = $this->data_request;
// 商品信息
$data = [];
$data = $this->data_detail;
if(!empty($params['id']))
{
// 条件
$where = [
['is_delete_time', '=', 0],
['id', '=', intval($params['id'])],
];
// 获取数据
$data_params = [
'where' => $where,
'm' => 0,
'n' => 1,
'is_photo' => 1,
'is_content_app' => 1,
'is_category' => 1,
];
$ret = GoodsService::GoodsList($data_params);
if(empty($ret['data'][0]))
if(empty($data))
{
return $this->error('商品信息不存在', MyUrl('admin/goods/index'));
}
$data = $ret['data'][0];
// 获取商品编辑规格
$specifications = GoodsService::GoodsEditSpecifications($data['id']);
@ -240,7 +172,7 @@ class Goods extends Common
}
/**
* [Save 商品添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -261,7 +193,7 @@ class Goods extends Common
}
/**
* [Delete 商品删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -51,34 +51,6 @@ class GoodsBrowse extends Common
*/
public function Index()
{
// 总数
$total = GoodsBrowseService::GoodsBrowseTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/goodsbrowse/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -92,25 +64,6 @@ class GoodsBrowse extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['b.id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}

View File

@ -41,7 +41,7 @@ class Goodscomments extends Common
}
/**
* 问答列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -49,34 +49,6 @@ class Goodscomments extends Common
*/
public function Index()
{
// 总数
$total = GoodsCommentsService::GoodsCommentsTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/goodscomments/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'is_goods' => 1,
];
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -89,31 +61,12 @@ class Goodscomments extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_goods' => 1,
];
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
MyViewAssign('common_goods_comments_rating_list', MyConst('common_goods_comments_rating_list'));
}
MyViewAssign('common_goods_comments_rating_list', MyConst('common_goods_comments_rating_list'));
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -125,20 +78,7 @@ class Goodscomments extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'is_public' => 0,
'is_goods' => 1,
);
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $this->data_detail;
MyViewAssign('data', $data);
// 静态数据
@ -154,7 +94,7 @@ class Goodscomments extends Common
}
/**
* [Save 保存]
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -174,7 +114,7 @@ class Goodscomments extends Common
}
/**
* 问答删除
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -194,7 +134,7 @@ class Goodscomments extends Common
}
/**
* 问答回复处理
* 回复
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0

View File

@ -51,34 +51,6 @@ class Goodsfavor extends Common
*/
public function Index()
{
// 总数
$total = GoodsFavorService::GoodsFavorTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/goodsfavor/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = GoodsFavorService::GoodsFavorList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -92,25 +64,6 @@ class Goodsfavor extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['f.id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = GoodsFavorService::GoodsFavorList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}

View File

@ -52,32 +52,6 @@ class GoodsParamsTemplate extends Common
*/
public function Index()
{
// 总数
$total = GoodsParamsService::GoodsParamsTemplateTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/goodsparamstemplate/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = GoodsParamsService::GoodsParamsTemplateList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -91,29 +65,15 @@ class GoodsParamsTemplate extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 数据
$data = $this->data_detail;
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = GoodsParamsService::GoodsParamsTemplateList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
// 商品参数类型
MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list'));
// 商品参数类型
MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list'));
// 参数配置
MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
// 参数配置
MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']);
}
return MyView();
}
@ -131,19 +91,7 @@ class GoodsParamsTemplate extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$ret = GoodsParamsService::GoodsParamsTemplateList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $this->data_detail;
// 商品参数类型
MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list'));

View File

@ -49,34 +49,6 @@ class IntegralLog extends Common
*/
public function Index()
{
// 总数
$total = IntegralService::IntegralLogTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/integrallog/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = IntegralService::IntegralLogList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -90,25 +62,6 @@ class IntegralLog extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = IntegralService::IntegralLogList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
}

View File

@ -41,7 +41,7 @@ class Link extends Common
}
/**
* [Index 列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -49,13 +49,6 @@ class Link extends Common
*/
public function Index()
{
// 获取列表
$data_params = [
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
];
$ret = LinkService::LinkList($data_params);
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -68,28 +61,11 @@ class Link extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = LinkService::LinkList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [Save 数据保存]
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -109,7 +85,7 @@ class Link extends Common
}
/**
* [Delete 删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -130,7 +106,7 @@ class Link extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -49,34 +49,6 @@ class Message extends Common
*/
public function Index()
{
// 总数
$total = MessageService::MessageTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/message/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = MessageService::MessageList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -89,25 +61,6 @@ class Message extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = MessageService::MessageList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}

View File

@ -50,7 +50,7 @@ class Navigation extends Common
}
/**
* [Index 导航列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -90,7 +90,7 @@ class Navigation extends Common
}
/**
* [Save 添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -111,7 +111,7 @@ class Navigation extends Common
}
/**
* [Delete 删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -131,7 +131,7 @@ class Navigation extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -53,48 +53,18 @@ class Order extends Common
*/
public function Index()
{
// 总数
$total = OrderService::OrderTotal($this->form_where);
// 提示信息
$tips_msg = OrderService::OrderTipsMsg($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/order/index'),
'tips_msg' => $tips_msg,
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'is_operate' => 1,
'user_type' => 'admin',
];
$ret = OrderService::OrderList($data_params);
// 发起支付 - 支付方式
$pay_where = [
'where' => ['is_enable'=>1, 'payment'=>MyConfig('shopxo.under_line_list')],
$pay_wparams = [
'where' => [
['is_enable', '=', 1],
['payment', 'in', MyConfig('shopxo.under_line_list')],
],
];
MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList($pay_wparams));
// 快递公司
MyViewAssign('express_list', ExpressService::ExpressList());
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -108,26 +78,6 @@ class Order extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['is_delete_time', '=', 0],
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = OrderService::OrderList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}

View File

@ -43,7 +43,7 @@ class Orderaftersale extends Common
}
/**
* 订单列表
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@ -52,36 +52,9 @@ class Orderaftersale extends Common
*/
public function Index()
{
// 总数
$total = OrderAftersaleService::OrderAftersaleTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/orderaftersale/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
];
$ret = OrderAftersaleService::OrderAftersaleList($data_params);
// 静态数据
MyViewAssign('common_order_aftersale_refundment_list', MyConst('common_order_aftersale_refundment_list'));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -94,24 +67,6 @@ class Orderaftersale extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
);
$ret = OrderAftersaleService::OrderAftersaleList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
@ -180,7 +135,7 @@ class Orderaftersale extends Common
}
/**
* 订单取消
* 取消
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@ -202,7 +157,7 @@ class Orderaftersale extends Common
}
/**
* 订单删除
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0

View File

@ -40,74 +40,29 @@ class PayLog extends Common
$this->IsPower();
}
/**
* [Index 支付日志列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
/**
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
*/
public function Index()
{
// 总数
$total = PayLogService::PayLogTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/paylog/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = PayLogService::PayLogList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-05T08:21:54+0800
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = PayLogService::PayLogList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}

View File

@ -80,34 +80,27 @@ class Payment extends Common
*/
public function SaveInfo()
{
// 参数
$params = $this->data_request;
// 商品信息
if(!empty($params['id']))
$data = [];
if(!empty($this->data_request['id']))
{
$data_params = [
'where' => ['id'=>$params['id']],
'where' => ['id'=>$this->data_request['id']],
'm' => 0,
'n' => 1,
];
$data = PaymentService::PaymentList($data_params);
if(empty($data[0]))
if(!empty($data) && !empty($data[0]))
{
return $this->error('没有相关支付方式', MyUrl('admin/payment/index'));
$data = $data[0];
}
MyViewAssign('data', $data[0]);
}
MyViewAssign('data', $data);
// 适用平台
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
// 参数
MyViewAssign('params', $params);
// 编辑器文件存放地址
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('payment'));
return MyView();
}

View File

@ -10,8 +10,6 @@
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\PayRequestLogService;
/**
* 支付请求日志管理
* @author Devil
@ -50,33 +48,6 @@ class PayRequestLog extends Common
*/
public function Index()
{
// 总数
$total = PayRequestLogService::PayRequestLogTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/payrequestlog/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'user_type' => 'admin',
];
$ret = PayRequestLogService::PayRequestLogList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -90,24 +61,6 @@ class PayRequestLog extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'user_type' => 'admin'
];
$ret = PayRequestLogService::PayRequestLogList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
}

View File

@ -42,7 +42,7 @@ class QuickNav extends Common
}
/**
* [Index 快捷导航列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class QuickNav extends Common
*/
public function Index()
{
// 总数
$total = QuickNavService::QuickNavTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/quicknav/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = QuickNavService::QuickNavList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,28 +62,11 @@ class QuickNav extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = QuickNavService::QuickNavList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -120,37 +77,21 @@ class QuickNav extends Common
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$ret = QuickNavService::QuickNavList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
MyViewAssign('data', $data);
// 静态数据
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
MyViewAssign('common_app_event_type', MyConst('common_app_event_type'));
// 参数
MyViewAssign('params', $params);
// 编辑器文件存放地址
MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('quick_nav'));
// 数据
unset($params['id']);
MyViewAssign('params', $params);
return MyView();
}
/**
* [Save 快捷导航添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -170,7 +111,7 @@ class QuickNav extends Common
}
/**
* [Delete 快捷导航删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -191,7 +132,7 @@ class QuickNav extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -10,8 +10,6 @@
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\RefundLogService;
/**
* 退款日志管理
* @author Devil
@ -41,73 +39,28 @@ class RefundLog extends Common
}
/**
* [Index 支付日志列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
*/
public function Index()
{
// 总数
$total = RefundLogService::RefundLogTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/refundlog/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
$ret = RefundLogService::RefundLogList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-05T08:21:54+0800
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
'is_public' => 0,
'user_type' => 'admin',
];
$ret = RefundLogService::RefundLogList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
}

View File

@ -41,7 +41,7 @@ class Role extends Common
}
/**
* [Index 角色组列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -49,32 +49,6 @@ class Role extends Common
*/
public function Index()
{
// 总数
$total = AdminRoleService::RoleTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/role/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = AdminRoleService::RoleList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -87,28 +61,11 @@ class Role extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = AdminRoleService::RoleList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 角色组添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -119,21 +76,12 @@ class Role extends Common
// 参数
$params = $this->data_request;
// 角色组
$data = [];
if(!empty($params['id']))
// 数据
$data = $this->data_detail;
if(!empty($data))
{
$data_params = [
'where' => ['id'=>intval($params['id'])],
];
$ret = AdminRoleService::RoleList($data_params);
if(!empty($ret['data'][0]) && !empty($ret['data'][0]['id']))
{
$data = $ret['data'][0];
// 权限关联数据
$params['role_id'] = $ret['data'][0]['id'];
}
// 权限关联数据
$params['role_id'] = $data['id'];
}
// 权限列表
@ -160,7 +108,7 @@ class Role extends Common
}
/**
* [Save 角色组添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -179,7 +127,7 @@ class Role extends Common
}
/**
* [Delete 角色删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -198,7 +146,7 @@ class Role extends Common
}
/**
* [StatusUpdate 角色状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -42,7 +42,7 @@ class Slide extends Common
}
/**
* [Index 轮播图片列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class Slide extends Common
*/
public function Index()
{
// 总数
$total = SlideService::SlideTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/slide/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = SlideService::SlideList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,28 +62,11 @@ class Slide extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = SlideService::SlideList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -120,21 +77,6 @@ class Slide extends Common
// 参数
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
];
$ret = SlideService::SlideList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
// 静态资源
MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list'));
MyViewAssign('common_platform_type', MyConst('common_platform_type'));
@ -146,12 +88,11 @@ class Slide extends Common
// 数据
unset($params['id']);
MyViewAssign('params', $params);
MyViewAssign('data', $data);
return MyView();
}
/**
* [Save 轮播图片添加/编辑]
* 添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -171,7 +112,7 @@ class Slide extends Common
}
/**
* [Delete 轮播图片删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -191,7 +132,7 @@ class Slide extends Common
}
/**
* [StatusUpdate 状态更新]
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -50,35 +50,9 @@ class User extends Common
*/
public function Index()
{
// 总数
$total = UserService::UserTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/user/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = UserService::UserList($data_params);
// Excel地址
MyViewAssign('excel_url', MyUrl('admin/user/excelexport', $this->data_request));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -91,23 +65,6 @@ class User extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = UserService::UserList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
return MyView();
}
@ -151,25 +108,17 @@ class User extends Common
// 参数
$params = $this->data_request;
// 用户编辑
$data = [];
// 数据
$data = $this->data_detail;
if(!empty($params['id']))
{
$data_params = [
'where' => ['id'=>$params['id']],
'm' => 0,
'n' => 1,
];
$ret = UserService::UserList($data_params);
if(empty($ret['data'][0]))
if(empty($data))
{
return $this->error('用户信息不存在', MyUrl('admin/user/index'));
}
// 生日
$ret['data'][0]['birthday_text'] = empty($ret['data'][0]['birthday']) ? '' : date('Y-m-d', $ret['data'][0]['birthday']);
$data = $ret['data'][0];
$data['birthday_text'] = empty($data['birthday']) ? '' : date('Y-m-d', $data['birthday']);
}
// 用户编辑页面钩子

View File

@ -42,7 +42,7 @@ class UserAddress extends Common
}
/**
* [Index 列表]
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -50,32 +50,6 @@ class UserAddress extends Common
*/
public function Index()
{
// 总数
$total = UserAddressService::UserAddressTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/useraddress/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = UserAddressService::UserAddressAdminList($data_params);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -88,29 +62,11 @@ class UserAddress extends Common
*/
public function Detail()
{
$data = [];
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = UserAddressService::UserAddressAdminList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
}
MyViewAssign('data', $data);
return MyView();
}
/**
* [SaveInfo 添加/编辑页面]
* 添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -122,19 +78,7 @@ class UserAddress extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => ['id'=>intval($params['id'])],
'field' => '*',
);
$ret = UserAddressService::UserAddressAdminList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $data = $this->data_detail;
MyViewAssign('data', $data);
// 加载地图api
@ -152,7 +96,7 @@ class UserAddress extends Common
}
/**
* [Save 保存]
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -178,7 +122,7 @@ class UserAddress extends Common
}
/**
* [Delete 删除]
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1

View File

@ -53,16 +53,6 @@ class Warehouse extends Common
*/
public function Index()
{
// 获取列表
$data_params = [
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
];
$ret = WarehouseService::WarehouseList($data_params);
MyViewAssign('data_list', $ret['data']);
// 基础参数赋值
MyViewAssign('params', $this->data_request);
return MyView();
}
@ -75,24 +65,6 @@ class Warehouse extends Common
*/
public function Detail()
{
$data = [];
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = WarehouseService::WarehouseList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
}
MyViewAssign('data', $data);
return MyView();
}
@ -110,16 +82,7 @@ class Warehouse extends Common
$params = $this->data_request;
// 数据
$data = [];
if(!empty($params['id']))
{
// 获取列表
$data_params = array(
'where' => ['id'=>intval($params['id'])],
);
$ret = WarehouseService::WarehouseList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
}
$data = $this->data_detail;
// 编辑页面钩子
$hook_name = 'plugins_view_admin_warehouse_save';

View File

@ -54,28 +54,6 @@ class WarehouseGoods extends Common
*/
public function Index()
{
// 总数
$total = WarehouseGoodsService::WarehouseGoodsTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/warehousegoods/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = WarehouseGoodsService::WarehouseGoodsList($data_params);
// 有效仓库列表
$data_params = [
'field' => 'id,name',
@ -90,10 +68,6 @@ class WarehouseGoods extends Common
// 商品分类
MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll());
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -123,7 +97,7 @@ class WarehouseGoods extends Common
// 详情数据
if(!empty($ret['data']['data']))
{
$ret = WarehouseGoodsService::DataHandle([$ret['data']['data']]);
$ret = WarehouseGoodsService::WarehouseGoodsListHandle([$ret['data']['data']]);
$data = $ret[0];
}
}

View File

@ -41,7 +41,6 @@ class Admin
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/admin/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/admin/delete'),
'delete_key' => 'ids',
@ -179,6 +178,12 @@ class Admin
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Admin',
'data_handle' => 'AdminService::AdminListHandle',
'is_page' => 1,
],
];
}

View File

@ -42,7 +42,6 @@ class Answer
'key_field' => 'id',
'status_field' => 'is_show',
'is_search' => 1,
'search_url' => MyUrl('admin/answer/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/answer/delete'),
'delete_key' => 'ids',
@ -193,6 +192,16 @@ class Answer
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Answer',
'data_handle' => 'AnswerService::AnswerListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -40,7 +40,6 @@ class AppCenterNav
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/appcenternav/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/appcenternav/delete'),
'delete_key' => 'ids',
@ -183,6 +182,13 @@ class AppCenterNav
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'AppCenterNav',
'data_handle' => 'AppCenterNavService::AppCenterNavListHandle',
'is_page' => 1,
'order_by' => 'sort asc,id asc',
],
];
}
}

View File

@ -40,7 +40,6 @@ class AppHomeNav
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/apphomenav/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/apphomenav/delete'),
'delete_key' => 'ids',
@ -183,6 +182,13 @@ class AppHomeNav
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'AppHomeNav',
'data_handle' => 'AppHomeNavService::AppHomeNavListHandle',
'is_page' => 1,
'order_by' => 'sort asc,id asc',
],
];
}
}

View File

@ -42,7 +42,6 @@ class Article
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/article/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/article/delete'),
'delete_key' => 'ids',
@ -172,6 +171,12 @@ class Article
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Article',
'data_handle' => 'ArticleService::ArticleListHandle',
'is_page' => 1,
],
];
}

View File

@ -44,7 +44,6 @@ class Brand
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/brand/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/brand/delete'),
'delete_key' => 'ids',
@ -165,6 +164,12 @@ class Brand
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Brand',
'data_handle' => 'BrandService::BrandListHandle',
'is_page' => 1,
],
];
}

View File

@ -40,7 +40,6 @@ class CustomView
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/customview/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/customview/delete'),
'delete_key' => 'ids',
@ -177,6 +176,12 @@ class CustomView
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'CustomView',
'data_handle' => 'CustomViewService::CustomViewListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -40,7 +40,6 @@ class Design
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/design/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/design/delete'),
'delete_key' => 'ids',
@ -195,6 +194,12 @@ class Design
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Design',
'data_handle' => 'DesignService::DesignListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -47,7 +47,6 @@ class Goods
'key_field' => 'id',
'status_field' => 'is_shelves',
'is_search' => 1,
'search_url' => MyUrl('admin/goods/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/goods/delete'),
'delete_key' => 'ids',
@ -296,6 +295,20 @@ class Goods
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Goods',
'data_handle' => 'GoodsService::GoodsDataHandle',
'is_page' => 1,
'data_params' => [
'is_photo' => 1,
'is_content_app' => 1,
'is_category' => 1,
],
'detail_where' => [
['is_delete_time', '=', 0],
],
],
];
}

View File

@ -41,7 +41,6 @@ class GoodsBrowse
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/goodsbrowse/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/goodsbrowse/delete'),
'delete_key' => 'ids',
@ -124,6 +123,19 @@ class GoodsBrowse
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_obj' => Db::name('GoodsBrowse')->alias('b')->join('goods g', 'g.id=b.goods_id'),
'select_field' => 'b.*, g.title, g.original_price, g.price, g.min_price, g.images',
'order_by' => 'b.id desc',
'detail_dkey' => 'b.id',
'data_handle' => 'GoodsBrowseService::GoodsBrowseListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -235,6 +235,16 @@ class GoodsComments
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'GoodsComments',
'data_handle' => 'GoodsCommentsService::GoodsCommentsListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'is_goods' => 1,
],
],
];
}

View File

@ -41,7 +41,6 @@ class GoodsFavor
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/goodsfavor/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/goodsfavor/delete'),
'delete_key' => 'ids',
@ -124,6 +123,19 @@ class GoodsFavor
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_obj' => Db::name('GoodsFavor')->alias('f')->join('goods g', 'g.id=f.goods_id'),
'select_field' => 'f.*, g.title, g.original_price, g.price, g.min_price, g.images',
'order_by' => 'f.id desc',
'detail_dkey' => 'f.id',
'data_handle' => 'GoodsFavorService::GoodsFavorListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -40,7 +40,6 @@ class GoodsParamsTemplate
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/goodsparamstemplate/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/goodsparamstemplate/delete'),
'delete_key' => 'ids',
@ -118,6 +117,16 @@ class GoodsParamsTemplate
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'GoodsParamsTemplate',
'data_handle' => 'GoodsParamsService::GoodsParamsTemplateListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}
}

View File

@ -41,7 +41,6 @@ class IntegralLog
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/integrallog/index'),
],
// 表单配置
'form' => [
@ -141,6 +140,16 @@ class IntegralLog
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'UserIntegralLog',
'data_handle' => 'IntegralService::IntegralLogListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -42,7 +42,6 @@ class Link
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/link/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/link/delete'),
'delete_key' => 'ids',
@ -157,6 +156,13 @@ class Link
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Link',
'data_handle' => 'LinkService::LinkListHandle',
'is_page' => 0,
'order_by' => 'sort asc,id desc',
],
];
}
}

View File

@ -43,7 +43,6 @@ class Message
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/message/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/message/delete'),
'delete_key' => 'ids',
@ -174,6 +173,16 @@ class Message
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Message',
'data_handle' => 'MessageService::MessageListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -424,6 +424,21 @@ class Order
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Order',
'page_tips_handle' => 'OrderService::OrderTipsMsg',
'data_handle' => 'OrderService::OrderListHandle',
'detail_where' => [
['is_delete_time', '=', 0],
],
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'is_operate'=> 1,
'user_type' => 'admin',
],
],
];
}

View File

@ -41,7 +41,6 @@ class OrderAftersale
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/orderaftersale/index'),
'is_middle' => 0,
],
// 表单配置
@ -271,6 +270,16 @@ class OrderAftersale
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'OrderAftersale',
'data_handle' => 'OrderAftersaleService::OrderAftersaleListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -42,7 +42,6 @@ class PayLog
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/paylog/index'),
'is_middle' => 0,
],
// 表单配置
@ -217,6 +216,16 @@ class PayLog
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'PayLog',
'data_handle' => 'PayLogService::PayLogListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -41,7 +41,6 @@ class PayRequestLog
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/payrequestlog/index'),
'is_middle' => 0,
],
// 表单配置
@ -248,6 +247,12 @@ class PayRequestLog
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'PayRequestLog',
'data_handle' => 'PayRequestLogService::PayRequestLogListHandle',
'is_page' => 1,
],
];
}

View File

@ -40,7 +40,6 @@ class QuickNav
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/quicknav/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/quicknav/delete'),
'delete_key' => 'ids',
@ -167,6 +166,13 @@ class QuickNav
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'QuickNav',
'data_handle' => 'QuickNavService::QuickNavListHandle',
'is_page' => 1,
'order_by' => 'sort asc,id asc',
],
];
}
}

View File

@ -42,7 +42,6 @@ class RefundLog
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/refundlog/index'),
],
// 表单配置
'form' => [
@ -186,6 +185,16 @@ class RefundLog
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'RefundLog',
'data_handle' => 'RefundLogService::RefundLogListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
'user_type' => 'admin',
],
],
];
}

View File

@ -111,6 +111,12 @@ class Role
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Role',
'data_handle' => 'AdminRoleService::RoleListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -40,7 +40,6 @@ class Slide
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/slide/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/slide/delete'),
'delete_key' => 'ids',
@ -166,6 +165,13 @@ class Slide
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Slide',
'data_handle' => 'SlideService::SlideListHandle',
'is_page' => 1,
'order_by' => 'sort asc,id asc',
],
];
}
}

View File

@ -41,7 +41,6 @@ class User
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/user/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/user/delete'),
'delete_key' => 'ids',
@ -256,6 +255,12 @@ class User
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'User',
'data_handle' => 'UserService::UserListHandle',
'is_page' => 1,
],
];
}

View File

@ -42,7 +42,6 @@ class UserAddress
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/useraddress/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/useraddress/delete'),
'delete_key' => 'ids',
@ -201,6 +200,15 @@ class UserAddress
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'UserAddress',
'data_handle' => 'UserAddressService::UserAddressListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
],
],
];
}

View File

@ -46,7 +46,6 @@ class Warehouse
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/warehouse/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/warehouse/delete'),
'delete_key' => 'ids',
@ -209,6 +208,13 @@ class Warehouse
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Warehouse',
'data_handle' => 'WarehouseService::WarehouseListHandle',
'is_page' => 1,
'order_by' => 'level desc, id desc',
],
];
}

View File

@ -165,6 +165,15 @@ class WarehouseGoods
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_obj' => Db::name('WarehouseGoods')->alias('wg')->leftJoin('warehouse_goods_spec wgs', 'wg.id=wgs.warehouse_goods_id'),
'select_field' => 'wg.*',
'order_by' => 'wg.id desc',
'detail_dkey' => 'wg.id',
'data_handle' => 'WarehouseGoodsService::WarehouseGoodsListHandle',
'is_page' => 1,
],
];
}

View File

@ -9,160 +9,164 @@
<span class="am-text-default">支付方式{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/payment/index')}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>
<input type="text" name="name" placeholder="名称" minlength="2" maxlength="60" data-validation-message="名称格式 2~30 个字符" class="am-radius" {{if !empty($data)}} value="{{$data.name}}"{{/if}} required />
</div>
<div class="am-form-group">
<label>适用终端</label>
<select name="apply_terminal" class="am-radius chosen-select" multiple="multiple" minchecked="1" data-placeholder="可选择..." data-validation-message="至少选择一个适用终端" required>
{{foreach $common_platform_type as $v}}
{{if isset($data) and isset($data['apply_terminal_old']) and is_array($data['apply_terminal_old']) and in_array($v['value'], $data['apply_terminal_old'])}}
<option value="{{$v.value}}" {{if isset($data['apply_terminal']) and in_array($v['value'], $data['apply_terminal'])}}selected{{/if}}>{{$v.name}}</option>
{{/if}}
{{/foreach}}
</select>
</div>
<div class="am-form-group am-form-file">
<label class="block">LOGO</label>
<ul class="plug-file-upload-view logo-images-view" data-form-name="logo" data-max-number="1" data-dialog-type="images">
{{if !empty($data['logo'])}}
<li>
<input type="text" name="logo" value="{{$data.logo}}" />
<img src="{{$data.logo}}" />
<i>×</i>
</li>
{{/if}}
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.logo-images-view">+上传图片</div>
</div>
<!-- plugins config start -->
{{if !empty($data['element'])}}
<div class="am-alert am-alert-secondary">
<label class="am-text-sm am-text-warning">该区域为插件配置填写项,请按照插件文档填写相应的值</label>
{{foreach $data.element as $element}}
<div class="am-form-group">
{{if !empty($element['title'])}}
<label class="block">{{$element.title}}{{if !empty($element['desc'])}}<span class="am-form-group-label-tips">{{$element.desc}}</span>{{/if}}</label>
{{if empty($data)}}
{{include file="public/not_data" /}}
{{else /}}
<div class="am-form-group">
<label>名称</label>
<input type="text" name="name" placeholder="名称" minlength="2" maxlength="60" data-validation-message="名称格式 2~30 个字符" class="am-radius" {{if !empty($data)}} value="{{$data.name}}"{{/if}} required />
</div>
<div class="am-form-group">
<label>适用终端</label>
<select name="apply_terminal" class="am-radius chosen-select" multiple="multiple" minchecked="1" data-placeholder="可选择..." data-validation-message="至少选择一个适用终端" required>
{{foreach $common_platform_type as $v}}
{{if isset($data) and isset($data['apply_terminal_old']) and is_array($data['apply_terminal_old']) and in_array($v['value'], $data['apply_terminal_old'])}}
<option value="{{$v.value}}" {{if isset($data['apply_terminal']) and in_array($v['value'], $data['apply_terminal'])}}selected{{/if}}>{{$v.name}}</option>
{{/if}}
{{switch element.element}}
{{case input}}
{{if in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])}}
{{foreach $element.element_data as $element_data_key=>$element_data}}
<label class="{{if isset($element['is_block']) and $element['is_block'] eq 1}}am-{{$element.type}}{{else /}}am-{{$element.type}}-inline{{/if}}">
<input
type="{{$element.type}}"
name="plugins_{{$element.name}}"
value="{{$element_data.value}}"
{{/foreach}}
</select>
</div>
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}} checked{{/if}}
<div class="am-form-group am-form-file">
<label class="block">LOGO</label>
<ul class="plug-file-upload-view logo-images-view" data-form-name="logo" data-max-number="1" data-dialog-type="images">
{{if !empty($data['logo'])}}
<li>
<input type="text" name="logo" value="{{$data.logo}}" />
<img src="{{$data.logo}}" />
<i>×</i>
</li>
{{/if}}
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.logo-images-view">+上传图片</div>
</div>
{{if isset($element['minchecked']) and $element['type'] eq 'checkbox'}} minchecked="{{$element.minchecked}}"{{/if}}
<!-- plugins config start -->
{{if !empty($data['element'])}}
<div class="am-alert am-alert-secondary">
<label class="am-text-sm am-text-warning">该区域为插件配置填写项,请按照插件文档填写相应的值</label>
{{foreach $data.element as $element}}
<div class="am-form-group">
{{if !empty($element['title'])}}
<label class="block">{{$element.title}}{{if !empty($element['desc'])}}<span class="am-form-group-label-tips">{{$element.desc}}</span>{{/if}}</label>
{{/if}}
{{switch element.element}}
{{case input}}
{{if in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])}}
{{foreach $element.element_data as $element_data_key=>$element_data}}
<label class="{{if isset($element['is_block']) and $element['is_block'] eq 1}}am-{{$element.type}}{{else /}}am-{{$element.type}}-inline{{/if}}">
<input
type="{{$element.type}}"
name="plugins_{{$element.name}}"
value="{{$element_data.value}}"
{{if isset($element['maxchecked']) and $element['type'] eq 'checkbox'}} maxchecked="{{$element.maxchecked}}"{{/if}}
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}} checked{{/if}}
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if isset($element['minchecked']) and $element['type'] eq 'checkbox'}} minchecked="{{$element.minchecked}}"{{/if}}
{{if $element_data_key eq 0 and isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
data-am-ucheck />
{{$element_data.name}}
</label>
{{/foreach}}
{{else /}}
<input
{{if isset($element['maxchecked']) and $element['type'] eq 'checkbox'}} maxchecked="{{$element.maxchecked}}"{{/if}}
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if $element_data_key eq 0 and isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
data-am-ucheck />
{{$element_data.name}}
</label>
{{/foreach}}
{{else /}}
<input
class="am-radius"
type="{{$element.type}}"
name="plugins_{{$element.name}}"
value="{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}"
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if isset($element['is_required']) and $element['is_required'] eq 1}} required{{/if}}
/>
{{/if}}
{{/case}}
{{case select}}
{{if !empty($element['element_data']) and is_array($element['element_data'])}}
<select
class="chosen-select am-radius"
name="plugins_{{$element.name}}"
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if !empty($element['placeholder'])}} data-placeholder="{{$element.placeholder}}"{{/if}}
{{if isset($element['is_multiple']) and $element['is_multiple'] eq 1}}
multiple
{{if isset($element['minchecked'])}} minchecked="{{$element.minchecked}}"{{/if}}
{{if isset($element['maxchecked'])}} maxchecked="{{$element.maxchecked}}"{{/if}}
{{/if}}
{{if isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
>
{{if !isset($element['is_multiple']) or $element['is_multiple'] neq 1}}
{{if !empty($element['placeholder'])}}
<option value="">{{$element.placeholder}}</option>
{{/if}}
{{/if}}
{{foreach $element.element_data as $element_data_key=>$element_data}}
<option
value="{{$element_data.value}}"
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}}selected{{/if}}
>{{$element_data.name}}</option>
{{/foreach}}
</select>
{{/if}}
{{/case}}
{{case textarea}}
<textarea
class="am-radius"
type="{{$element.type}}"
name="plugins_{{$element.name}}"
value="{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}"
{{if isset($element['rows'])}} rows="{{$element.rows}}"{{/if}}
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if isset($element['is_required']) and $element['is_required'] eq 1}} required{{/if}}
/>
{{/if}}
{{/case}}
{{case select}}
{{if !empty($element['element_data']) and is_array($element['element_data'])}}
<select
class="chosen-select am-radius"
name="plugins_{{$element.name}}"
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
{{if !empty($element['placeholder'])}} data-placeholder="{{$element.placeholder}}"{{/if}}
{{if isset($element['is_multiple']) and $element['is_multiple'] eq 1}}
multiple
{{if isset($element['minchecked'])}} minchecked="{{$element.minchecked}}"{{/if}}
{{if isset($element['maxchecked'])}} maxchecked="{{$element.maxchecked}}"{{/if}}
{{if isset($element['is_required']) and $element['is_required'] eq 1}}
{{if isset($element['minlength'])}} minlength="{{$element.minlength}}"{{/if}}
{{if isset($element['maxlength'])}} maxlength="{{$element.maxlength}}"{{/if}}
required
{{/if}}
>{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}</textarea>
{{/case}}
{{case message}}
<div class="am-alert am-alert-danger" data-am-alert>
{{$element.message|raw}}
</div>
{{/case}}
{{/switch}}
</div>
{{/foreach}}
</div>
{{/if}}
<!-- plugins config end -->
{{if isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
>
{{if !isset($element['is_multiple']) or $element['is_multiple'] neq 1}}
{{if !empty($element['placeholder'])}}
<option value="">{{$element.placeholder}}</option>
{{/if}}
{{/if}}
{{foreach $element.element_data as $element_data_key=>$element_data}}
<option
value="{{$element_data.value}}"
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}}selected{{/if}}
>{{$element_data.name}}</option>
{{/foreach}}
</select>
{{/if}}
{{/case}}
{{case textarea}}
<textarea
class="am-radius"
name="plugins_{{$element.name}}"
<div class="am-form-group">
<label>顺序</label>
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="{{if isset($data['sort'])}}{{$data.sort}}{{else /}}0{{/if}}" required />
</div>
{{if isset($element['rows'])}} rows="{{$element.rows}}"{{/if}}
<div class="am-form-group">
<label class="block">用户开放</label>
<input name="is_open_user" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_open_user']) and $data['is_open_user'] eq 1) or !isset($data['is_open_user'])}}checked="true"{{/if}} />
</div>
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
{{if isset($element['is_required']) and $element['is_required'] eq 1}}
{{if isset($element['minlength'])}} minlength="{{$element.minlength}}"{{/if}}
{{if isset($element['maxlength'])}} maxlength="{{$element.maxlength}}"{{/if}}
required
{{/if}}
>{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}</textarea>
{{/case}}
{{case message}}
<div class="am-alert am-alert-danger" data-am-alert>
{{$element.message|raw}}
</div>
{{/case}}
{{/switch}}
</div>
{{/foreach}}
<div class="am-form-group">
<label class="block">是否启用</label>
<input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_enable']) and $data['is_enable'] eq 1) or !isset($data['is_enable'])}}checked="true"{{/if}} />
</div>
<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
<input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
{{/if}}
<!-- plugins config end -->
<div class="am-form-group">
<label>顺序</label>
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="{{if isset($data['sort'])}}{{$data.sort}}{{else /}}0{{/if}}" required />
</div>
<div class="am-form-group">
<label class="block">用户开放</label>
<input name="is_open_user" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_open_user']) and $data['is_open_user'] eq 1) or !isset($data['is_open_user'])}}checked="true"{{/if}} />
</div>
<div class="am-form-group">
<label class="block">是否启用</label>
<input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_enable']) and $data['is_enable'] eq 1) or !isset($data['is_enable'])}}checked="true"{{/if}} />
</div>
<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
<input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
<!-- form end -->
</div>

View File

@ -3,7 +3,7 @@
<i class="am-icon-eye"></i>
<span>详情</span>
</button>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/quicknav/saveinfo', array('id'=>$module_data['id']))}}">
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/quicknav/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>

View File

@ -10,8 +10,7 @@
<!-- 底部提示信息 -->
{{block name="form_operate_bottom"}}
<div class="am-alert am-alert-warning" data-am-alert>
<button type="button" class="am-close">&times;</button>
<div class="am-alert am-alert-warning">
<p>1. 权重数值越大代表权重越高、扣除库存按照权重依次扣除)</p>
<p>2. 仓库仅软删除、删除后将不可用、仅数据库中保留数据)可以自行删除关联的商品数据</p>
<p>3. 仓库停用和删除、关联的商品库存会立即释放</p>

View File

@ -1050,9 +1050,12 @@ function CallPluginsData($plugins, $attachment_field = [], $service_name = '', $
// 查看是否存在基础服务层并且定义获取基础配置方法
$plugins_class = 'app\plugins\\'.$plugins.'\service\BaseService';
if(class_exists($plugins_class) && method_exists($plugins_class, 'BaseConfig'))
if(class_exists($plugins_class))
{
return $plugins_class::BaseConfig();
if(ethod_exists($plugins_class, 'BaseConfig'))
{
return $plugins_class::BaseConfig();
}
}
// 未指定附件字段则自动去获取

View File

@ -49,35 +49,8 @@ class Answer extends Common
*/
public function Index()
{
// 总数
$total = AnswerService::AnswerTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/answer/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = AnswerService::AnswerList($data_params);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('问答/留言', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -91,24 +64,7 @@ class Answer extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = AnswerService::AnswerList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
MyViewAssign('data', $this->data_detail);
MyViewAssign('is_header', 0);
MyViewAssign('is_footer', 0);
return MyView();

View File

@ -59,10 +59,6 @@ class Common extends BaseController
protected $plugins_controller_name;
protected $plugins_action_name;
// 分页信息
protected $page;
protected $page_size;
// 动态表格
protected $form_table;
protected $form_where;
@ -72,6 +68,18 @@ class Common extends BaseController
protected $form_order_by;
protected $form_error;
// 列表数据
protected $data_total;
protected $data_list;
protected $data_detail;
// 分页信息
protected $page;
protected $page_start;
protected $page_size;
protected $page_html;
protected $page_url;
// 系统类型
protected $system_type;
@ -400,18 +408,38 @@ class Common extends BaseController
$ret = (new FormHandleModule())->Run($module['module'], $module['action'], $params);
if($ret['code'] == 0)
{
// 表格数据
$this->form_table = $ret['data']['table'];
$this->form_where = $ret['data']['where'];
$this->form_params = $ret['data']['params'];
$this->form_md5_key = $ret['data']['md5_key'];
$this->form_user_fields = $ret['data']['user_fields'];
$this->form_order_by = $ret['data']['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);
// 列表数据
$this->data_total = $ret['data']['data_total'];
$this->data_list = $ret['data']['data_list'];
$this->data_detail = $ret['data']['data_detail'];
MyViewAssign('data_total', $this->data_total);
MyViewAssign('data_list', $this->data_list);
MyViewAssign('data', $this->data_detail);
// 分页数据
$this->page = $ret['data']['page'];
$this->page_start = $ret['data']['page_start'];
$this->page_size = $ret['data']['page_size'];
$this->page_html = $ret['data']['page_html'];
$this->page_url = $ret['data']['page_url'];
MyViewAssign('page', $this->page);
MyViewAssign('page_start', $this->page_start);
MyViewAssign('page_size', $this->page_size);
MyViewAssign('page_html', $this->page_html);
MyViewAssign('page_url', $this->page_url);
} else {
$this->form_error = $ret['msg'];
MyViewAssign('form_error', $this->form_error);

View File

@ -48,38 +48,11 @@ class Message extends Common
*/
public function Index()
{
// 总数
$total = MessageService::MessageTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/message/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = MessageService::MessageList($data_params);
// 消息更新未已读
MessageService::MessageRead(['user'=>$this->user]);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('我的消息', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -93,24 +66,7 @@ class Message extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = MessageService::MessageList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
MyViewAssign('data', $this->data_detail);
MyViewAssign('is_header', 0);
MyViewAssign('is_footer', 0);
return MyView();

View File

@ -56,45 +56,15 @@ class Order extends Common
*/
public function Index()
{
// 总数
$total = OrderService::OrderTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/order/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
'is_orderaftersale' => 1,
'is_operate' => 1,
'user_type' => 'user',
];
$ret = OrderService::OrderList($data_params);
// 支付参数
$pay_params = OrderService::PayParamsHandle($this->data_request);
MyViewAssign('pay_params', $pay_params);
// 发起支付 - 支付方式
MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('我的订单', 1));
// 基础参数赋值
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
MyViewAssign('pay_params', $pay_params);
MyViewAssign('params', $this->data_request);
return MyView();
}
@ -109,7 +79,7 @@ class Order extends Common
public function Detail()
{
// 获取订单信息
$data = $this->OrderFirst();
$data = $this->data_detail;
if(empty($data))
{
MyViewAssign('msg', '没有相关数据');
@ -125,13 +95,13 @@ class Order extends Common
// 支付参数
$pay_params = OrderService::PayParamsHandle($this->data_request);
MyViewAssign('pay_params', $pay_params);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单详情', 1));
// 数据赋值
MyViewAssign('data', $data);
MyViewAssign('pay_params', $pay_params);
MyViewAssign('params', $this->data_request);
return MyView();
}

View File

@ -49,36 +49,8 @@ class Orderaftersale extends Common
*/
public function Index()
{
// 总数
$total = OrderAftersaleService::OrderAftersaleTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/orderaftersale/index'),
];
$page = new \base\Page($page_params);
// 获取数据列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
];
$ret = OrderAftersaleService::OrderAftersaleList($data_params);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单售后', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}

View File

@ -48,35 +48,8 @@ class UserGoodsBrowse extends Common
*/
public function Index()
{
// 总数
$total = GoodsBrowseService::GoodsBrowseTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/usergoodsbrowse/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('我的足迹', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -90,24 +63,7 @@ class UserGoodsBrowse extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['b.id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = GoodsBrowseService::GoodsBrowseList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
MyViewAssign('data', $this->data_detail);
MyViewAssign('is_header', 0);
MyViewAssign('is_footer', 0);
return MyView();

View File

@ -48,35 +48,8 @@ class UserGoodsFavor extends Common
*/
public function Index()
{
// 总数
$total = GoodsFavorService::GoodsFavorTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/usergoodsfavor/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = GoodsFavorService::GoodsFavorList($data_params);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('商品收藏', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -90,24 +63,7 @@ class UserGoodsFavor extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['f.id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = GoodsFavorService::GoodsFavorList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
MyViewAssign('data', $this->data_detail);
MyViewAssign('is_header', 0);
MyViewAssign('is_footer', 0);
return MyView();

View File

@ -49,39 +49,12 @@ class UserIntegral extends Common
*/
public function Index()
{
// 总数
$total = IntegralService::IntegralLogTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('index/userintegral/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'where' => $this->form_where,
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'order_by' => $this->form_order_by['data'],
];
$ret = IntegralService::IntegralLogList($data_params);
// 用户积分
$integral = IntegralService::UserIntegral($this->user['id']);
MyViewAssign('user_integral_data', $integral);
// 浏览器名称
MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('我的积分', 1));
// 基础参数赋值
MyViewAssign('params', $this->data_request);
MyViewAssign('page_html', $page->GetPageHtml());
MyViewAssign('data_list', $ret['data']);
return MyView();
}
@ -95,24 +68,7 @@ class UserIntegral extends Common
*/
public function Detail()
{
if(!empty($this->data_request['id']))
{
// 条件
$where = [
['id', '=', intval($this->data_request['id'])],
];
// 获取列表
$data_params = [
'm' => 0,
'n' => 1,
'where' => $where,
];
$ret = IntegralService::IntegralLogList($data_params);
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
MyViewAssign('data', $data);
}
MyViewAssign('data', $this->data_detail);
MyViewAssign('is_header', 0);
MyViewAssign('is_footer', 0);
return MyView();

View File

@ -58,7 +58,6 @@ class Answer
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/answer/index'),
],
// 表单配置
'form' => [
@ -132,6 +131,12 @@ class Answer
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Answer',
'data_handle' => 'AnswerService::AnswerListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -60,7 +60,6 @@ class Message
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/message/index'),
],
// 表单配置
'form' => [
@ -149,6 +148,12 @@ class Message
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'Message',
'data_handle' => 'MessageService::MessageListHandle',
'is_page' => 1,
],
];
}

View File

@ -62,7 +62,6 @@ class Order
$base = [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/order/index'),
'detail_title' => '基础信息',
'is_middle' => 0,
];
@ -425,9 +424,26 @@ class Order
]);
}
// 数据配置
$data = [
'table_name' => 'Order',
'page_tips_handle' => 'OrderService::OrderTipsMsg',
'data_handle' => 'OrderService::OrderListHandle',
'detail_where' => [
['is_delete_time', '=', 0],
],
'is_page' => 1,
'data_params' => [
'is_operate' => 1,
'is_orderaftersale' => 1,
'user_type' => 'user',
],
];
return [
'base' => $base,
'form' => $form,
'data' => $data,
];
}

View File

@ -58,7 +58,6 @@ class OrderAftersale
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('admin/orderaftersale/index'),
'is_middle' => 0,
],
// 表单配置
@ -257,6 +256,16 @@ class OrderAftersale
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'detail_action' => [],
'table_name' => 'OrderAftersale',
'data_handle' => 'OrderAftersaleService::OrderAftersaleListHandle',
'is_page' => 1,
'data_params' => [
'is_public' => 0,
],
],
];
}

View File

@ -58,7 +58,6 @@ class UserGoodsBrowse
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/usergoodsbrowse/index'),
'is_delete' => 1,
'delete_url' => MyUrl('index/usergoodsbrowse/delete'),
'delete_key' => 'ids',
@ -127,6 +126,15 @@ class UserGoodsBrowse
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_obj' => Db::name('GoodsBrowse')->alias('b')->join('goods g', 'g.id=b.goods_id'),
'select_field' => 'b.*, g.title, g.original_price, g.price, g.min_price, g.images',
'order_by' => 'b.id desc',
'detail_dkey' => 'b.id',
'data_handle' => 'GoodsBrowseService::GoodsBrowseListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -127,6 +127,15 @@ class UserGoodsFavor
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_obj' => Db::name('GoodsFavor')->alias('f')->join('goods g', 'g.id=f.goods_id'),
'select_field' => 'f.*, g.title, g.original_price, g.price, g.min_price, g.images',
'order_by' => 'f.id desc',
'detail_dkey' => 'f.id',
'data_handle' => 'GoodsFavorService::GoodsFavorListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -58,7 +58,6 @@ class UserIntegral
'base' => [
'key_field' => 'id',
'is_search' => 1,
'search_url' => MyUrl('index/userintegral/index'),
],
// 表单配置
'form' => [
@ -134,6 +133,12 @@ class UserIntegral
'fixed' => 'right',
],
],
// 数据配置
'data' => [
'table_name' => 'UserIntegralLog',
'data_handle' => 'IntegralService::IntegralLogListHandle',
'is_page' => 1,
],
];
}
}

View File

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\module;
use think\facade\Db;
use app\service\FormTableService;
/**
@ -39,6 +40,28 @@ class FormHandleModule
// 排序
public $order_by;
// 当前系统操作名称
public $module_name;
public $controller_name;
public $action_name;
// 当前插件操作名称
public $plugins_module_name;
public $plugins_controller_name;
public $plugins_action_name;
// 分页信息
public $page;
public $page_start;
public $page_size;
public $page_html;
public $page_url;
// 列表数据及详情
public $data_total;
public $data_list;
public $data_detail;
/**
* 运行入口
* @author Devil
@ -82,8 +105,8 @@ class FormHandleModule
// 基础条件
$this->BaseWhereHandle();
// 表格数据处理
$this->FormDataHandle();
// 表格配置处理
$this->FormConfigHandle();
// 基础数据结尾处理
$this->FormBaseLastHandle();
@ -94,6 +117,9 @@ class FormHandleModule
// 排序字段处理
$this->FormOrderByHandle();
// 数据列表处理
$this->FormDataListHandle();
// 数据返回
$data = [
'table' => $this->form_data,
@ -102,6 +128,14 @@ class FormHandleModule
'md5_key' => $this->md5_key,
'user_fields' => $this->user_fields,
'order_by' => $this->order_by,
'page' => $this->page,
'page_start' => $this->page_start,
'page_size' => $this->page_size,
'page_url' => $this->page_url,
'page_html' => $this->page_html,
'data_total' => $this->data_total,
'data_list' => $this->data_list,
'data_detail' => $this->data_detail,
];
// 钩子-结束
@ -192,6 +226,239 @@ class FormHandleModule
$this->order_by['val'] = empty($this->out_params['fp_order_by_val']) ? '' : $this->out_params['fp_order_by_val'];
$this->order_by['field'] = '';
$this->order_by['data'] = '';
// 分页信息
$this->page = max(1, isset($this->out_params['page']) ? intval($this->out_params['page']) : 1);
$this->page_size = min(empty($this->out_params['page_size']) ? MyC('common_page_size', 10, true) : intval($this->out_params['page_size']), 1000);
// 当前系统操作名称
$this->module_name = RequestModule();
$this->controller_name = RequestController();
$this->action_name = RequestAction();
// 当前插件操作名称, 兼容插件模块名称
if(empty($this->out_params['pluginsname']))
{
// 默认插件模块赋空值
$this->plugins_module_name = '';
$this->plugins_controller_name = '';
$this->plugins_action_name = '';
// 当前页面地址
$this->page_url = MyUrl($this->module_name.'/'.$this->controller_name.'/'.$this->action_name);
} else {
// 处理插件页面模块
$this->plugins_module_name = $this->out_params['pluginsname'];
$this->plugins_controller_name = empty($this->out_params['pluginscontrol']) ? 'index' : $this->out_params['pluginscontrol'];
$this->plugins_action_name = empty($this->out_params['pluginsaction']) ? 'index' : $this->out_params['pluginsaction'];
// 当前页面地址
if($this->module_name == 'admin')
{
$this->page_url = PluginsAdminUrl($this->plugins_module_name, $this->plugins_controller_name, $this->plugins_action_name);
} else {
$this->page_url = PluginsHomeUrl($this->plugins_module_name, $this->plugins_controller_name, $this->plugins_action_name);
}
}
// 是否开启搜索
if(isset($this->form_data['base']['is_search']) && $this->form_data['base']['is_search'] == 1)
{
// 是否设置搜索重置链接
if(empty($this->form_data['base']['search_url']))
{
$this->form_data['base']['search_url'] = $this->page_url;
}
}
}
/**
* 数据列表处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
*/
public function FormDataListHandle()
{
if(!empty($this->form_data['data']))
{
$form_data = $this->form_data['data'];
// 列表和详情
$list_action = isset($form_data['list_action']) ? (is_array($form_data['list_action']) ? $form_data['list_action'] : [$form_data['list_action']]) : ['index'];
$detail_action = isset($form_data['detail_action']) ? (is_array($form_data['detail_action']) ? $form_data['detail_action'] : [$form_data['detail_action']]) : ['detail', 'saveinfo'];
if(empty($this->plugins_module_name))
{
$is_list = in_array($this->action_name, $list_action);
$is_detail = in_array($this->action_name, $detail_action);
} else {
$is_list = in_array($this->plugins_action_name, $list_action);
$is_detail = in_array($this->plugins_action_name, $detail_action);
}
// 非列表和详情则不处理
if(!$is_list && !$is_detail)
{
return false;
}
// 数据库对象
$db = null;
if(!empty($form_data['table_obj']) && is_object($form_data['table_obj']))
{
$db = $form_data['table_obj'];
} elseif(!empty($form_data['table_name']))
{
$db = Db::name($form_data['table_name']);
}
if($db === null)
{
return false;
}
// 读取字段
$select_field = empty($form_data['select_field']) ? '*' : $form_data['select_field'];
$db->field($select_field);
// 数据读取
if($is_list)
{
// 加入条件
$db->where($this->where);
// 总数
$this->data_total = (int) $db->count();
if($this->data_total > 0)
{
// 是否使用分页
$is_page = (!isset($form_data['is_page']) || $form_data['is_page'] == 1);
if($is_page)
{
// 是否定义分页提示信息
$tips_msg = '';
$m = $this->ServiceActionModule($form_data, 'page_tips_handle');
if(!empty($m))
{
$module = $m['module'];
$action = $m['action'];
$tips_msg = $module::$action($this->where);
}
// 分页组件
$page_params = [
'number' => $this->page_size,
'total' => $this->data_total,
'where' => $this->out_params,
'page' => $this->page,
'url' => $this->page_url,
'tips_msg' => $tips_msg,
];
$page = new \base\Page($page_params);
$this->page_start = $page->GetPageStarNumber();
$this->page_html = $page->GetPageHtml();
// 增加分页
$db->limit($this->page_start, $this->page_size);
}
// 增加排序、未设置则默认[ id desc ]
$order_by = empty($this->order_by['data']) ? (array_key_exists('order_by', $form_data) ? $form_data['order_by'] : 'id desc') : $this->order_by['data'];
if(!empty($order_by))
{
$db->order($order_by);
}
// 读取数据
$this->data_list = $db->select()->toArray();
}
} else {
// 默认条件
$this->where = empty($form_data['detail_where']) ? [] : $form_data['detail_where'];
// 单独处理条件
$detail_dkey = empty($form_data['detail_dkey']) ? 'id' : $form_data['detail_dkey'];
$detail_pkey = empty($form_data['detail_pkey']) ? 'id' : $form_data['detail_pkey'];
$value = empty($this->out_params[$detail_pkey]) ? 0 : $this->out_params[$detail_pkey];
$this->where[] = [$detail_dkey, '=', $value];
$db->where($this->where);
// 读取数据、仅读取一条
$this->data_list = $db->limit(0, 1)->select()->toArray();
}
// 数据处理
if(!empty($this->data_list))
{
// 是否已定义数据处理、必须存在双冒号
$m = $this->ServiceActionModule($form_data, 'data_handle');
if(!empty($m))
{
$module = $m['module'];
$action = $m['action'];
// 数据请求参数
$data_params = empty($form_data['data_params']) ? [] : $form_data['data_params'];
$res = $module::$action($this->data_list, $data_params);
// 是否按照数据返回格式方法放回的数据
if(isset($res['code']) && isset($res['msg']) && isset($res['data']))
{
$this->data_list = $res['data'];
} else {
$this->data_list = $res;
}
}
// 是否详情页
if($is_detail)
{
$this->data_detail = $this->data_list[0];
$this->data_list = [];
}
}
}
}
/**
* 服务层方法模块
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-02
* @desc description
* @param [string] $data [模块数据]
* @param [string] $field [字段]
*/
public function ServiceActionModule($data, $field)
{
$result = [];
if(!empty($data) && !empty($data[$field]) && stripos($data[$field], '::') !== false)
{
$arr = explode('::', $data[$field]);
// 是否存在命名空间反斜杠
if(stripos($arr[0], '\\') === false)
{
if(empty($this->plugins_module_name))
{
$module = 'app\service\\'.$arr[0];
} else {
$module = 'app\plugins\\'.$this->plugins_module_name.'\service\\'.$arr[0];
}
} else {
$module = $arr[0];
}
$action = $arr[1];
if(class_exists($module));
{
if(method_exists($module, $action))
{
$result = [
'module' => $module,
'action' => $action,
];
}
}
}
return $result;
}
/**
@ -304,14 +571,14 @@ class FormHandleModule
}
/**
* 表格数据处理
* 表格配置处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-02
* @desc description
*/
public function FormDataHandle()
public function FormConfigHandle()
{
foreach($this->form_data['form'] as $k=>&$v)
{

View File

@ -41,6 +41,21 @@ class AdminRoleService
// 获取角色列表
$data = Db::name('Role')->field($field)->where($where)->order($order_by)->limit($m, $n)->select()->toArray();
return DataReturn('处理成功', 0, self::RoleListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function RoleListHandle($data, $params = [])
{
if(!empty($data))
{
// 获取对应菜单权限数据
@ -66,7 +81,6 @@ class AdminRoleService
}
}
// 是否存在超级管理角色组
// 超级管理员数据库中并没存储关联关系,所以这里直接读取全部权限菜单
if(in_array(1, $ids))
@ -93,21 +107,7 @@ class AdminRoleService
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 角色总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-07
* @desc description
* @param [array] $where [条件]
*/
public static function RoleTotal($where = [])
{
return (int) Db::name('Role')->where($where)->count();
return $data;
}
/**

View File

@ -27,23 +27,17 @@ class AdminService
public static $admin_login_key = 'admin_login_info';
/**
* 管理员列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function AdminList($params = [])
public static function AdminListHandle($data, $params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'id desc' : trim($params['order_by']);
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取管理员列表
$data = Db::name('Admin')->where($where)->field($field)->order($order_by)->limit($m, $n)->select()->toArray();
if(!empty($data))
{
// 获取当前用户角色名称
@ -69,20 +63,7 @@ class AdminService
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 管理员总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
* @param [array] $where [条件]
*/
public static function AdminTotal($where)
{
return (int) Db::name('Admin')->where($where)->count();
return $data;
}
/**

View File

@ -57,6 +57,21 @@ class AnswerService
// 获取数据列表
$data = Db::name('Answer')->field($field)->where($where)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::AnswerListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function AnswerListHandle($data, $params = [])
{
if(!empty($data))
{
// 用户默认头像
@ -114,7 +129,7 @@ class AnswerService
}
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -24,23 +24,17 @@ use app\service\ResourcesService;
class AppCenterNavService
{
/**
* 用户中心导航列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function AppCenterNavList($params = [])
public static function AppCenterNavListHandle($data, $params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'sort asc, id asc' : trim($params['order_by']);
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取品牌列表
$data = Db::name('AppCenterNav')->where($where)->order($order_by)->limit($m, $n)->select()->toArray();
if(!empty($data))
{
$common_platform_type = MyConst('common_platform_type');
@ -76,20 +70,7 @@ class AppCenterNavService
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 用户中心导航总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
* @param [array] $where [条件]
*/
public static function AppCenterNavTotal($where)
{
return (int) Db::name('AppCenterNav')->where($where)->count();
return $data;
}
/**

View File

@ -24,23 +24,17 @@ use app\service\ResourcesService;
class AppHomeNavService
{
/**
* 首页导航列表
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function AppHomeNavList($params = [])
public static function AppHomeNavListHandle($data, $params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'sort asc,id asc' : trim($params['order_by']);
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取品牌列表
$data = Db::name('AppHomeNav')->where($where)->order($order_by)->limit($m, $n)->select()->toArray();
if(!empty($data))
{
$common_platform_type = MyConst('common_platform_type');
@ -76,20 +70,7 @@ class AppHomeNavService
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 首页导航总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-10T22:16:29+0800
* @param [array] $where [条件]
*/
public static function AppHomeNavTotal($where)
{
return (int) Db::name('AppHomeNav')->where($where)->count();
return $data;
}
/**

View File

@ -53,7 +53,7 @@ class ArticleService
MyCache($key, $data, 180);
} else {
// 处理数据、由于平台不一样url地址或者其他数据也会不一样
$data = self::DataHandle($data);
$data = self::ArticleListHandle($data);
}
return $data;
}
@ -76,7 +76,7 @@ class ArticleService
$n = isset($params['n']) ? intval($params['n']) : 10;
$data = Db::name('Article')->field($field)->where($where)->order($order_by)->limit($m, $n)->select()->toArray();
return DataReturn('处理成功', 0, self::DataHandle($data));
return DataReturn('处理成功', 0, self::ArticleListHandle($data, $params));
}
/**
@ -86,9 +86,10 @@ class ArticleService
* @version 1.0.0
* @date 2021-11-09
* @desc description
* @param [array] $data [文章数据]
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function DataHandle($data)
public static function ArticleListHandle($data, $params = [])
{
if(!empty($data))
{
@ -600,14 +601,14 @@ class ArticleService
['is_enable', '=', 1],
['id', '<', $article_id],
];
$last = self::DataHandle(Db::name('Article')->where($where)->field($field)->order('id desc')->limit(1)->select()->toArray());
$last = self::ArticleListHandle(Db::name('Article')->where($where)->field($field)->order('id desc')->limit(1)->select()->toArray());
// 下一条数据
$where = [
['is_enable', '=', 1],
['id', '>', $article_id],
];
$next = self::DataHandle(Db::name('Article')->where($where)->field($field)->order('id asc')->limit(1)->select()->toArray());
$next = self::ArticleListHandle(Db::name('Article')->where($where)->field($field)->order('id asc')->limit(1)->select()->toArray());
return [
'last' => empty($last) ? null : $last[0],

View File

@ -54,9 +54,7 @@ class BrandService
// 获取列表
$data = Db::name('Brand')->where($where)->field($field)->order($order_by)->limit($m, $n)->select()->toArray();
// 数据处理
return DataReturn('处理成功', 0, self::DataHandle($data, $params));
return DataReturn('处理成功', 0, self::BrandListHandle($data, $params));
}
/**
@ -69,7 +67,7 @@ class BrandService
* @param [array] $data [列表数据]
* @param [array] $params [输入参数]
*/
public static function DataHandle($data, $params = [])
public static function BrandListHandle($data, $params = [])
{
if(!empty($data))
{

View File

@ -40,6 +40,21 @@ class CustomViewService
$n = isset($params['n']) ? intval($params['n']) : 10;
$data = Db::name('CustomView')->field($field)->where($where)->order($order_by)->limit($m, $n)->select()->toArray();
return DataReturn('处理成功', 0, self::CustomViewListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function CustomViewListHandle($data, $params = [])
{
if(!empty($data))
{
$common_is_enable_list = MyConst('common_is_enable_list');
@ -79,21 +94,7 @@ class CustomViewService
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function CustomViewTotal($where = [])
{
return (int) Db::name('CustomView')->where($where)->count();
return $data;
}
/**

View File

@ -42,6 +42,21 @@ class DesignService
// 获取数据
$data = Db::name('Design')->where($where)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::DesignListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function DesignListHandle($data, $params = [])
{
if(!empty($data))
{
foreach($data as &$v)
@ -63,21 +78,7 @@ class DesignService
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-16
* @desc description
* @param [array] $where [条件]
*/
public static function DesignTotal($where = [])
{
return (int) Db::name('Design')->where($where)->count();
return $data;
}
/**

View File

@ -139,6 +139,21 @@ class GoodsBrowseService
// 获取数据
$data = Db::name('GoodsBrowse')->alias('b')->join('goods g', 'g.id=b.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::GoodsBrowseListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function GoodsBrowseListHandle($data, $params = [])
{
if(!empty($data))
{
// 商品数据处理
@ -161,7 +176,7 @@ class GoodsBrowseService
}
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -202,7 +202,7 @@ class GoodsCommentsService
// 获取数据列表
$data = Db::name('GoodsComments')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::DataHandle($data, $params));
return DataReturn('处理成功', 0, self::GoodsCommentsListHandle($data, $params));
}
/**
@ -215,7 +215,7 @@ class GoodsCommentsService
* @param [array] $data [数据]
* @param [array] $params [输入参数]
*/
public static function DataHandle($data, $params = [])
public static function GoodsCommentsListHandle($data, $params = [])
{
if(!empty($data))
{
@ -668,7 +668,7 @@ class GoodsCommentsService
['is_show', '=', 1],
];
$field = 'id,user_id,order_id,business_type,content,reply,is_reply,rating,images,is_anonymous,reply_time,add_time';
return self::DataHandle(Db::name('GoodsComments')->where($where)->field($field)->limit(0, $number)->order('id desc')->select()->toArray());
return self::GoodsCommentsListHandle(Db::name('GoodsComments')->where($where)->field($field)->limit(0, $number)->order('id desc')->select()->toArray());
}
}
?>

View File

@ -202,6 +202,21 @@ class GoodsFavorService
// 获取数据
$data = Db::name('GoodsFavor')->alias('f')->join('goods g', 'g.id=f.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::GoodsFavorListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function GoodsFavorListHandle($data, $params = [])
{
if(!empty($data))
{
// 商品数据处理
@ -224,7 +239,7 @@ class GoodsFavorService
}
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -41,6 +41,21 @@ class GoodsParamsService
// 获取列表
$data = Db::name('GoodsParamsTemplate')->where($where)->order($order_by)->field($field)->limit($m, $n)->select()->toArray();
return DataReturn('处理成功', 0, self::GoodsParamsTemplateListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function GoodsParamsTemplateListHandle($data, $params = [])
{
if(!empty($data))
{
// 获取配置数据
@ -70,21 +85,7 @@ class GoodsParamsService
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public static function GoodsParamsTemplateTotal($where)
{
return (int) Db::name('GoodsParamsTemplate')->where($where)->count();
return $data;
}
/**

View File

@ -79,6 +79,21 @@ class IntegralService
// 获取数据列表
$data = Db::name('UserIntegralLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::IntegralLogListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function IntegralLogListHandle($data, $params = [])
{
if(!empty($data))
{
$integral_log_type_list = MyConst('common_integral_log_type_list');
@ -101,7 +116,7 @@ class IntegralService
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -69,6 +69,21 @@ class LinkService
$where = empty($params['where']) ? [] : $params['where'];
$order_by = empty($params['order_by']) ? 'sort asc,id desc' : trim($params['order_by']);
$data = Db::name('Link')->field($field)->where($where)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::LinkListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function LinkListHandle($data, $params = [])
{
if(!empty($data))
{
foreach($data as &$v)
@ -84,7 +99,7 @@ class LinkService
}
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -191,6 +191,21 @@ class MessageService
// 获取数据列表
$data = Db::name('Message')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('处理成功', 0, self::MessageListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function MessageListHandle($data, $params = [])
{
if(!empty($data))
{
// 字段列表
@ -229,7 +244,7 @@ class MessageService
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return DataReturn('处理成功', 0, $data);
return $data;
}
/**

View File

@ -396,6 +396,21 @@ class OrderAftersaleService
// 获取数据列表
$data = Db::name('OrderAftersale')->field($field)->where($where)->limit($m, $n)->order($order_by)->select()->toArray();
return DataReturn('获取成功', 0, self::OrderAftersaleListHandle($data, $params));
}
/**
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function OrderAftersaleListHandle($data, $params = [])
{
if(!empty($data))
{
$type_list = MyConst('common_order_aftersale_type_list');
@ -468,7 +483,7 @@ class OrderAftersaleService
}
}
return DataReturn('获取成功', 0, $data);
return $data;
}
/**

View File

@ -1204,7 +1204,7 @@ class OrderService
$data = Db::name('Order')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
// 数据处理
return self::OrderDataHandle($data, $params);
return self::OrderListHandle($data, $params);
}
/**
@ -1217,7 +1217,7 @@ class OrderService
* @param [array] $data [订单数据]
* @param [array] $params [输入参数]
*/
public static function OrderDataHandle($data, $params = [])
public static function OrderListHandle($data, $params = [])
{
$result = [];
if(!empty($data))
@ -1251,7 +1251,7 @@ class OrderService
if(in_array('warehouse_id', $keys))
{
$we_ids = array_unique(array_column($data, 'warehouse_id'));
$warehouse_list = WarehouseService::DataHandle(Db::name('Warehouse')->where(['id'=>$we_ids])->field('id,name')->select()->toArray());
$warehouse_list = WarehouseService::WarehouseListHandle(Db::name('Warehouse')->where(['id'=>$we_ids])->field('id,name')->select()->toArray());
if(!empty($warehouse_list))
{
$warehouse_list = array_column($warehouse_list, null, 'id');

View File

@ -300,7 +300,7 @@ class OrderSplitService
if(!array_key_exists($w['id'], $result))
{
// 仓库
$warehouse_handle = WarehouseService::DataHandle([$w]);
$warehouse_handle = WarehouseService::WarehouseListHandle([$w]);
$result[$w['id']] = $warehouse_handle[0];
$result[$w['id']]['goods_items'] = [];
unset($result[$w['id']]['is_default'], $result[$w['id']]['level'], $result[$w['id']]['inventory']);
@ -334,7 +334,7 @@ class OrderSplitService
if(!array_key_exists($warehouse_default['id'], $result))
{
// 仓库
$warehouse_handle = WarehouseService::DataHandle([$warehouse_default]);
$warehouse_handle = WarehouseService::WarehouseListHandle([$warehouse_default]);
$result[$warehouse_default['id']] = $warehouse_handle[0];
$result[$warehouse_default['id']]['goods_items'] = [];
}

View File

@ -181,26 +181,19 @@ class PayLogService
$data = Db::name('PayLog')->field('payment as id, payment_name as name')->group('payment,payment_name')->select()->toArray();
return DataReturn('处理成功', 0, $data);
}
/**
* 列表
* @author Devil
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function PayLogList($params = [])
public static function PayLogListHandle($data, $params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取数据列表
$data = Db::name('PayLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
if(!empty($data))
{
// 字段列表
@ -244,21 +237,7 @@ class PayLogService
$v['close_time'] = empty($v['close_time']) ? '' : date('Y-m-d H:i:s', $v['close_time']);
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function PayLogTotal($where = [])
{
return (int) Db::name('PayLog')->where($where)->count();
return $data;
}
/**

View File

@ -101,24 +101,17 @@ class PayRequestLogService
}
/**
* 列表
* @author Devil
* 列表数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @date 2022-08-01
* @desc description
* @param [array] $data [数据列表]
* @param [array] $params [输入参数]
*/
public static function PayRequestLogList($params = [])
public static function PayRequestLogListHandle($data, $params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取数据列表
$data = Db::name('PayRequestLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray();
if(!empty($data))
{
// 循环处理数据
@ -129,21 +122,7 @@ class PayRequestLogService
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function PayRequestLogTotal($where = [])
{
return (int) Db::name('PayRequestLog')->where($where)->count();
return $data;
}
}
?>

Some files were not shown because too many files have changed in this diff Show More