- PS:如【APP/小程序】中开启(开启在线客服),则以下配置必填 [企业编码] 和 [聊天窗编码] - 配置教程 -
-diff --git a/application/admin/controller/Appmini.php b/application/admin/controller/Appmini.php new file mode 100755 index 000000000..b3aef76ac --- /dev/null +++ b/application/admin/controller/Appmini.php @@ -0,0 +1,174 @@ +IsLogin(); + + // 权限校验 + $this->IsPower(); + + // 参数 + $this->params = $this->data_request; + $this->params['application_name'] = empty($this->data_request['nav_type']) ? 'weixin' : trim($this->data_request['nav_type']); + $this->assign('nav_type', $this->params['application_name']); + } + + /** + * 列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-13 + * @desc description + */ + public function Index() + { + // 提示信息 + $nav_dev_tips = [ + // 微信 + 'weixin' => '右上角 -> 详情 -> 不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书(勾选改选项即可进行小程序开发调试)。', + // 支付宝 + 'alipay' => '右上角 -> 详情 -> 域名信息下 -> 忽略 httpRequest 域名合法性检查(仅限调试时,且支付宝 10.1.35 版本以上)(勾选改选项即可进行小程序开发调试)。', + // 百度 + 'baidu' => '顶部导航 -> 校验域名(关闭即可)。', + // 百度 + 'toutiao' => '顶部导航 -> 详情 -> 不校验合法域名、web-view(业务域名)TLS版本以及HTTPS证书(勾选改选项即可进行小程序开发调试)。', + // QQ + 'qq' => '顶部导航 -> 详情 -> 不校验合法域名、web-view(业务域名)TLS版本以及HTTPS证书(勾选改选项即可进行小程序开发调试)。', + ]; + $this->assign('nav_dev_tips', $nav_dev_tips); + + // 小程序平台 + $this->assign('common_appmini_type', lang('common_appmini_type')); + + // 源码包列表 + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); + return $this->fetch(); + } + + /** + * 配置 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-13 + * @desc description + */ + public function Config() + { + // 是否 + $this->assign('common_is_text_list', lang('common_is_text_list')); + + // 小程序平台 + $this->assign('common_appmini_type', lang('common_appmini_type')); + + // 配置信息 + $this->assign('data', ConfigService::ConfigList()); + return $this->fetch(); + } + + /** + * 生成 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-13 + * @desc description + */ + public function Created() + { + // 是否ajax请求 + if(!IS_AJAX) + { + $this->error('非法访问'); + } + + // 配置内容 + $app_mini_title = MyC('common_app_mini_weixin_title'); + $app_mini_describe = MyC('common_app_mini_weixin_describe'); + if(empty($app_mini_title) || empty($app_mini_describe)) + { + return DataReturn('配置信息不能为空', -1); + } + + // 开始操作 + $this->params['app_mini_title'] = $app_mini_title; + $this->params['app_mini_describe'] = $app_mini_describe; + return AppMiniService::Created($this->params); + } + + /** + * 保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-13 + * @desc description + */ + public function Save() + { + return ConfigService::ConfigSave($_POST); + } + + /** + * 删除 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-13 + * @desc description + */ + public function Delete() + { + // 是否ajax请求 + if(!IS_AJAX) + { + $this->error('非法访问'); + } + + // 开始操作 + return AppMiniService::Delete($this->params); + } +} +?> \ No newline at end of file diff --git a/application/admin/controller/Appminialipayconfig.php b/application/admin/controller/Appminialipayconfig.php deleted file mode 100755 index c58ca8fd0..000000000 --- a/application/admin/controller/Appminialipayconfig.php +++ /dev/null @@ -1,70 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - /** - * [Index 配置列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 配置信息 - $this->assign('data', ConfigService::ConfigList()); - - return $this->fetch(); - } - - /** - * [Save 配置数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-02T23:08:19+0800 - */ - public function Save() - { - return ConfigService::ConfigSave($_POST); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminialipaylist.php b/application/admin/controller/Appminialipaylist.php deleted file mode 100755 index 57ec5535d..000000000 --- a/application/admin/controller/Appminialipaylist.php +++ /dev/null @@ -1,114 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - - // 参数 - $this->params = $this->data_request; - $this->params['application_name'] = 'alipay'; - } - - /** - * [Index 列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - $ret = AppMiniService::DataList($this->params); - $this->assign('data_list', $ret['data']); - return $this->fetch(); - } - - /** - * [Created 生成] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - */ - public function Created() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 配置内容 - $app_mini_title = MyC('common_app_mini_alipay_title'); - $app_mini_describe = MyC('common_app_mini_alipay_describe'); - if(empty($app_mini_title) || empty($app_mini_describe)) - { - return DataReturn('配置信息不能为空', -1); - } - - // 开始操作 - $this->params['app_mini_title'] = $app_mini_title; - $this->params['app_mini_describe'] = $app_mini_describe; - return AppMiniService::Created($this->params); - } - - /** - * [Delete 删除包] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 开始操作 - return AppMiniService::Delete($this->params); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminibaiduconfig.php b/application/admin/controller/Appminibaiduconfig.php deleted file mode 100755 index 2cd7135b0..000000000 --- a/application/admin/controller/Appminibaiduconfig.php +++ /dev/null @@ -1,70 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - /** - * [Index 配置列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 配置信息 - $this->assign('data', ConfigService::ConfigList()); - - return $this->fetch(); - } - - /** - * [Save 配置数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-02T23:08:19+0800 - */ - public function Save() - { - return ConfigService::ConfigSave($_POST); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminibaidulist.php b/application/admin/controller/Appminibaidulist.php deleted file mode 100755 index ebe97e712..000000000 --- a/application/admin/controller/Appminibaidulist.php +++ /dev/null @@ -1,114 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - - // 参数 - $this->params = $this->data_request; - $this->params['application_name'] = 'baidu'; - } - - /** - * [Index 列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - $ret = AppMiniService::DataList($this->params); - $this->assign('data_list', $ret['data']); - return $this->fetch(); - } - - /** - * [Created 生成] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - */ - public function Created() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 配置内容 - $app_mini_title = MyC('common_app_mini_baidu_title'); - $app_mini_describe = MyC('common_app_mini_baidu_describe'); - if(empty($app_mini_title) || empty($app_mini_describe)) - { - return DataReturn('配置信息不能为空', -1); - } - - // 开始操作 - $this->params['app_mini_title'] = $app_mini_title; - $this->params['app_mini_describe'] = $app_mini_describe; - return AppMiniService::Created($this->params); - } - - /** - * [Delete 删除包] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 开始操作 - return AppMiniService::Delete($this->params); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminiqqconfig.php b/application/admin/controller/Appminiqqconfig.php deleted file mode 100755 index 8f9c8dbe3..000000000 --- a/application/admin/controller/Appminiqqconfig.php +++ /dev/null @@ -1,70 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - /** - * [Index 配置列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 配置信息 - $this->assign('data', ConfigService::ConfigList()); - - return $this->fetch(); - } - - /** - * [Save 配置数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-02T23:08:19+0800 - */ - public function Save() - { - return ConfigService::ConfigSave($_POST); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminiqqlist.php b/application/admin/controller/Appminiqqlist.php deleted file mode 100755 index 53c0a2914..000000000 --- a/application/admin/controller/Appminiqqlist.php +++ /dev/null @@ -1,114 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - - // 参数 - $this->params = $this->data_request; - $this->params['application_name'] = 'qq'; - } - - /** - * [Index 列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - $ret = AppMiniService::DataList($this->params); - $this->assign('data_list', $ret['data']); - return $this->fetch(); - } - - /** - * [Created 生成] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - */ - public function Created() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 配置内容 - $app_mini_title = MyC('common_app_mini_qq_title'); - $app_mini_describe = MyC('common_app_mini_qq_describe'); - if(empty($app_mini_title) || empty($app_mini_describe)) - { - return DataReturn('配置信息不能为空', -1); - } - - // 开始操作 - $this->params['app_mini_title'] = $app_mini_title; - $this->params['app_mini_describe'] = $app_mini_describe; - return AppMiniService::Created($this->params); - } - - /** - * [Delete 删除包] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 开始操作 - return AppMiniService::Delete($this->params); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminitoutiaoconfig.php b/application/admin/controller/Appminitoutiaoconfig.php deleted file mode 100755 index a00a07eca..000000000 --- a/application/admin/controller/Appminitoutiaoconfig.php +++ /dev/null @@ -1,70 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - /** - * [Index 配置列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 配置信息 - $this->assign('data', ConfigService::ConfigList()); - - return $this->fetch(); - } - - /** - * [Save 配置数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-02T23:08:19+0800 - */ - public function Save() - { - return ConfigService::ConfigSave($_POST); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminitoutiaolist.php b/application/admin/controller/Appminitoutiaolist.php deleted file mode 100755 index eca9b3c68..000000000 --- a/application/admin/controller/Appminitoutiaolist.php +++ /dev/null @@ -1,114 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - - // 参数 - $this->params = $this->data_request; - $this->params['application_name'] = 'toutiao'; - } - - /** - * [Index 列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - $ret = AppMiniService::DataList($this->params); - $this->assign('data_list', $ret['data']); - return $this->fetch(); - } - - /** - * [Created 生成] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - */ - public function Created() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 配置内容 - $app_mini_title = MyC('common_app_mini_toutiao_title'); - $app_mini_describe = MyC('common_app_mini_toutiao_describe'); - if(empty($app_mini_title) || empty($app_mini_describe)) - { - return DataReturn('配置信息不能为空', -1); - } - - // 开始操作 - $this->params['app_mini_title'] = $app_mini_title; - $this->params['app_mini_describe'] = $app_mini_describe; - return AppMiniService::Created($this->params); - } - - /** - * [Delete 删除包] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 开始操作 - return AppMiniService::Delete($this->params); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminiweixinconfig.php b/application/admin/controller/Appminiweixinconfig.php deleted file mode 100755 index 9aba6ab9d..000000000 --- a/application/admin/controller/Appminiweixinconfig.php +++ /dev/null @@ -1,70 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - } - - /** - * [Index 配置列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 配置信息 - $this->assign('data', ConfigService::ConfigList()); - - return $this->fetch(); - } - - /** - * [Save 配置数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-02T23:08:19+0800 - */ - public function Save() - { - return ConfigService::ConfigSave($_POST); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Appminiweixinlist.php b/application/admin/controller/Appminiweixinlist.php deleted file mode 100755 index e835b7732..000000000 --- a/application/admin/controller/Appminiweixinlist.php +++ /dev/null @@ -1,114 +0,0 @@ -IsLogin(); - - // 权限校验 - $this->IsPower(); - - // 参数 - $this->params = $this->data_request; - $this->params['application_name'] = 'weixin'; - } - - /** - * [Index 列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - $ret = AppMiniService::DataList($this->params); - $this->assign('data_list', $ret['data']); - return $this->fetch(); - } - - /** - * [Created 生成] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - */ - public function Created() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 配置内容 - $app_mini_title = MyC('common_app_mini_weixin_title'); - $app_mini_describe = MyC('common_app_mini_weixin_describe'); - if(empty($app_mini_title) || empty($app_mini_describe)) - { - return DataReturn('配置信息不能为空', -1); - } - - // 开始操作 - $this->params['app_mini_title'] = $app_mini_title; - $this->params['app_mini_describe'] = $app_mini_describe; - return AppMiniService::Created($this->params); - } - - /** - * [Delete 删除包] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error('非法访问'); - } - - // 开始操作 - return AppMiniService::Delete($this->params); - } -} -?> \ No newline at end of file diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index 31c64ed97..bbadce7ef 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -286,22 +286,18 @@ class Common extends Controller */ protected function IsPower() { + // 不需要校验权限的方法 - $unwanted_power = array('getnodeson'); - if(!in_array(strtolower(request()->action()), $unwanted_power)) - { - // 角色组权限列表校验 - $power = empty($this->power) ? [] : $this->power; - if(!in_array(strtolower(request()->controller().'_'.request()->action()), $power)) - { - if(IS_AJAX) - { - exit(json_encode(DataReturn('无权限', -1000))); - } else { - return $this->error('无权限'); - } - } - } + $unwanted_power = ['getnodeson']; + if(!AdminIsPower(null, null, $unwanted_power)) + { + if(IS_AJAX) + { + exit(json_encode(DataReturn('无权限', -1000))); + } else { + return $this->error('无权限'); + } + } } /** diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index f527b13df..110eefdfa 100755 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -83,6 +83,9 @@ class Order extends Common // 快递公司 $this->assign('express_list', ExpressService::ExpressList()); + // 加载百度地图api + $this->assign('is_load_baidu_map_api', 1); + // 基础参数赋值 $this->assign('params', $this->data_request); $this->assign('page_html', $page->GetPageHtml()); diff --git a/application/admin/controller/Warehousegoods.php b/application/admin/controller/Warehousegoods.php new file mode 100644 index 000000000..b7ab28510 --- /dev/null +++ b/application/admin/controller/Warehousegoods.php @@ -0,0 +1,220 @@ +IsLogin(); + + // 权限校验 + $this->IsPower(); + } + + /** + * 列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + * @desc description + */ + 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, + ]; + $ret = WarehouseGoodsService::WarehouseGoodsList($data_params); + + // 基础参数赋值 + $this->assign('params', $this->data_request); + $this->assign('page_html', $page->GetPageHtml()); + $this->assign('data_list', $ret['data']); + return $this->fetch(); + } + + /** + * 详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + */ + 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 = WarehouseGoodsService::WarehouseGoodsList($data_params); + $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; + $this->assign('data', $data); + } + return $this->fetch(); + } + + /** + * 文章添加/编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + * @desc description + */ + public function SaveInfo() + { + // 参数 + $params = $this->data_request; + + // 数据 + $data = []; + if(!empty($params['id'])) + { + // 获取列表 + $data_params = array( + 'where' => ['id'=>intval($params['id'])], + ); + $ret = WarehouseGoodsService::WarehouseList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; + } + + // 文章编辑页面钩子 + $hook_name = 'plugins_view_admin_warehouse_goods_save'; + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'warehouse_id' => isset($params['id']) ? $params['id'] : 0, + 'data' => &$data, + 'params' => &$params, + ])); + + // 数据 + $this->assign('data', $data); + $this->assign('params', $params); + return $this->fetch(); + } + + /** + * 文章添加/编辑 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + * @desc description + */ + public function Save() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + $params = $this->data_request; + return WarehouseGoodsService::WarehouseSave($params); + } + + /** + * 删除 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + * @desc description + */ + public function Delete() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + $params = $this->data_request; + $params['admin'] = $this->admin; + return WarehouseGoodsService::WarehouseGoodsDelete($params); + } + + /** + * 状态更新 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-11 + * @desc description + */ + public function StatusUpdate() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + $params = $this->data_request; + $params['admin'] = $this->admin; + return WarehouseGoodsService::WarehouseGoodsStatusUpdate($params); + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appmini.php b/application/admin/form/Appmini.php new file mode 100644 index 000000000..f67ca60c0 --- /dev/null +++ b/application/admin/form/Appmini.php @@ -0,0 +1,88 @@ + [ + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appmini/delete', ['nav_type'=>$nav_type]), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '包名', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => '大小', + 'view_type' => 'field', + 'view_key' => 'size', + ], + [ + 'label' => '下载地址', + 'view_type' => 'field', + 'view_key' => 'url', + 'grid_size' => 'auto', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'time', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appmini/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Goodscomments.php b/application/admin/form/Goodscomments.php index 9c89275b5..00819a832 100644 --- a/application/admin/form/Goodscomments.php +++ b/application/admin/form/Goodscomments.php @@ -67,7 +67,7 @@ class Goodscomments 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueBaseInfo', + 'where_handle_custom' => 'WhereGoodsInfo', 'placeholder' => '请输入商品名称/型号', ], ], @@ -252,7 +252,7 @@ class Goodscomments } /** - * 基础信息条件处理 + * 商品信息条件处理 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -261,12 +261,12 @@ class Goodscomments * @param [string] $value [条件值] * @param [array] $params [输入参数] */ - public function WhereValueBaseInfo($value, $params = []) + public function WhereGoodsInfo($value, $params = []) { if(!empty($value)) { - // 获取商品评论关联的商品 id - $ids = Db::name('GoodsComments')->alias('gc')->join(['__GOODS__'=>'g'], 'gc.goods_id=g.id')->where('title|model', 'like', '%'.$value.'%')->column('gc.id'); + // 获取关联的商品 id + $ids = Db::name('GoodsComments')->alias('gc')->join(['__GOODS__'=>'g'], 'gc.goods_id=g.id')->where('g.title|g.model', 'like', '%'.$value.'%')->column('gc.id'); // 避免空条件造成无效的错觉 return empty($ids) ? [0] : $ids; diff --git a/application/admin/form/Order.php b/application/admin/form/Order.php index 503968ab7..770527e63 100644 --- a/application/admin/form/Order.php +++ b/application/admin/form/Order.php @@ -81,7 +81,7 @@ class Order 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueBaseInfo', + 'where_handle_custom' => 'WhereGoodsInfo', 'placeholder' => '请输入商品名称/型号', ], ], @@ -468,7 +468,7 @@ class Order } /** - * 基础信息条件处理 + * 商品信息条件处理 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -477,7 +477,7 @@ class Order * @param [string] $value [条件值] * @param [array] $params [输入参数] */ - public function WhereValueBaseInfo($value, $params = []) + public function WhereGoodsInfo($value, $params = []) { if(!empty($value)) { diff --git a/application/admin/form/Orderaftersale.php b/application/admin/form/Orderaftersale.php index b8d813a0e..6eaea9d80 100644 --- a/application/admin/form/Orderaftersale.php +++ b/application/admin/form/Orderaftersale.php @@ -65,7 +65,7 @@ class Orderaftersale 'form_name' => 'id', 'where_type' => 'like', 'where_type_custom' => 'in', - 'where_handle_custom' => 'WhereValueBaseInfo', + 'where_handle_custom' => 'WhereGoodsInfo', 'placeholder' => '请输入商品名称/型号', ], ], @@ -280,7 +280,7 @@ class Orderaftersale } /** - * 基础信息条件处理 + * 商品信息条件处理 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -289,12 +289,12 @@ class Orderaftersale * @param [string] $value [条件值] * @param [array] $params [输入参数] */ - public function WhereValueBaseInfo($value, $params = []) + public function WhereGoodsInfo($value, $params = []) { if(!empty($value)) { // 获取订单详情搜索的订单售后 id - $ids = Db::name('OrderAftersale')->alias('oa')->join(['__ORDER_DETAIL__'=>'od'], 'oa.order_detail_id=od.id')->where('title|model', 'like', '%'.$value.'%')->column('oa.id'); + $ids = Db::name('OrderAftersale')->alias('oa')->join(['__ORDER_DETAIL__'=>'od'], 'oa.order_detail_id=od.id')->where('od.title|od.model', 'like', '%'.$value.'%')->column('oa.id'); // 避免空条件造成无效的错觉 return empty($ids) ? [0] : $ids; diff --git a/application/admin/form/Warehousegoods.php b/application/admin/form/Warehousegoods.php new file mode 100644 index 000000000..ace88020a --- /dev/null +++ b/application/admin/form/Warehousegoods.php @@ -0,0 +1,176 @@ + [ + 'key_field' => 'id', + 'status_field' => 'is_enable', + 'is_search' => 1, + 'search_url' => MyUrl('admin/warehousegoods/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/warehousegoods/delete'), + 'delete_key' => 'ids', + 'detail_title' => '基础信息', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '基础信息', + 'view_type' => 'module', + 'view_key' => 'warehousegoods/module/goods', + 'grid_size' => 'lg', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'id', + 'where_type' => 'like', + 'where_type_custom' => 'in', + 'where_handle_custom' => 'WhereGoodsInfo', + 'placeholder' => '请输入商品名称/型号', + ], + ], + [ + 'label' => '仓库', + 'view_type' => 'field', + 'view_key' => 'warehouse_name', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'warehouse_id', + 'data' => $this->WarehouseList(), + 'data_key' => 'id', + 'data_name' => 'name', + 'where_type' => 'in', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '是否启用', + 'view_type' => 'status', + 'view_key' => 'is_enable', + 'post_url' => MyUrl('admin/warehousegoods/statusupdate'), + 'is_form_su' => 1, + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_enable_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'warehousegoods/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } + + /** + * 获取仓库数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-07-12 + * @desc description + */ + public function WarehouseList() + { + $result = []; + $ids = Db::name('WarehouseGoods')->column('warehouse_id'); + if(!empty($ids)) + { + $result = Db::name('Warehouse')->field('id,name')->where(['id'=>$ids])->select(); + } + return $result; + } + + /** + * 商品信息条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-12 + * @desc description + * @param [string] $value [条件值] + * @param [array] $params [输入参数] + */ + public function WhereGoodsInfo($value, $params = []) + { + if(!empty($value)) + { + // 获取关联的商品 id + $ids = Db::name('WarehouseGoods')->alias('wg')->join(['__GOODS__'=>'g'], 'wg.goods_id=g.id')->where('g.title|g.model', 'like', '%'.$value.'%')->column('wg.id'); + + // 避免空条件造成无效的错觉 + return empty($ids) ? [0] : $ids; + } + return $value; + } +} +?> \ No newline at end of file diff --git a/application/admin/view/default/appconfig/alipaymini.html b/application/admin/view/default/appconfig/alipaymini.html deleted file mode 100644 index aa08b82db..000000000 --- a/application/admin/view/default/appconfig/alipaymini.html +++ /dev/null @@ -1,41 +0,0 @@ -{{include file="public/header" /}} - - -
- PS:如【APP/小程序】中开启(开启在线客服),则以下配置必填 [企业编码] 和 [聊天窗编码] - 配置教程 -
-