diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 81998b82a..f57d06387 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ ThinkPHP是一个快速、简单的基于MVC和面向对象的轻量级PHP开发 ![电脑端](https://images.gitee.com/uploads/images/2019/0111/104442_0a307119_488475.gif "1547174456822.gif") # 后台管理图片展示 -![后台管理](https://images.gitee.com/uploads/images/2019/0111/104511_63926cf8_488475.gif "1547174286447.gif") +![后台管理](https://images.gitee.com/uploads/images/2019/0227/092528_9eb4dbef_488475.gif "admin-2.gif") # 功能简介 ### 后端功能列表 diff --git a/application/admin/controller/Admin.php b/application/admin/controller/Admin.php index 0ae4d6ac6..de6a37952 100755 --- a/application/admin/controller/Admin.php +++ b/application/admin/controller/Admin.php @@ -117,6 +117,7 @@ class Admin extends Common } // 管理员编辑 + $data = []; if(!empty($params['id'])) { $data_params = [ @@ -124,13 +125,14 @@ class Admin extends Common 'm' => 0, 'n' => 1, ]; - $data = AdminService::AdminList($data_params); - if(empty($data[0])) + $ret = AdminService::AdminList($data_params); + if(empty($ret[0])) { return $this->error('管理员信息不存在', MyUrl('admin/index/index')); } - $this->assign('data', $data[0]); + $data = $ret[0]; } + $this->assign('data', $data); // 角色 $role_params = [ @@ -153,17 +155,26 @@ class Admin extends Common */ public function Save() { - // 登录校验 - $this->IsLogin(); - // 是否ajax if(!IS_AJAX) { return $this->error('非法访问'); } - // 开始操作 + // 登录校验 + $this->IsLogin(); + + // 参数 $params = input('post.'); + + // 不是操作自己的情况下 + if(!isset($params['id']) || $params['id'] != $this->admin['id']) + { + // 权限校验 + $this->IsPower(); + } + + // 开始操作 $params['admin'] = $this->admin; return AdminService::AdminSave($params); } @@ -177,18 +188,18 @@ class Admin extends Common */ public function Delete() { - // 登录校验 - $this->IsLogin(); - - // 权限校验 - $this->IsPower(); - // 是否ajax if(!IS_AJAX) { return $this->error('非法访问'); } + // 登录校验 + $this->IsLogin(); + + // 权限校验 + $this->IsPower(); + // 开始操作 $params = input('post.'); $params['admin'] = $this->admin; diff --git a/application/admin/controller/Answer.php b/application/admin/controller/Answer.php index 5cef92691..c1946c450 100755 --- a/application/admin/controller/Answer.php +++ b/application/admin/controller/Answer.php @@ -53,7 +53,7 @@ class Answer extends Common $params = input(); // 分页 - $number = 10; + $number = MyC('admin_page_number', 10, true); // 条件 $where = AnswerService::AnswerListWhere($params); @@ -67,7 +67,7 @@ class Answer extends Common 'total' => $total, 'where' => $params, 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/order/index'), + 'url' => MyUrl('admin/answer/index'), ); $page = new \base\Page($page_params); $this->assign('page_html', $page->GetPageHtml()); @@ -84,6 +84,9 @@ class Answer extends Common // 状态 $this->assign('common_is_show_list', lang('common_is_show_list')); + // 是否 + $this->assign('common_is_text_list', lang('common_is_text_list')); + // 参数 $this->assign('params', $params); return $this->fetch(); diff --git a/application/admin/controller/Apphomenav.php b/application/admin/controller/Apphomenav.php index b4c6e7920..d2c3db9b6 100755 --- a/application/admin/controller/Apphomenav.php +++ b/application/admin/controller/Apphomenav.php @@ -109,6 +109,7 @@ class AppHomeNav extends Common $params = input(); // 数据 + $data = []; if(!empty($params['id'])) { // 获取列表 @@ -118,9 +119,10 @@ class AppHomeNav extends Common 'where' => ['id'=>intval($params['id'])], 'field' => '*', ); - $data = AppNavService::AppHomeNavList($data_params); - $this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]); + $ret = AppNavService::AppHomeNavList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } + $this->assign('data', $data); // 所属平台 $this->assign('common_platform_type', lang('common_platform_type')); diff --git a/application/admin/controller/Article.php b/application/admin/controller/Article.php index 3987ef525..5b8332464 100755 --- a/application/admin/controller/Article.php +++ b/application/admin/controller/Article.php @@ -110,6 +110,7 @@ class Article extends Common $params = input(); // 数据 + $data = []; if(!empty($params['id'])) { // 获取列表 @@ -119,9 +120,10 @@ class Article extends Common 'where' => ['a.id'=>intval($params['id'])], 'field' => 'a.*', ); - $data = ArticleService::ArticleList($data_params); - $this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]); + $ret = ArticleService::ArticleList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } + $this->assign('data', $data); // 是否启用 $this->assign('common_is_enable_list', lang('common_is_enable_list')); diff --git a/application/admin/controller/Brand.php b/application/admin/controller/Brand.php index 3f356d345..6593f0de9 100755 --- a/application/admin/controller/Brand.php +++ b/application/admin/controller/Brand.php @@ -107,6 +107,7 @@ class Brand extends Common $params = input(); // 数据 + $data = []; if(!empty($params['id'])) { // 获取列表 @@ -116,9 +117,10 @@ class Brand extends Common 'where' => ['id'=>intval($params['id'])], 'field' => '*', ); - $data = BrandService::BrandList($data_params); - $this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]); + $ret = BrandService::BrandList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } + $this->assign('data', $data); // 是否启用 $this->assign('common_is_enable_list', lang('common_is_enable_list')); diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index 89096b426..c640e4025 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; +use think\facade\Hook; use think\Controller; use app\service\AdminPowerService; use app\service\ConfigService; @@ -59,8 +60,40 @@ class Common extends Controller // 视图初始化 $this->ViewInit(); + + // 公共钩子初始化 + $this->CommonPluginsInit(); } + /** + * 公共钩子初始化 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-12-07 + * @desc description + */ + private function CommonPluginsInit() + { + // css钩子 + $this->assign('plugins_admin_css_data', Hook::listen('plugins_admin_css', ['hook_name'=>'plugins_admin_css', 'is_backend'=>false])); + + // js钩子 + $this->assign('plugins_admin_js_data', Hook::listen('plugins_admin_js', ['hook_name'=>'plugins_admin_js', 'is_backend'=>false])); + + // 公共header内钩子 + $this->assign('plugins_admin_common_header_data', Hook::listen('plugins_admin_common_header', ['hook_name'=>'plugins_admin_common_header', 'is_backend'=>false, 'admin'=>$this->admin])); + + // 公共页面底部钩子 + $this->assign('plugins_admin_common_page_bottom_data', Hook::listen('plugins_admin_common_page_bottom', ['hook_name'=>'plugins_admin_common_page_bottom', 'is_backend'=>false, 'admin'=>$this->admin])); + + // 公共顶部钩子 + $this->assign('plugins_admin_view_common_top_data', Hook::listen('plugins_admin_view_common_top', ['hook_name'=>'plugins_admin_view_common_top', 'is_backend'=>false, 'admin'=>$this->admin])); + + // 公共底部钩子 + $this->assign('plugins_admin_view_common_bottom_data', Hook::listen('plugins_admin_view_common_bottom', ['hook_name'=>'plugins_admin_view_common_bottom', 'is_backend'=>false, 'admin'=>$this->admin])); + } + /** * 系统初始化 * @author Devil diff --git a/application/admin/controller/Customview.php b/application/admin/controller/Customview.php index 314f2c124..785ba0311 100755 --- a/application/admin/controller/Customview.php +++ b/application/admin/controller/Customview.php @@ -112,6 +112,7 @@ class CustomView extends Common $params = input(); // 数据 + $data = []; if(!empty($params['id'])) { // 获取列表 @@ -121,9 +122,10 @@ class CustomView extends Common 'where' => ['id'=>intval($params['id'])], 'field' => '*', ); - $data = CustomViewService::CustomViewList($data_params); - $this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]); + $ret = CustomViewService::CustomViewList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } + $this->assign('data', $data); // 是否启用 $this->assign('common_is_enable_list', lang('common_is_enable_list')); diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index 900b94942..803bafcf3 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -74,12 +74,13 @@ class Goods extends Common // 获取数据列表 $data_params = [ - 'where' => $where, - 'm' => $page->GetPageStarNumber(), - 'n' => $number, - 'is_category' => 1, + 'where' => $where, + 'm' => $page->GetPageStarNumber(), + 'n' => $number, + 'is_category' => 1, + 'is_admin_access' => 1, ]; - $data = GoodsService::GoodsList($data_params); + $ret = GoodsService::GoodsList($data_params); // 是否上下架 $this->assign('common_is_shelves_list', lang('common_is_shelves_list')); @@ -89,7 +90,7 @@ class Goods extends Common $this->assign('params', $params); $this->assign('page_html', $page->GetPageHtml()); - $this->assign('data', $data); + $this->assign('data', $ret['data']); return $this->fetch(); } @@ -106,6 +107,7 @@ class Goods extends Common $params = input(); // 商品信息 + $data = []; if(!empty($params['id'])) { $data_params = [ @@ -116,17 +118,18 @@ class Goods extends Common 'is_content_app' => 1, 'is_category' => 1, ]; - $data = GoodsService::GoodsList($data_params); - if(empty($data[0])) + $ret = GoodsService::GoodsList($data_params); + if(empty($ret['data'][0])) { return $this->error('商品信息不存在', MyUrl('admin/goods/index')); } - $this->assign('data', $data[0]); + $data = $ret['data'][0]; // 获取商品编辑规格 - $specifications = GoodsService::GoodsEditSpecifications($data[0]['id']); + $specifications = GoodsService::GoodsEditSpecifications($ret['data'][0]['id']); $this->assign('specifications', $specifications); } + $this->assign('data', $data); // 地区信息 $this->assign('region_province_list', RegionService::RegionItems(['pid'=>0])); diff --git a/application/admin/controller/Plugins.php b/application/admin/controller/Plugins.php old mode 100644 new mode 100755 diff --git a/application/admin/controller/Pluginsadmin.php b/application/admin/controller/Pluginsadmin.php old mode 100644 new mode 100755 index 444ca07dd..790e1e06d --- a/application/admin/controller/Pluginsadmin.php +++ b/application/admin/controller/Pluginsadmin.php @@ -76,7 +76,7 @@ class Pluginsadmin extends Common 'total' => $total, 'where' => $params, 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/Pluginsadmin/index'), + 'url' => MyUrl('admin/pluginsadmin/index'), ); $page = new \base\Page($page_params); $this->assign('page_html', $page->GetPageHtml()); @@ -112,6 +112,7 @@ class Pluginsadmin extends Common $this->assign('params', $params); // 获取数据 + $data = []; if(!empty($params['id'])) { // 获取数据 @@ -120,10 +121,11 @@ class Pluginsadmin extends Common 'n' => 1, 'where' => ['id' => intval($params['id'])], ); - $data = PluginsAdminService::PluginsList($data_params); - $this->assign('data', $data['data'][0]); - $params['plugins'] = $data['data'][0]['plugins']; + $ret = PluginsAdminService::PluginsList($data_params); + $data = $ret['data'][0]; + $params['plugins'] = $ret['data'][0]['plugins']; } + $this->assign('data', $data); // 标记为空或等于view 并且 编辑数据为空则走第一步 if((empty($params['plugins']) || $params['plugins'] == 'view') && empty($data['data'][0])) @@ -214,5 +216,26 @@ class Pluginsadmin extends Common // 开始处理 return PluginsAdminService::PluginsUpload(input()); } + + /** + * 应用打包 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-22 + * @desc description + */ + public function Download() + { + // 开始处理 + $ret = PluginsAdminService::PluginsDownload(input()); + if(isset($ret['code']) && $ret['code'] != 0) + { + $this->assign('msg', $ret['msg']); + return $this->fetch('public/error'); + } else { + return $ret; + } + } } ?> \ No newline at end of file diff --git a/application/admin/controller/Power.php b/application/admin/controller/Power.php index 129289c58..5ee0aff68 100755 --- a/application/admin/controller/Power.php +++ b/application/admin/controller/Power.php @@ -134,20 +134,22 @@ class Power extends Common $params = input(); // 角色组 + $data = []; if(!empty($params['id'])) { $data_params = [ 'where' => ['id'=>intval($params['id'])], ]; - $data = AdminPowerService::RoleList($data_params); - if(!empty($data[0]['id'])) + $ret = AdminPowerService::RoleList($data_params); + if(!empty($ret[0]['id'])) { - $this->assign('data', $data[0]); + $data = $ret[0]; // 权限关联数据 - $params['role_id'] = $data[0]['id']; + $params['role_id'] = $ret[0]['id']; } } + $this->assign('data', $data); // 菜单列表 $power = AdminPowerService::RolePowerEditData($params); diff --git a/application/admin/controller/Slide.php b/application/admin/controller/Slide.php index 41f7e3809..bfed445e7 100755 --- a/application/admin/controller/Slide.php +++ b/application/admin/controller/Slide.php @@ -109,6 +109,7 @@ class Slide extends Common $params = input(); // 数据 + $data = []; if(!empty($params['id'])) { // 获取列表 @@ -118,9 +119,10 @@ class Slide extends Common 'where' => ['id'=>intval($params['id'])], 'field' => '*', ); - $data = SlideService::SlideList($data_params); - $this->assign('data', empty($data['data'][0]) ? [] : $data['data'][0]); + $ret = SlideService::SlideList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } + $this->assign('data', $data); // 是否启用 $this->assign('common_is_enable_list', lang('common_is_enable_list')); diff --git a/application/admin/controller/Sqlconsole.php b/application/admin/controller/Sqlconsole.php old mode 100644 new mode 100755 diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index 1cc03bde2..f44fd2054 100755 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -81,6 +81,9 @@ class User extends Common // 性别 $this->assign('common_gender_list', lang('common_gender_list')); + // 用户状态 + $this->assign('common_user_status_list', lang('common_user_status_list')); + // Excel地址 $this->assign('excel_url', MyUrl('admin/user/excelexport', $params)); @@ -128,6 +131,7 @@ class User extends Common $params = input(); // 用户编辑 + $data = []; if(!empty($params['id'])) { $data_params = [ @@ -135,14 +139,18 @@ class User extends Common 'm' => 0, 'n' => 1, ]; - $data = UserService::UserList($data_params); - if(empty($data['data'][0])) + $ret = UserService::UserList($data_params); + if(empty($ret['data'][0])) { return $this->error('用户信息不存在', MyUrl('admin/user/index')); } - $data['data'][0]['birthday_text'] = empty($data['data'][0]['birthday']) ? '' : date('Y-m-d', $data['data'][0]['birthday']); - $this->assign('data', $data['data'][0]); + + // 生日 + $ret['data'][0]['birthday_text'] = empty($ret['data'][0]['birthday']) ? '' : date('Y-m-d', $ret['data'][0]['birthday']); + + $data = $ret['data'][0]; } + $this->assign('data', $data); // 性别 $this->assign('common_gender_list', lang('common_gender_list')); diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index 9e3c1bf56..53d22a1bd 100755 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -123,6 +123,10 @@ return array( 'name' => '生日', 'type' => 'string', ], + 'status_text'=> [ + 'name' => '状态', + 'type' => 'string', + ], 'mobile' => [ 'name' => '手机号码', 'type' => 'int', diff --git a/application/admin/view/default/admin/index.html b/application/admin/view/default/admin/index.html index 464e62b07..b7bfb3f15 100755 --- a/application/admin/view/default/admin/index.html +++ b/application/admin/view/default/admin/index.html @@ -75,10 +75,10 @@ 不可操作 {{else /}} - + {{if $v['id'] neq $admin['id']}} - + {{/if}} {{/if}} diff --git a/application/admin/view/default/admin/login_info.html b/application/admin/view/default/admin/login_info.html index dd0d92735..4b71819b2 100755 --- a/application/admin/view/default/admin/login_info.html +++ b/application/admin/view/default/admin/login_info.html @@ -6,21 +6,21 @@
-
+
-
+
-
+
-
+
- diff --git a/application/admin/view/default/admin/save_info.html b/application/admin/view/default/admin/save_info.html index 2a4a3fd9d..06aaaccb0 100755 --- a/application/admin/view/default/admin/save_info.html +++ b/application/admin/view/default/admin/save_info.html @@ -30,7 +30,7 @@ {{if !isset($data['id']) or $admin['id'] neq $data['id']}}
- {{foreach $role as $v}} @@ -39,7 +39,7 @@
{{/if}} {{include file="lib/gender" /}} -
+
diff --git a/application/admin/view/default/answer/index.html b/application/admin/view/default/answer/index.html index ff606f28b..061e06020 100755 --- a/application/admin/view/default/answer/index.html +++ b/application/admin/view/default/answer/index.html @@ -21,6 +21,14 @@ {{/foreach}} +
~ @@ -37,10 +45,13 @@ 用户信息 联系信息 - 内容 - 是否显示 + 标题 + 内容 回复内容 + 访问次数 + 回复时间 创建时间 + 是否显示 更多 操作 @@ -79,12 +90,21 @@ 未填写 {{/if}} - {{$v.content}} + {{$v.title}} + {{$v.content}} + + {{if $v['is_reply'] eq 1}} + {{$v.reply}} + {{else /}} + 未回复 + {{/if}} + + {{$v.access_count}} + {{$v.reply_time}} + {{$v.add_time}} - {{$v.reply}} - {{$v.add_time}} 查看更多
@@ -130,6 +150,9 @@ {{/if}} +
标题
+
{{if empty($v['title'])}}未填写{{else /}}{{$v.title}}{{/if}}
+
内容
{{$v.content}}
@@ -137,7 +160,16 @@
{{if empty($v['is_show_text'])}}未填写{{else /}}{{$v.is_show_text}}{{/if}}
回复内容
-
{{if empty($v['reply'])}}未填写{{else /}}{{$v.reply}}{{/if}}
+
+ {{if $v['is_reply'] eq 1}} + {{$v.reply}} + {{else /}} + 未回复 + {{/if}} +
+ +
回复时间
+
{{$v.reply_time}}
创建时间
{{$v.add_time}}
@@ -151,9 +183,9 @@ {{if $v['is_reply'] eq 0}} - + {{/if}} - + {{/foreach}} @@ -185,7 +217,7 @@
-
+
diff --git a/application/admin/view/default/appconfig/index.html b/application/admin/view/default/appconfig/index.html index 5a40b9082..f70c89f98 100755 --- a/application/admin/view/default/appconfig/index.html +++ b/application/admin/view/default/appconfig/index.html @@ -27,15 +27,15 @@
- +
- +
-
+
diff --git a/application/admin/view/default/apphomenav/index.html b/application/admin/view/default/apphomenav/index.html index d0f3f635b..44f76942d 100755 --- a/application/admin/view/default/apphomenav/index.html +++ b/application/admin/view/default/apphomenav/index.html @@ -35,7 +35,7 @@ {{/foreach}} -
~ @@ -93,9 +93,9 @@ {{$v.add_time_time}} - + - + {{/foreach}} diff --git a/application/admin/view/default/apphomenav/save_info.html b/application/admin/view/default/apphomenav/save_info.html index 3eac98bdd..6a3bb6c50 100755 --- a/application/admin/view/default/apphomenav/save_info.html +++ b/application/admin/view/default/apphomenav/save_info.html @@ -65,7 +65,7 @@
-
@@ -77,7 +77,7 @@
-
+
diff --git a/application/admin/view/default/appminialipayconfig/index.html b/application/admin/view/default/appminialipayconfig/index.html index 15135c06e..66460b577 100755 --- a/application/admin/view/default/appminialipayconfig/index.html +++ b/application/admin/view/default/appminialipayconfig/index.html @@ -30,7 +30,7 @@
-
+
diff --git a/application/admin/view/default/appminialipaylist/index.html b/application/admin/view/default/appminialipaylist/index.html index 9accfc596..0e016010e 100755 --- a/application/admin/view/default/appminialipaylist/index.html +++ b/application/admin/view/default/appminialipaylist/index.html @@ -29,10 +29,10 @@ {{if !empty($v.url)}} - + {{/if}} - + {{/foreach}} diff --git a/application/admin/view/default/appminiweixinconfig/index.html b/application/admin/view/default/appminiweixinconfig/index.html index edc265149..59dc9008b 100755 --- a/application/admin/view/default/appminiweixinconfig/index.html +++ b/application/admin/view/default/appminiweixinconfig/index.html @@ -6,11 +6,11 @@
- +
- +
@@ -22,7 +22,7 @@
-
+
diff --git a/application/admin/view/default/appminiweixinlist/index.html b/application/admin/view/default/appminiweixinlist/index.html index 3d2fe15a6..14572e031 100755 --- a/application/admin/view/default/appminiweixinlist/index.html +++ b/application/admin/view/default/appminiweixinlist/index.html @@ -29,10 +29,10 @@ {{if !empty($v.url)}} - + {{/if}} - + {{/foreach}} diff --git a/application/admin/view/default/article/index.html b/application/admin/view/default/article/index.html index 425dcc48e..c190040e2 100755 --- a/application/admin/view/default/article/index.html +++ b/application/admin/view/default/article/index.html @@ -112,9 +112,9 @@ - + - + {{/foreach}} diff --git a/application/admin/view/default/article/save_info.html b/application/admin/view/default/article/save_info.html index 24296f244..bdf57d499 100755 --- a/application/admin/view/default/article/save_info.html +++ b/application/admin/view/default/article/save_info.html @@ -21,7 +21,7 @@ - @@ -37,7 +37,7 @@
- +
@@ -52,7 +52,7 @@
-
+
diff --git a/application/admin/view/default/articlecategory/index.html b/application/admin/view/default/articlecategory/index.html index a38d88c74..f05fe2b21 100755 --- a/application/admin/view/default/articlecategory/index.html +++ b/application/admin/view/default/articlecategory/index.html @@ -28,7 +28,7 @@
{{include file="lib/enable" /}} -
+
diff --git a/application/admin/view/default/brand/index.html b/application/admin/view/default/brand/index.html index 517f4b487..4d285b3a6 100755 --- a/application/admin/view/default/brand/index.html +++ b/application/admin/view/default/brand/index.html @@ -85,9 +85,9 @@ {{$v.add_time_time}} - + - + {{/foreach}} diff --git a/application/admin/view/default/brand/save_info.html b/application/admin/view/default/brand/save_info.html index 61a2dd223..2d89a18a3 100755 --- a/application/admin/view/default/brand/save_info.html +++ b/application/admin/view/default/brand/save_info.html @@ -30,7 +30,7 @@
- +
@@ -55,7 +55,7 @@
-
+
diff --git a/application/admin/view/default/brandcategory/index.html b/application/admin/view/default/brandcategory/index.html index 2c581cc3c..3c99a97b1 100755 --- a/application/admin/view/default/brandcategory/index.html +++ b/application/admin/view/default/brandcategory/index.html @@ -28,7 +28,7 @@
{{include file="lib/enable" /}} -
+
diff --git a/application/admin/view/default/config/index.html b/application/admin/view/default/config/index.html index 5ff00ced0..88c773363 100755 --- a/application/admin/view/default/config/index.html +++ b/application/admin/view/default/config/index.html @@ -6,7 +6,7 @@
- +
- +
- + + +
+
+
- +
- +
- +
@@ -55,18 +63,18 @@
- +
- +
-
+
diff --git a/application/admin/view/default/customview/index.html b/application/admin/view/default/customview/index.html index 32029a35b..00176464a 100755 --- a/application/admin/view/default/customview/index.html +++ b/application/admin/view/default/customview/index.html @@ -124,9 +124,9 @@ - + - + {{/foreach}} diff --git a/application/admin/view/default/customview/save_info.html b/application/admin/view/default/customview/save_info.html index 3ab71f184..114550889 100755 --- a/application/admin/view/default/customview/save_info.html +++ b/application/admin/view/default/customview/save_info.html @@ -40,10 +40,10 @@
- +
-
+
diff --git a/application/admin/view/default/email/index.html b/application/admin/view/default/email/index.html index caea6ce96..44e6f70c1 100755 --- a/application/admin/view/default/email/index.html +++ b/application/admin/view/default/email/index.html @@ -10,41 +10,39 @@
- +
- +
- +
- +
- +
- +
- +
- - - +
-
+
diff --git a/application/admin/view/default/email/message.html b/application/admin/view/default/email/message.html index 7092ccf7b..054ee0bc8 100755 --- a/application/admin/view/default/email/message.html +++ b/application/admin/view/default/email/message.html @@ -10,18 +10,18 @@
- +
- +
- +
-
+
diff --git a/application/admin/view/default/express/index.html b/application/admin/view/default/express/index.html index 632ed8821..b7245a2ba 100755 --- a/application/admin/view/default/express/index.html +++ b/application/admin/view/default/express/index.html @@ -39,7 +39,7 @@
{{include file="lib/enable" /}} -
+
diff --git a/application/admin/view/default/goods/index.html b/application/admin/view/default/goods/index.html index b9226d905..1e84eddcf 100755 --- a/application/admin/view/default/goods/index.html +++ b/application/admin/view/default/goods/index.html @@ -48,7 +48,7 @@ 标题名称 - 销售价格(元) + 销售价格(元) 上下架 首页推荐 库存数量 @@ -68,7 +68,7 @@ {{$v.title}} - + {{$v.price}} {{if !empty($v['original_price']) and $v['original_price'] gt 0}}
原价 {{$v.original_price}} @@ -150,9 +150,9 @@ - + - + {{/foreach}} diff --git a/application/admin/view/default/goods/save_info.html b/application/admin/view/default/goods/save_info.html index e79183acd..b8bc99760 100755 --- a/application/admin/view/default/goods/save_info.html +++ b/application/admin/view/default/goods/save_info.html @@ -48,7 +48,7 @@ - @@ -119,15 +119,15 @@
- +
- +
- +
- +
- +
- +
@@ -257,8 +257,7 @@ +添加规格图片
    - -

    规格名称与规格值保持一致,相同规格名称添加一次即可,重复添加则后面覆盖前面,顺序不影响前端展示效果。

    + 规格名称与规格值保持一致,相同规格名称添加一次即可,重复添加则后面覆盖前面,顺序不影响前端展示效果。
    {{if !empty($specifications['type'])}} {{foreach $specifications.type as $type}} @@ -287,7 +286,7 @@
    - +
      {{if !empty($data['photo'])}} {{foreach $data.photo as $v}} @@ -306,7 +305,7 @@
      - +
        {{if !empty($data['video'])}}
      • @@ -363,7 +362,7 @@
      -
      +
      diff --git a/application/admin/view/default/goodscategory/index.html b/application/admin/view/default/goodscategory/index.html index 8b54150a5..cbb38ff2e 100755 --- a/application/admin/view/default/goodscategory/index.html +++ b/application/admin/view/default/goodscategory/index.html @@ -44,7 +44,7 @@
      -
      @@ -75,7 +75,7 @@
      {{include file="lib/enable" /}} -
      +
      diff --git a/application/admin/view/default/lib/excel_win_html.html b/application/admin/view/default/lib/excel_win_html.html index c9a08659e..f0a223267 100755 --- a/application/admin/view/default/lib/excel_win_html.html +++ b/application/admin/view/default/lib/excel_win_html.html @@ -20,7 +20,7 @@
      -
      +
      diff --git a/application/admin/view/default/lib/user_status.html b/application/admin/view/default/lib/user_status.html index eaf5d4e43..1a88c19fd 100755 --- a/application/admin/view/default/lib/user_status.html +++ b/application/admin/view/default/lib/user_status.html @@ -1,7 +1,7 @@
      - - {{foreach :lang('common_user_status_list') as $v}} {{/foreach}} diff --git a/application/admin/view/default/link/index.html b/application/admin/view/default/link/index.html index f6e962b14..e20b1c936 100755 --- a/application/admin/view/default/link/index.html +++ b/application/admin/view/default/link/index.html @@ -24,7 +24,7 @@
      - +
      @@ -37,7 +37,7 @@
      -
      +
      @@ -72,8 +72,8 @@ - - + + {{/foreach}} diff --git a/application/admin/view/default/message/index.html b/application/admin/view/default/message/index.html index aabbab18f..0882331c4 100755 --- a/application/admin/view/default/message/index.html +++ b/application/admin/view/default/message/index.html @@ -89,7 +89,7 @@ {{if empty($v['add_time_time'])}}未设置{{else /}}{{$v.add_time_time}}{{/if}} - + {{/foreach}} diff --git a/application/admin/view/default/navigation/index.html b/application/admin/view/default/navigation/index.html index 957c9b61b..805842c4a 100755 --- a/application/admin/view/default/navigation/index.html +++ b/application/admin/view/default/navigation/index.html @@ -40,8 +40,8 @@ - - + + {{if !empty($v['items'])}} @@ -57,8 +57,8 @@ - - + + {{/foreach}} @@ -95,7 +95,7 @@
      - +
      @@ -104,7 +104,7 @@
      {{include file="lib/is_show" /}} {{include file="lib/is_new_window_open" /}} -
      +
      @@ -152,7 +152,7 @@
      - +
      @@ -161,7 +161,7 @@
      {{include file="lib/is_show" /}} {{include file="lib/is_new_window_open" /}} -
      +
      @@ -204,7 +204,7 @@
      - +
      @@ -213,7 +213,7 @@
      {{include file="lib/is_show" /}} {{include file="lib/is_new_window_open" /}} -
      +
      @@ -265,7 +265,7 @@
      - +
      @@ -274,7 +274,7 @@
      {{include file="lib/is_show" /}} {{include file="lib/is_new_window_open" /}} -
      +
      diff --git a/application/admin/view/default/order/index.html b/application/admin/view/default/order/index.html index f0022f44f..ce6e2c401 100755 --- a/application/admin/view/default/order/index.html +++ b/application/admin/view/default/order/index.html @@ -66,6 +66,7 @@ 快递信息 订单状态 订单金额(元) + 扩展数据 更多 操作 @@ -127,10 +128,21 @@ 金额:{{$v.price}}
      + 增加:{{$v.increase_price}}
      优惠:{{$v.preferential_price}}
      总价:{{$v.total_price}}
      支付:{{$v.pay_price}} + + {{if empty($v['extension_data'])}} + + {{else /}} + {{foreach $v.extension_data as $extk=>$ext}} + {{if $extk gt 0}}
      {{/if}} + {{$ext.name}} [{{$ext.tips}}] + {{/foreach}} + {{/if}} + 查看更多
      @@ -209,12 +221,25 @@ 未填写 {{else /}} 金额:{{$v.price}}
      + 增加:{{$v.increase_price}}
      优惠:{{$v.preferential_price}}
      总价:{{$v.total_price}}
      支付:{{$v.pay_price}} {{/if}} +
      扩展数据
      +
      + {{if empty($v['extension_data'])}} + + {{else /}} + {{foreach $v.extension_data as $extk=>$ext}} + {{if $extk gt 0}}
      {{/if}} + {{$ext.name}} [{{$ext.tips}}] + {{/foreach}} + {{/if}} +
      +
      确认时间
      {{if empty($v['confirm_time'])}}未填写{{else /}}{{$v.confirm_time}}{{/if}}
      @@ -242,23 +267,32 @@ {{if in_array($v['status'], [0])}} - + {{/if}} {{if in_array($v['status'], [0,1])}} - + {{if in_array($v['status'], [1])}} - + {{/if}} {{/if}} {{if $v['status'] eq 2}} - + {{/if}} {{if $v['status'] eq 3}} - + {{/if}} {{if in_array($v['status'], [5,6])}} - + {{/if}} + + + {{if !empty($v['plugins_service_order_handle_operation_html']) and is_array($v['plugins_service_order_handle_operation_html'])}} + {{foreach $v.plugins_service_order_handle_operation_html as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} {{/foreach}} @@ -305,7 +339,7 @@
      -
      +
      @@ -345,7 +379,7 @@
      没有支付方式
      {{/if}}
      -
      +
      diff --git a/application/admin/view/default/payment/index.html b/application/admin/view/default/payment/index.html index f92687967..011e5d974 100755 --- a/application/admin/view/default/payment/index.html +++ b/application/admin/view/default/payment/index.html @@ -87,17 +87,17 @@ {{if $v['is_install'] eq 0}} - + {{if !in_array($v['payment'], $cannot_deleted_list)}} - + {{/if}} {{else /}} - + - + {{/if}} @@ -128,7 +128,7 @@
      -
      +
      diff --git a/application/admin/view/default/payment/save_info.html b/application/admin/view/default/payment/save_info.html index 37a40bee6..aa36d1f25 100755 --- a/application/admin/view/default/payment/save_info.html +++ b/application/admin/view/default/payment/save_info.html @@ -150,7 +150,7 @@
      -
      +
      diff --git a/application/admin/view/default/pluginsadmin/first_step.html b/application/admin/view/default/pluginsadmin/first_step.html old mode 100644 new mode 100755 index 8e1c5beac..dbd6b4c7b --- a/application/admin/view/default/pluginsadmin/first_step.html +++ b/application/admin/view/default/pluginsadmin/first_step.html @@ -17,11 +17,11 @@
      - +
      -
      +
      diff --git a/application/admin/view/default/pluginsadmin/index.html b/application/admin/view/default/pluginsadmin/index.html old mode 100644 new mode 100755 index 7162a23ca..1cf958ed3 --- a/application/admin/view/default/pluginsadmin/index.html +++ b/application/admin/view/default/pluginsadmin/index.html @@ -31,6 +31,7 @@
      {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} + {{/if}} diff --git a/application/admin/view/default/pluginsadmin/nav.html b/application/admin/view/default/pluginsadmin/nav.html old mode 100644 new mode 100755 diff --git a/application/admin/view/default/pluginsadmin/save_info.html b/application/admin/view/default/pluginsadmin/save_info.html old mode 100644 new mode 100755 index 1d5268fc0..d218eff20 --- a/application/admin/view/default/pluginsadmin/save_info.html +++ b/application/admin/view/default/pluginsadmin/save_info.html @@ -17,12 +17,12 @@
      - +
      - +
      • @@ -43,12 +43,12 @@
      - +
      - +
      @@ -76,11 +76,11 @@
      - +
      -
      +
      diff --git a/application/admin/view/default/pluginsadmin/upload.html b/application/admin/view/default/pluginsadmin/upload.html old mode 100644 new mode 100755 index 9fbf5596e..44b1543a9 --- a/application/admin/view/default/pluginsadmin/upload.html +++ b/application/admin/view/default/pluginsadmin/upload.html @@ -16,7 +16,7 @@ 上传一个zip压缩格式的应用安装包
      -
      +
      diff --git a/application/admin/view/default/power/index.html b/application/admin/view/default/power/index.html index 89cb1d419..5cdca471d 100755 --- a/application/admin/view/default/power/index.html +++ b/application/admin/view/default/power/index.html @@ -41,7 +41,7 @@
      - +
      @@ -49,7 +49,7 @@
      {{include file="lib/is_show" /}} -
      +
      diff --git a/application/admin/view/default/power/role.html b/application/admin/view/default/power/role.html index 4e117bb41..eeda53633 100755 --- a/application/admin/view/default/power/role.html +++ b/application/admin/view/default/power/role.html @@ -33,9 +33,9 @@ 不可操作 {{else /}} - + - + {{/if}} diff --git a/application/admin/view/default/power/role_save_info.html b/application/admin/view/default/power/role_save_info.html index c2c3bcba4..8e48fccc0 100755 --- a/application/admin/view/default/power/role_save_info.html +++ b/application/admin/view/default/power/role_save_info.html @@ -56,7 +56,7 @@
      -
      +
      diff --git a/application/admin/view/default/public/error.html b/application/admin/view/default/public/error.html old mode 100644 new mode 100755 diff --git a/application/admin/view/default/public/footer.html b/application/admin/view/default/public/footer.html index c74f6b266..4d5f3fd45 100755 --- a/application/admin/view/default/public/footer.html +++ b/application/admin/view/default/public/footer.html @@ -1,5 +1,15 @@ + + +{{if !empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{foreach $plugins_admin_view_common_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} +{{/if}} + @@ -55,4 +65,28 @@ {{if !empty($module_js)}} +{{/if}} + + +{{if !empty($plugins_admin_js_data) and is_array($plugins_admin_js_data)}} + {{foreach $plugins_admin_js_data as $hook}} + {{if is_string($hook)}} + + {{elseif is_array($hook) /}} + {{foreach $hook as $hook_js}} + {{if is_string($hook_js)}} + + {{/if}} + {{/foreach}} + {{/if}} + {{/foreach}} +{{/if}} + + +{{if !empty($plugins_admin_common_page_bottom_data) and is_array($plugins_admin_common_page_bottom_data)}} + {{foreach $plugins_admin_common_page_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} {{/if}} \ No newline at end of file diff --git a/application/admin/view/default/public/header.html b/application/admin/view/default/public/header.html index 6c9f39fba..ffa76ed8e 100755 --- a/application/admin/view/default/public/header.html +++ b/application/admin/view/default/public/header.html @@ -15,8 +15,40 @@ {{if !empty($module_css)}} {{/if}} + + + {{if !empty($plugins_admin_css_data) and is_array($plugins_admin_css_data)}} + {{foreach $plugins_admin_css_data as $hook}} + {{if is_string($hook)}} + + {{elseif is_array($hook) /}} + {{foreach $hook as $hook_css}} + {{if is_string($hook_css)}} + + {{/if}} + {{/foreach}} + {{/if}} + {{/foreach}} + {{/if}} + + + {{if !empty($plugins_admin_common_header_data) and is_array($plugins_admin_common_header_data)}} + {{foreach $plugins_admin_common_header_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} - \ No newline at end of file + + +{{if !empty($plugins_admin_view_common_top_data) and is_array($plugins_admin_view_common_top_data) and (!isset($is_header) or $is_header eq 1)}} + {{foreach $plugins_admin_view_common_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/public/menu.html b/application/admin/view/default/public/menu.html index ebc4f38bf..b06fc1c44 100755 --- a/application/admin/view/default/public/menu.html +++ b/application/admin/view/default/public/menu.html @@ -1,4 +1,4 @@ -
      + + + + + \ No newline at end of file diff --git a/application/admin/view/default/public/nav.html b/application/admin/view/default/public/nav.html index 868ed94ec..3b416e05a 100755 --- a/application/admin/view/default/public/nav.html +++ b/application/admin/view/default/public/nav.html @@ -4,7 +4,7 @@

      ShopXO后台管理系统

      - @@ -16,15 +16,14 @@ 查看首页 + +
    • + + + 开启全屏 + +
    • - {{if !IsMobile()}} -
    • - - - 开启全屏 - -
    • - {{/if}}
    • diff --git a/application/admin/view/default/region/index.html b/application/admin/view/default/region/index.html index ce1bcd151..32091011d 100755 --- a/application/admin/view/default/region/index.html +++ b/application/admin/view/default/region/index.html @@ -28,7 +28,7 @@
    • {{include file="lib/enable" /}} -
      +
      diff --git a/application/admin/view/default/screeningprice/index.html b/application/admin/view/default/screeningprice/index.html index 3e78b1ac0..e4b23c7f8 100755 --- a/application/admin/view/default/screeningprice/index.html +++ b/application/admin/view/default/screeningprice/index.html @@ -37,7 +37,7 @@
      {{include file="lib/enable" /}} -
      +
      diff --git a/application/admin/view/default/seo/index.html b/application/admin/view/default/seo/index.html index 91155fe2e..7b5761504 100755 --- a/application/admin/view/default/seo/index.html +++ b/application/admin/view/default/seo/index.html @@ -6,7 +6,7 @@
      - +
      - +
      - +
      - +
      - +
      - +
      -
      +
      diff --git a/application/admin/view/default/site/index.html b/application/admin/view/default/site/index.html index fd1d283ba..3cfc15f17 100755 --- a/application/admin/view/default/site/index.html +++ b/application/admin/view/default/site/index.html @@ -10,7 +10,7 @@
      - +
        {{if !empty($data)}}
      • @@ -24,7 +24,7 @@
      - +
        {{if !empty($data)}}
      • @@ -38,7 +38,7 @@
      - +
        {{if !empty($data)}}
      • @@ -52,7 +52,7 @@
      - +
      - +
      - +
      - +
      - +
      - +
      - + {{foreach $site_user_login_state_list as $v}} @@ -104,15 +104,15 @@
      - +
      - +
      - +
      - +
      - +
      - +
      - +
      -
      +
      diff --git a/application/admin/view/default/slide/index.html b/application/admin/view/default/slide/index.html index 469e7175e..3c5722235 100755 --- a/application/admin/view/default/slide/index.html +++ b/application/admin/view/default/slide/index.html @@ -89,9 +89,9 @@ {{$v.add_time_time}}
      - + - + {{/foreach}} diff --git a/application/admin/view/default/slide/save_info.html b/application/admin/view/default/slide/save_info.html index 11f201b4f..2cb5b55f1 100755 --- a/application/admin/view/default/slide/save_info.html +++ b/application/admin/view/default/slide/save_info.html @@ -61,7 +61,7 @@
      -
      @@ -75,7 +75,7 @@
      -
      +
      diff --git a/application/admin/view/default/sms/index.html b/application/admin/view/default/sms/index.html index 5a9caa259..0c1b5a898 100755 --- a/application/admin/view/default/sms/index.html +++ b/application/admin/view/default/sms/index.html @@ -10,18 +10,18 @@
      - +
      - +
      - +
      -
      +
      diff --git a/application/admin/view/default/sms/message.html b/application/admin/view/default/sms/message.html index f2510e8e9..b86ca2cde 100755 --- a/application/admin/view/default/sms/message.html +++ b/application/admin/view/default/sms/message.html @@ -10,18 +10,18 @@
      - +
      - +
      - +
      -
      +
      diff --git a/application/admin/view/default/sqlconsole/index.html b/application/admin/view/default/sqlconsole/index.html old mode 100644 new mode 100755 index a5ecf9613..3762390e9 --- a/application/admin/view/default/sqlconsole/index.html +++ b/application/admin/view/default/sqlconsole/index.html @@ -11,9 +11,9 @@
      - +
      -
      +
      diff --git a/application/admin/view/default/user/index.html b/application/admin/view/default/user/index.html index 8276f9c1e..a04cbf768 100755 --- a/application/admin/view/default/user/index.html +++ b/application/admin/view/default/user/index.html @@ -21,6 +21,12 @@ {{/foreach}} +
      ~ @@ -49,6 +55,7 @@ 手机号码 积分 性别 + 状态 生日 更多 操作 @@ -77,6 +84,9 @@ {{if empty($v['gender_text'])}}未设置{{else /}}{{$v.gender_text}}{{/if}} + + {{if empty($v['status_text'])}}未知{{else /}}{{$v.status_text}}{{/if}} + {{if empty($v['birthday_text'])}}未填写{{else /}}{{$v.birthday_text}}{{/if}} @@ -102,6 +112,18 @@
      电子邮箱
      {{if empty($v['email'])}}未填写{{else /}}{{$v.email}}{{/if}}
      +
      状态
      +
      {{if empty($v['status_text'])}}未知{{else /}}{{$v.status_text}}{{/if}}
      + +
      支付宝openid
      +
      {{if empty($v['alipay_openid'])}}未知{{else /}}{{$v.alipay_openid}}{{/if}}
      + +
      微信openid
      +
      {{if empty($v['weixin_openid'])}}未知{{else /}}{{$v.weixin_openid}}{{/if}}
      + +
      百度openid
      +
      {{if empty($v['baidu_openid'])}}未知{{else /}}{{$v.baidu_openid}}{{/if}}
      +
      性别
      {{if empty($v['gender_text'])}}未设置{{else /}}{{$v.gender_text}}{{/if}}
      @@ -141,9 +163,9 @@ - + - + {{/foreach}} diff --git a/application/admin/view/default/user/save_info.html b/application/admin/view/default/user/save_info.html index c6ebfb844..25574f48c 100755 --- a/application/admin/view/default/user/save_info.html +++ b/application/admin/view/default/user/save_info.html @@ -32,6 +32,20 @@
      + +
      + + +
      +
      + + +
      +
      + + +
      +
      @@ -46,12 +60,14 @@
      + {{include file="lib/user_status" /}} +
      -
      +
      diff --git a/application/api/controller/Answer.php b/application/api/controller/Answer.php index c80981d31..805da0666 100755 --- a/application/api/controller/Answer.php +++ b/application/api/controller/Answer.php @@ -44,7 +44,7 @@ class Answer extends Common public function Index() { // 登录校验 - $this->Is_Login(); + $this->IsLogin(); // 参数 $params = input(); @@ -90,7 +90,7 @@ class Answer extends Common public function Add() { // 登录校验 - $this->Is_Login(); + $this->IsLogin(); $params = $this->data_post; $params['user'] = $this->user; diff --git a/application/api/controller/Buy.php b/application/api/controller/Buy.php index ebf1cb216..c24eaa17c 100755 --- a/application/api/controller/Buy.php +++ b/application/api/controller/Buy.php @@ -37,7 +37,7 @@ class Buy extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** @@ -57,34 +57,18 @@ class Buy extends Common // 商品校验 if(isset($ret['code']) && $ret['code'] == 0) { - // 用户默认地址 - $address = UserService::UserDefaultAddress(['user'=>$this->user]); - - // 商品/基础信息 - $base = [ - 'total_price' => empty($ret['data']) ? 0 : array_sum(array_column($ret['data'], 'total_price')), - 'total_stock' => empty($ret['data']) ? 0 : array_sum(array_column($ret['data'], 'stock')), - 'address' => empty($address['data']) ? null : $address['data'], - ]; - // 支付方式 $payment_list = PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]); - // 扩展展示数据 - $extension_list = [ - // ['name'=>'感恩节9折', 'tips'=>'-¥23元'], - // ['name'=>'运费', 'tips'=>'+¥10元'], - ]; - // 数据返回组装 $result = [ - 'goods_list' => $ret['data'], + 'goods_list' => $ret['data']['goods'], 'payment_list' => $payment_list, - 'base' => $base, - 'extension_list' => $extension_list, + 'base' => $ret['data']['base'], + 'extension_data' => $ret['data']['extension_data'], 'common_order_is_booking' => (int) MyC('common_order_is_booking', 0), ]; - return DataReturn('success', 0, $result); + return DataReturn('操作成功', 0, $result); } return $ret; } diff --git a/application/api/controller/Cart.php b/application/api/controller/Cart.php index 5116ee4ad..f14db7e47 100755 --- a/application/api/controller/Cart.php +++ b/application/api/controller/Cart.php @@ -34,7 +34,7 @@ class Cart extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Common.php b/application/api/controller/Common.php index de58b36f5..a7528d181 100755 --- a/application/api/controller/Common.php +++ b/application/api/controller/Common.php @@ -11,6 +11,7 @@ namespace app\api\controller; use think\Controller; +use app\service\SystemService; use app\service\ConfigService; use app\service\UserService; @@ -47,6 +48,9 @@ class Common extends Controller { parent::__construct(); + // 系统运行开始 + SystemService::SystemBegin(); + // 输入参数 $this->data_post = input('post.'); $this->data_get = input('get.'); @@ -62,6 +66,20 @@ class Common extends Controller $this->CommonInit(); } + /** + * 析构函数 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-18 + * @desc description + */ + public function __destruct() + { + // 系统运行结束 + SystemService::SystemEnd(); + } + /** * 系统初始化 * @author Devil @@ -95,13 +113,13 @@ class Common extends Controller } /** - * [Is_Login 登录校验] + * [IsLogin 登录校验] * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2017-03-09T11:43:48+0800 */ - protected function Is_Login() + protected function IsLogin() { if(empty($this->user)) { @@ -119,10 +137,7 @@ class Common extends Controller private function CommonInit() { // 用户数据 - if(!empty($this->data_request['user_id'])) - { - $this->user = UserService::UserLoginRecord($this->data_request['user_id'], true); - } + $this->user = UserService::LoginUserInfo(); } /** diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php index 335081f61..6c327428a 100755 --- a/application/api/controller/Goods.php +++ b/application/api/controller/Goods.php @@ -61,16 +61,16 @@ class Goods extends Common 'is_spec' => true, 'is_content_app' => true, ]; - $goods = GoodsService::GoodsList($params); - if(empty($goods[0]) || $goods[0]['is_delete_time'] != 0) + $ret = GoodsService::GoodsList($params); + if(empty($ret['data'][0]) || $ret['data'][0]['is_delete_time'] != 0) { return DataReturn('商品不存在或已删除', -1); } - unset($goods[0]['content_web']); + unset($ret['data'][0]['content_web']); // 当前登录用户是否已收藏 $ret_favor = GoodsService::IsUserGoodsFavor(['goods_id'=>$goods_id, 'user'=>$this->user]); - $goods[0]['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0; + $ret['data'][0]['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0; // 商品访问统计 GoodsService::GoodsAccessCountInc(['goods_id'=>$goods_id]); @@ -80,7 +80,7 @@ class Goods extends Common // 数据返回 $result = [ - 'goods' => $goods[0], + 'goods' => $ret['data'][0], 'common_order_is_booking' => (int) MyC('common_order_is_booking', 0), ]; return DataReturn('success', 0, $result); @@ -97,7 +97,7 @@ class Goods extends Common public function Favor() { // 登录校验 - $this->Is_Login(); + $this->IsLogin(); // 开始操作 $params = $this->data_post; diff --git a/application/api/controller/Message.php b/application/api/controller/Message.php index f3357dd31..e82e0e84f 100755 --- a/application/api/controller/Message.php +++ b/application/api/controller/Message.php @@ -34,7 +34,7 @@ class Message extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php index de6d052cf..3c8f1532c 100755 --- a/application/api/controller/Order.php +++ b/application/api/controller/Order.php @@ -35,7 +35,7 @@ class Order extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Search.php b/application/api/controller/Search.php index cbb6611c6..e202727bb 100755 --- a/application/api/controller/Search.php +++ b/application/api/controller/Search.php @@ -50,17 +50,17 @@ class Search extends Common SearchService::SearchAdd($this->data_post); // 获取数据 - $result = SearchService::GoodsList($this->data_post); + $ret = SearchService::GoodsList($this->data_post); // 分类 if(!empty($this->data_post['category_id'])) { - $result['category'] = GoodsService::GoodsCategoryRow(['id'=>$this->data_post['category_id']]); + $ret['data']['category'] = GoodsService::GoodsCategoryRow(['id'=>$this->data_post['category_id']]); } else { - $result['category'] = []; + $ret['data']['category'] = []; } - return DataReturn('success', 0, $result); + return $ret; } } ?> \ No newline at end of file diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 098c4adae..b6527da98 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -91,15 +91,16 @@ class User extends Common } // 授权 - $result = (new \base\AlipayAuth())->GetAlipayUserInfo($this->data_post['authcode'], MyC('common_app_mini_alipay_appid')); - if($result === false) + $ret = (new \base\AlipayAuth())->GetAlipayUserInfo($this->data_post['authcode'], MyC('common_app_mini_alipay_appid')); + if($ret['status'] != 0) { - return DataReturn('获取授权信息失败', -10); + return DataReturn($ret['msg'], -10); } else { - $result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 'm') ? 2 : 1; - $result['openid'] = $result['user_id']; - $result['referrer']= isset($this->data_post['referrer']) ? intval($this->data_post['referrer']) : 0; - return UserService::AuthUserProgram($result, 'alipay_openid'); + $data = $ret['data']; + $data['gender'] = empty($data['gender']) ? 0 : ($data['gender'] == 'm') ? 2 : 1; + $data['openid'] = $data['user_id']; + $data['referrer']= isset($this->data_post['referrer']) ? intval($this->data_post['referrer']) : 0; + return UserService::AuthUserProgram($data, 'alipay_openid'); } } @@ -113,7 +114,14 @@ class User extends Common */ public function WechatUserAuth() { - $result = (new \base\Wechat(MyC('common_app_mini_weixin_appid'), MyC('common_app_mini_weixin_appsecret')))->GetAuthSessionKey(input('authcode')); + // 参数 + if(empty($this->data_post['authcode'])) + { + return DataReturn('授权码为空', -1); + } + + // 授权 + $result = (new \base\Wechat(MyC('common_app_mini_weixin_appid'), MyC('common_app_mini_weixin_appsecret')))->GetAuthSessionKey($this->data_post['authcode']); if($result !== false) { return DataReturn('授权登录成功', 0, $result); @@ -131,14 +139,35 @@ class User extends Common */ public function WechatUserInfo() { - // 参数 - $params = input(); + // 参数校验 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'openid', + 'error_msg' => 'openid为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'encrypted_data', + 'error_msg' => '解密数据为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'iv', + 'error_msg' => 'iv数据为空', + ] + ]; + $ret = ParamsChecked($this->data_post, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } // 先从数据库获取用户信息 - $user = UserService::UserInfo('weixin_openid', $params['openid']); + $user = UserService::UserInfo('weixin_openid', $this->data_post['openid']); if(empty($user)) { - $result = (new \base\Wechat(MyC('common_app_mini_weixin_appid'), MyC('common_app_mini_weixin_appsecret')))->DecryptData($params['encrypted_data'], $params['iv'], $params['openid']); + $result = (new \base\Wechat(MyC('common_app_mini_weixin_appid'), MyC('common_app_mini_weixin_appsecret')))->DecryptData($this->data_post['encrypted_data'], $this->data_post['iv'], $this->data_post['openid']); if(is_array($result)) { @@ -186,7 +215,7 @@ class User extends Common public function Center() { // 登录校验 - $this->Is_Login(); + $this->IsLogin(); // 订单总数 $where = ['user_id'=>$this->user['id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; diff --git a/application/api/controller/Useraddress.php b/application/api/controller/Useraddress.php index be6cc71cf..32b42a676 100755 --- a/application/api/controller/Useraddress.php +++ b/application/api/controller/Useraddress.php @@ -34,7 +34,7 @@ class UserAddress extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Usergoodsbrowse.php b/application/api/controller/Usergoodsbrowse.php index 1867c0506..f1e77fc4c 100755 --- a/application/api/controller/Usergoodsbrowse.php +++ b/application/api/controller/Usergoodsbrowse.php @@ -34,7 +34,7 @@ class UserGoodsBrowse extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Usergoodsfavor.php b/application/api/controller/Usergoodsfavor.php index b3170db12..cdda5c4f3 100755 --- a/application/api/controller/Usergoodsfavor.php +++ b/application/api/controller/Usergoodsfavor.php @@ -34,7 +34,7 @@ class UserGoodsFavor extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/api/controller/Userintegral.php b/application/api/controller/Userintegral.php index 5fb36d315..a60dc4358 100755 --- a/application/api/controller/Userintegral.php +++ b/application/api/controller/Userintegral.php @@ -34,7 +34,7 @@ class UserIntegral extends Common parent::__construct(); // 是否登录 - $this->Is_Login(); + $this->IsLogin(); } /** diff --git a/application/common.php b/application/common.php index be5a6fc3e..21f7920f9 100755 --- a/application/common.php +++ b/application/common.php @@ -225,6 +225,12 @@ function MyUrl($path, $params=[]) $url = str_replace('public/', '', $url); } + // tp框架url方法是否识别到https + if(__MY_HTTP__ == 'https' && substr($url, 0, 5) != 'https') + { + $url = 'https'.mb_substr($url, 4, null, 'utf-8'); + } + return $url; } @@ -242,10 +248,12 @@ function MyUrl($path, $params=[]) */ function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $params=[]) { - $params['pluginsname'] = $plugins_name; - $params['pluginscontrol'] = $plugins_control; - $params['pluginsaction'] = $plugins_action; - $url = url('index/plugins/index', $params, true, true); + $plugins = [ + 'pluginsname' => $plugins_name, + 'pluginscontrol' => $plugins_control, + 'pluginsaction' => $plugins_action, + ]; + $url = url('index/plugins/index', $plugins+$params, true, true); // 是否根目录访问项目 if(defined('IS_ROOT_ACCESS')) @@ -270,10 +278,12 @@ function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $param */ function PluginsAdminUrl($plugins_name, $plugins_control, $plugins_action, $params=[]) { - $params['pluginsname'] = $plugins_name; - $params['pluginscontrol'] = $plugins_control; - $params['pluginsaction'] = $plugins_action; - $url = url('admin/plugins/index', $params, true, true); + $plugins = [ + 'pluginsname' => $plugins_name, + 'pluginscontrol' => $plugins_control, + 'pluginsaction' => $plugins_action, + ]; + $url = url('admin/plugins/index', $plugins+$params, true, true); // 是否根目录访问项目 if(defined('IS_ROOT_ACCESS')) diff --git a/application/common/Http.php b/application/common/Http.php old mode 100644 new mode 100755 diff --git a/application/http/middleware/SystemEnvCheck.php b/application/http/middleware/SystemEnvCheck.php old mode 100644 new mode 100755 diff --git a/application/index/controller/Answer.php b/application/index/controller/Answer.php new file mode 100755 index 000000000..e7d7ef248 --- /dev/null +++ b/application/index/controller/Answer.php @@ -0,0 +1,95 @@ +IsLogin(); + } + + /** + * 问答/留言列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-28 + * @desc description + */ + public function Index() + { + // 参数 + $params = input(); + $params['user'] = $this->user; + + // 分页 + $number = 10; + + // 条件 + $where = AnswerService::AnswerListWhere($params); + + // 获取总数 + $total = AnswerService::AnswerTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'page' => isset($params['page']) ? intval($params['page']) : 1, + 'url' => MyUrl('admin/answer/index'), + ); + $page = new \base\Page($page_params); + $this->assign('page_html', $page->GetPageHtml()); + + // 获取列表 + $data_params = array( + 'm' => $page->GetPageStarNumber(), + 'n' => $number, + 'where' => $where, + ); + $data = AnswerService::AnswerList($data_params); + $this->assign('data_list', $data['data']); + + // 状态 + $this->assign('common_is_show_list', lang('common_is_show_list')); + + // 是否 + $this->assign('common_is_text_list', lang('common_is_text_list')); + + // 参数 + $this->assign('params', $params); + return $this->fetch(); + } + +} +?> \ No newline at end of file diff --git a/application/index/controller/Article.php b/application/index/controller/Article.php index 617ade41b..754e616f9 100755 --- a/application/index/controller/Article.php +++ b/application/index/controller/Article.php @@ -11,6 +11,7 @@ namespace app\index\controller; use app\service\ArticleService; +use app\service\SeoService; /** * 文章详情 @@ -64,7 +65,7 @@ class Article extends Common } // 浏览器标题 - $this->assign('home_seo_site_title', $this->GetBrowserSeoTitle($article['data'][0]['title'], 1)); + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($article['data'][0]['title'])); // 获取分类和文字 $article_category_content = ArticleService::ArticleCategoryListContent(); diff --git a/application/index/controller/Buy.php b/application/index/controller/Buy.php index 6d74692c6..44140c364 100755 --- a/application/index/controller/Buy.php +++ b/application/index/controller/Buy.php @@ -55,7 +55,7 @@ class Buy extends Common return redirect(MyUrl('index/buy/index')); } else { // 获取商品列表 - $params = session('buy_post_data'); + $params = array_merge(input(), session('buy_post_data')); $params['user'] = $this->user; $ret = BuyService::BuyTypeGoodsList($params); @@ -68,15 +68,9 @@ class Buy extends Common // 支付方式 $this->assign('payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1])); - // 商品/基础信息 - $base = [ - 'total_price' => empty($ret['data']) ? 0 : array_sum(array_column($ret['data'], 'total_price')), - 'total_stock' => empty($ret['data']) ? 0 : array_sum(array_column($ret['data'], 'stock')), - 'address' => UserService::UserDefaultAddress(['user'=>$this->user])['data'], - ]; - $this->assign('base', $base); - $this->assign('goods_list', $ret['data']); - + $this->assign('base', $ret['data']['base']); + $this->assign('goods_list', $ret['data']['goods']); + $this->assign('extension_data', $ret['data']['extension_data']); $this->assign('params', $params); return $this->fetch(); } else { diff --git a/application/index/controller/Cart.php b/application/index/controller/Cart.php index 3c5facbec..e68ba9cef 100755 --- a/application/index/controller/Cart.php +++ b/application/index/controller/Cart.php @@ -51,7 +51,7 @@ class Cart extends Common $base = [ 'total_price' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'total_price')), - 'total_stock' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'stock')), + 'buy_count' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'stock')), 'ids' => empty($cart_list['data']) ? '' : implode(',', array_column($cart_list['data'], 'id')), ]; $this->assign('base', $base); diff --git a/application/index/controller/Category.php b/application/index/controller/Category.php index fe46204ba..e12ce71b5 100755 --- a/application/index/controller/Category.php +++ b/application/index/controller/Category.php @@ -10,6 +10,8 @@ // +---------------------------------------------------------------------- namespace app\index\controller; +use app\service\SeoService; + /** * 商品分类 * @author Devil @@ -41,6 +43,9 @@ class Category extends Common */ public function Index() { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('商品分类', 1)); + return $this->fetch(); } } diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index 052f1bff5..67a1a8d20 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -12,6 +12,7 @@ namespace app\index\controller; use think\facade\Hook; use think\Controller; +use app\service\SystemService; use app\service\GoodsService; use app\service\NavigationService; use app\service\BuyService; @@ -19,6 +20,7 @@ use app\service\MessageService; use app\service\SearchService; use app\service\ConfigService; use app\service\LinkService; +use app\service\UserService; /** * 前端公共控制器 @@ -51,6 +53,9 @@ class Common extends Controller { parent::__construct(); + // 系统运行开始 + SystemService::SystemBegin(); + // 系统初始化 $this->SystemInit(); @@ -70,6 +75,20 @@ class Common extends Controller $this->CommonPluginsInit(); } + /** + * 析构函数 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-18 + * @desc description + */ + public function __destruct() + { + // 系统运行结束 + SystemService::SystemEnd(); + } + /** * 公共钩子初始化 * @author Devil @@ -81,22 +100,37 @@ class Common extends Controller private function CommonPluginsInit() { // css钩子 - $this->assign('plugins_css_data', Hook::listen('plugins_css', ['hook_name'=>'plugins_css', 'is_control'=>false])); + $this->assign('plugins_css_data', Hook::listen('plugins_css', ['hook_name'=>'plugins_css', 'is_backend'=>false])); // js钩子 - $this->assign('plugins_js_data', Hook::listen('plugins_js', ['hook_name'=>'plugins_js', 'is_control'=>false])); + $this->assign('plugins_js_data', Hook::listen('plugins_js', ['hook_name'=>'plugins_js', 'is_backend'=>false])); // 公共header内钩子 - $this->assign('plugins_common_header_data', Hook::listen('plugins_common_header', ['hook_name'=>'plugins_common_header', 'is_control'=>false, 'user'=>$this->user])); + $this->assign('plugins_common_header_data', Hook::listen('plugins_common_header', ['hook_name'=>'plugins_common_header', 'is_backend'=>false, 'user'=>$this->user])); // 公共页面底部钩子 - $this->assign('plugins_common_page_bottom_data', Hook::listen('plugins_common_page_bottom', ['hook_name'=>'plugins_common_page_bottom', 'is_control'=>false, 'user'=>$this->user])); + $this->assign('plugins_common_page_bottom_data', Hook::listen('plugins_common_page_bottom', ['hook_name'=>'plugins_common_page_bottom', 'is_backend'=>false, 'user'=>$this->user])); // 公共顶部钩子 - $this->assign('plugins_view_common_top_data', Hook::listen('plugins_view_common_top', ['hook_name'=>'plugins_view_common_top', 'is_control'=>false, 'user'=>$this->user])); + $this->assign('plugins_view_common_top_data', Hook::listen('plugins_view_common_top', ['hook_name'=>'plugins_view_common_top', 'is_backend'=>false, 'user'=>$this->user])); // 公共底部钩子 - $this->assign('plugins_view_common_bottom_data', Hook::listen('plugins_view_common_bottom', ['hook_name'=>'plugins_view_common_bottom', 'is_control'=>false, 'user'=>$this->user])); + $this->assign('plugins_view_common_bottom_data', Hook::listen('plugins_view_common_bottom', ['hook_name'=>'plugins_view_common_bottom', 'is_backend'=>false, 'user'=>$this->user])); + + // 公共顶部小导航钩子-左侧 + $this->assign('plugins_view_header_navigation_top_left_data', Hook::listen('plugins_view_header_navigation_top_left', ['hook_name'=>'plugins_view_header_navigation_top_left', 'is_backend'=>false, 'user'=>$this->user])); + + // 用户登录页面顶部钩子 + $this->assign('plugins_view_user_login_info_top_data', Hook::listen('plugins_view_user_login_info_top', ['hook_name'=>'plugins_view_user_login_info_top', 'is_backend'=>false, 'user'=>$this->user])); + + // 用户注册页面钩子 + $this->assign('plugins_view_user_reg_info_data', Hook::listen('plugins_view_user_reg_info', ['hook_name'=>'plugins_view_user_reg_info', 'is_backend'=>false, 'user'=>$this->user])); + + // 用户注册短信页面钩子 + $this->assign('plugins_view_user_sms_reg_info_data', Hook::listen('plugins_view_user_sms_reg_info', ['hook_name'=>'plugins_view_user_sms_reg_info', 'is_backend'=>false, 'user'=>$this->user])); + + // 用户注册邮箱页面钩子 + $this->assign('plugins_view_user_email_reg_info_data', Hook::listen('plugins_view_user_email_reg_info', ['hook_name'=>'plugins_view_user_email_reg_info', 'is_backend'=>false, 'user'=>$this->user])); } /** @@ -128,7 +162,7 @@ class Common extends Controller */ protected function IsLogin() { - if(session('user') == null) + if(empty($this->user)) { if(IS_AJAX) { @@ -151,7 +185,7 @@ class Common extends Controller // 用户数据 if(session('user') != null) { - $this->user = session('user'); + $this->user = UserService::LoginUserInfo(); } } @@ -210,20 +244,11 @@ class Common extends Controller $this->assign('user', $this->user); // 用户中心菜单 - $this->assign('user_left_menu', lang('user_left_menu')); + $this->assign('user_left_menu', NavigationService::UsersCenterLeftList()); // 商品大分类 $this->assign('goods_category_list', GoodsService::GoodsCategory()); - // 购物车商品总数 - $common_cart_total = BuyService::UserCartTotal(['user'=>$this->user]); - $this->assign('common_cart_total', ($common_cart_total > 99) ? '99+' : $common_cart_total); - - // 未读消息总数 - $params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0, 'user_type'=>'user']; - $common_message_total = MessageService::UserMessageTotal($params); - $this->assign('common_message_total', ($common_message_total > 99) ? '99+' : $common_message_total); - // 搜索框下热门关键字 $home_search_keywords = []; switch(intval(MyC('home_search_keywords_type', 0))) @@ -243,6 +268,9 @@ class Common extends Controller // 开发模式 $this->assign('shopxo_is_develop', config('shopxo.is_develop')); + + // 顶部右侧导航 + $this->assign('common_nav_top_right_list', NavigationService::HomeHavTopRight(['user'=>$this->user])); } /** @@ -254,38 +282,11 @@ class Common extends Controller */ private function NavInit() { - $navigation = NavigationService::Home(); + $navigation = NavigationService::Nav(); $this->nav_header = $navigation['header']; $this->nav_footer = $navigation['footer']; } - /** - * [GetBrowserSeoTitle 获取浏览器seo标题] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-25T14:21:21+0800 - * @param [string] $title [标题] - * @param [int] $type [页面类型 0, 1, 2] - * @return [string] [浏览器seo标题] - */ - protected function GetBrowserSeoTitle($title, $type) - { - switch($type) - { - case 0: - break; - - case 1: - $site_name = MyC('home_site_name'); - break; - - default: - $site_name = MyC('home_seo_site_title'); - } - return empty($title) ? $site_name : $title.' - '.$site_name; - } - /** * [_empty 空方法操作] * @author Devil diff --git a/application/index/controller/Customview.php b/application/index/controller/Customview.php index 5387e4914..532811110 100755 --- a/application/index/controller/Customview.php +++ b/application/index/controller/Customview.php @@ -11,6 +11,7 @@ namespace app\index\controller; use app\service\CustomViewService; +use app\service\SeoService; /** * 自定义页面 @@ -58,7 +59,7 @@ class CustomView extends Common CustomViewService::CustomViewAccessCountInc(['id'=>$id]); // 浏览器标题 - $this->assign('home_seo_site_title', $this->GetBrowserSeoTitle($data['data'][0]['title'], 1)); + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($data['data'][0]['title'])); $this->assign('data', $data['data'][0]); $this->assign('is_header', $data['data'][0]['is_header']); diff --git a/application/index/controller/Goods.php b/application/index/controller/Goods.php index e41161b14..99b0cca11 100755 --- a/application/index/controller/Goods.php +++ b/application/index/controller/Goods.php @@ -10,7 +10,9 @@ // +---------------------------------------------------------------------- namespace app\index\controller; +use think\facade\Hook; use app\service\GoodsService; +use app\service\SeoService; /** * 商品详情 @@ -52,24 +54,72 @@ class Goods extends Common 'is_photo' => true, 'is_spec' => true, ]; - $goods = GoodsService::GoodsList($params); - if(empty($goods[0]) || $goods[0]['is_delete_time'] != 0) + $ret = GoodsService::GoodsList($params); + if(empty($ret['data'][0]) || $ret['data'][0]['is_delete_time'] != 0) { $this->assign('msg', '资源不存在或已被删除'); return $this->fetch('/public/tips_error'); } else { // 当前登录用户是否已收藏 $ret_favor = GoodsService::IsUserGoodsFavor(['goods_id'=>$id, 'user'=>$this->user]); - $goods[0]['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0; + $ret['data'][0]['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0; // 商品评价总数 - $goods[0]['comments_count'] = GoodsService::GoodsCommentsTotal($id); + $ret['data'][0]['comments_count'] = GoodsService::GoodsCommentsTotal($id); // 商品收藏总数 - $goods[0]['favor_count'] = GoodsService::GoodsFavorTotal(['goods_id'=>$id]); + $ret['data'][0]['favor_count'] = GoodsService::GoodsFavorTotal(['goods_id'=>$id]); - $this->assign('goods', $goods[0]); - $this->assign('home_seo_site_title', $goods[0]['title']); + // 商品页面基础信息顶部钩子 + $this->assign('plugins_view_goods_detail_base_top_data', Hook::listen('plugins_view_goods_detail_base_top', + [ + 'hook_name' => 'plugins_view_goods_detail_base_top', + 'is_backend' => false, + 'goods_id' => $id, + 'goods' => &$ret['data'][0], + ])); + + // 商品页面基础信息面板底部钩子 + $this->assign('plugins_view_goods_detail_panel_bottom_data', Hook::listen('plugins_view_goods_detail_panel_bottom', + [ + 'hook_name' => 'plugins_view_goods_detail_panel_bottom', + 'is_backend' => false, + 'goods_id' => $id, + 'goods' => &$ret['data'][0], + ])); + + // 商品页面tabs顶部钩子 + $this->assign('plugins_view_goods_detail_tabs_top_data', Hook::listen('plugins_view_goods_detail_tabs_top', + [ + 'hook_name' => 'plugins_view_goods_detail_tabs_top', + 'is_backend' => false, + 'goods_id' => $id, + 'goods' => &$ret['data'][0], + ])); + + // 商品页面tabs顶部钩子 + $this->assign('plugins_view_goods_detail_tabs_bottom_data', Hook::listen('plugins_view_goods_detail_tabs_bottom', + [ + 'hook_name' => 'plugins_view_goods_detail_tabs_bottom', + 'is_backend' => false, + 'goods_id' => $id, + 'goods' => &$ret['data'][0], + ])); + + // 商品页面左侧顶部钩子 + $this->assign('plugins_view_goods_detail_left_top_data', Hook::listen('plugins_view_goods_detail_left_top', + [ + 'hook_name' => 'plugins_view_goods_detail_left_top', + 'is_backend' => false, + 'goods_id' => $id, + 'goods' => &$ret['data'][0], + ])); + + // 商品数据 + $this->assign('goods', $ret['data'][0]); + + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($ret['data'][0]['title'])); // 二维码 $this->assign('qrcode_url', MyUrl('index/qrcode/index', ['content'=>urlencode(base64_encode(MyUrl('index/goods/index', ['id'=>$id], true, true)))])); @@ -90,7 +140,8 @@ class Goods extends Common 'field' => 'id,title,title_color,price,images', 'n' => 10, ]; - $this->assign('left_goods', GoodsService::GoodsList($params)); + $right_goods = GoodsService::GoodsList($params); + $this->assign('left_goods', $right_goods['data']); // 详情tab商品 猜你喜欢 $params = [ @@ -103,7 +154,8 @@ class Goods extends Common 'field' => 'id,title,title_color,price,images,home_recommended_images', 'n' => 16, ]; - $this->assign('detail_like_goods', GoodsService::GoodsList($params)); + $like_goods = GoodsService::GoodsList($params); + $this->assign('detail_like_goods', $like_goods['data']); return $this->fetch(); } diff --git a/application/index/controller/Order.php b/application/index/controller/Order.php index d403f79d7..b0f1ff923 100755 --- a/application/index/controller/Order.php +++ b/application/index/controller/Order.php @@ -137,7 +137,7 @@ class Order extends Common } else { $this->assign('msg', '没有相关数据'); return $this->fetch('public/tips_error'); - } + } } /** diff --git a/application/index/controller/Personal.php b/application/index/controller/Personal.php index c021fd9d9..05cd0d97f 100755 --- a/application/index/controller/Personal.php +++ b/application/index/controller/Personal.php @@ -11,6 +11,7 @@ namespace app\index\controller; use app\service\UserService; +use app\service\NavigationService; /** * 个人资料 @@ -46,7 +47,7 @@ class Personal extends Common */ public function Index() { - $this->assign('personal_show_list', lang('personal_show_list')); + $this->assign('personal_show_list', NavigationService::UsersPersonalShowFieldList()); return $this->fetch(); } diff --git a/application/index/controller/Plugins.php b/application/index/controller/Plugins.php old mode 100644 new mode 100755 diff --git a/application/index/controller/Safety.php b/application/index/controller/Safety.php index 751d8b15a..f32a6317b 100755 --- a/application/index/controller/Safety.php +++ b/application/index/controller/Safety.php @@ -11,6 +11,7 @@ namespace app\index\controller; use app\service\SafetyService; +use app\service\NavigationService; /** * 安全 @@ -47,7 +48,7 @@ class Safety extends Common public function Index() { // 安全信息列表 - $this->assign('safety_panel_list', lang('safety_panel_list')); + $this->assign('safety_panel_list', NavigationService::UsersSafetyPanelList()); // 数据列表 $data = array( diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index 160bd33f6..12bb426cd 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -12,6 +12,7 @@ namespace app\index\controller; use app\service\SearchService; use app\service\BrandService; +use app\service\SeoService; /** * 搜索 @@ -82,6 +83,9 @@ class Search extends Common // 参数 $this->assign('params', $this->params); + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('商品搜索', 1)); + return $this->fetch(); } } @@ -97,8 +101,8 @@ class Search extends Common public function GoodsList() { // 获取商品列表 - $data = SearchService::GoodsList($this->params); - if(empty($data['data'])) + $ret = SearchService::GoodsList($this->params); + if(empty($ret['data'])) { $msg = '没有相关数据'; $code = -100; @@ -111,7 +115,7 @@ class Search extends Common SearchService::SearchAdd($this->params); // 返回 - return DataReturn($msg, $code, $data); + return DataReturn($msg, $code, $ret['data']); } } ?> \ No newline at end of file diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 21b511411..f212b6417 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -15,6 +15,8 @@ use app\service\OrderService; use app\service\GoodsService; use app\service\UserService; use app\service\BuyService; +use app\service\SeoService; +use app\service\MessageService; /** * 用户 @@ -51,7 +53,7 @@ class User extends Common $referer_url = empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/user/index') : $_SERVER['HTTP_REFERER']; if(!empty($_SERVER['HTTP_REFERER'])) { - $all = ['logininfo', 'reginfo', 'smsreginfo', 'emailreginfo', 'forgetpwdinfo']; + $all = ['login', 'regster', 'forget', 'logininfo', 'reginfo', 'smsreginfo', 'emailreginfo', 'forgetpwdinfo']; foreach($all as $v) { if(strpos($_SERVER['HTTP_REFERER'], $v) !== false) @@ -92,6 +94,11 @@ class User extends Common $user_order_status = OrderService::OrderStatusStepTotal(['user_type'=>'user', 'user'=>$this->user, 'is_comments'=>1]); $this->assign('user_order_status', $user_order_status['data']); + // 未读消息总数 + $params = ['user'=>$this->user, 'is_more'=>1, 'is_read'=>0, 'user_type'=>'user']; + $common_message_total = MessageService::UserMessageTotal($params); + $this->assign('common_message_total', ($common_message_total > 99) ? '99+' : $common_message_total); + // 获取进行中的订单列表 $params = array_merge($_POST, $_GET); $params['user'] = $this->user; @@ -137,7 +144,10 @@ class User extends Common $this->assign('goods_browse_list', $data['data']); // 用户中心顶部钩子 - $this->assign('plugins_view_user_center_top_data', Hook::listen('plugins_view_user_center_top', ['hook_name'=>'plugins_view_user_center_top', 'is_control'=>false, 'user'=>$this->user])); + $this->assign('plugins_view_user_center_top_data', Hook::listen('plugins_view_user_center_top', ['hook_name'=>'plugins_view_user_center_top', 'is_backend'=>false, 'user'=>$this->user])); + + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户中心', 1)); return $this->fetch(); } @@ -153,6 +163,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('密码找回', 1)); + return $this->fetch(); } else { $this->assign('msg', '已经登录了,如要重置密码,请先退出当前账户'); @@ -174,6 +187,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户注册', 1)); + return $this->fetch(); } else { $this->assign('msg', '已经登录了,如要注册新账户,请先退出当前账户'); @@ -198,6 +214,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户邮箱注册', 1)); + $this->assign('referer_url', $this->GetrefererUrl()); return $this->fetch(); } else { @@ -223,6 +242,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户短信注册', 1)); + $this->assign('referer_url', $this->GetrefererUrl()); return $this->fetch(); } else { @@ -248,6 +270,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户登录', 1)); + $this->assign('referer_url', $this->GetrefererUrl()); return $this->fetch(); } else { @@ -277,6 +302,9 @@ class User extends Common { if(empty($this->user)) { + // 浏览器名称 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户登录', 1)); + $this->assign('referer_url', $this->GetrefererUrl()); return $this->fetch(); } else { diff --git a/application/index/lang/zh-cn.php b/application/index/lang/zh-cn.php index 7f5f7f3ed..b0e08572a 100755 --- a/application/index/lang/zh-cn.php +++ b/application/index/lang/zh-cn.php @@ -16,133 +16,5 @@ * @version 0.0.1 * @datetime 2016-12-01T21:51:08+0800 */ -return array( - // 用户中心菜单, is_show = [0禁用, 1启用] - 'user_left_menu' => array( - array( - 'control' => 'user', - 'action' => 'index', - 'name' => '个人中心', - 'is_show' => 1, - 'icon' => 'am-icon-home', - ), - array( - 'name' => '交易管理', - 'is_show' => 1, - 'icon' => 'am-icon-cube', - 'item' => array( - array( - 'control' => 'order', - 'action' => 'index', - 'name' => '订单管理', - 'is_show' => 1, - 'icon' => 'am-icon-th-list', - ), - array( - 'control' => 'userfavor', - 'action' => 'goods', - 'name' => '我的收藏', - 'is_show' => 1, - 'icon' => 'am-icon-heart-o', - ), - ) - ), - array( - 'name' => '资料管理', - 'is_show' => 1, - 'icon' => 'am-icon-user', - 'item' => array( - array( - 'control' => 'personal', - 'action' => 'index', - 'name' => '个人资料', - 'is_show' => 1, - 'icon' => 'am-icon-gear', - ), - array( - 'control' => 'useraddress', - 'action' => 'index', - 'name' => '我的地址', - 'is_show' => 1, - 'icon' => 'am-icon-street-view', - ), - array( - 'control' => 'safety', - 'action' => 'index', - 'name' => '安全设置', - 'is_show' => 1, - 'icon' => 'am-icon-user-secret', - ), - array( - 'control' => 'message', - 'action' => 'index', - 'name' => '我的消息', - 'is_show' => 1, - 'icon' => 'am-icon-bell-o', - ), - array( - 'control' => 'userintegral', - 'action' => 'index', - 'name' => '我的积分', - 'is_show' => 1, - 'icon' => 'am-icon-fire', - ), - array( - 'control' => 'usergoodsbrowse', - 'action' => 'index', - 'name' => '我的足迹', - 'is_show' => 1, - 'icon' => 'am-icon-lastfm', - ), - array( - 'control' => 'user', - 'action' => 'logout', - 'name' => '安全退出', - 'is_show' => 1, - 'icon' => 'am-icon-power-off', - ), - ) - ), - ), - - - // 个人资料展示列表 - 'personal_show_list' => array( - 'avatar' => array('name' => '头像', 'tips' => '修改'), - 'nickname' => array('name' => '昵称'), - 'gender_text' => array('name' => '性别'), - 'birthday_text' => array('name' => '生日'), - 'mobile_security' => array('name' => '手机号码', 'tips' => '修改'), - 'email_security' => array('name' => '电子邮箱', 'tips' => '修改'), - 'add_time_text' => array('name' => '注册时间'), - 'upd_time_text' => array('name' => '最后更新时间'), - ), - - - // 安全项列表 - 'safety_panel_list' => array( - array( - 'title' => '登录密码', - 'msg' => '互联网存在被盗风险,建议您定期更改密码以保护安全。', - 'url' => MyUrl('index/safety/loginpwdinfo'), - 'type' => 'loginpwd', - ), - array( - 'title' => '手机号码', - 'no_msg' => '您还没有绑定手机号码', - 'ok_msg' => '已绑定手机 #accounts#', - 'tips' => '可用于登录,密码找回,账户安全管理校验,接受账户提醒通知。', - 'url' => MyUrl('index/safety/mobileinfo'), - 'type' => 'mobile', - ), - array( - 'title' => '电子邮箱', - 'no_msg' => '您还没有绑定电子邮箱', - 'ok_msg' => '已绑定电子邮箱 #accounts#', - 'tips' => '可用于登录,密码找回,账户安全管理校验,接受账户提醒邮件。', - 'url' => MyUrl('index/safety/emailinfo'), - 'type' => 'email', - ), - ), -); +return []; ?> \ No newline at end of file diff --git a/application/index/view/default/answer/index.html b/application/index/view/default/answer/index.html new file mode 100755 index 000000000..3643834b0 --- /dev/null +++ b/application/index/view/default/answer/index.html @@ -0,0 +1,133 @@ +{{include file="public/header" /}} + + +{{include file="public/header_top_nav" /}} + + +{{include file="public/nav_search" /}} + + +{{include file="public/header_nav" /}} + + +{{include file="public/goods_category" /}} + + +
      + + + {{include file="public/user_menu" /}} + + + +
      +
      +
      +
      +
      + + + + +
      + +
      + + + + + + + + + + +
      + 显示: + + + 状态: + +
      + + 清除条件 +
      +
      + + +
      + + + + + + + + + + + + + + + {{if !empty($data_list)}} + {{foreach $data_list as $v}} + + + + + + + + + + + {{/foreach}} + {{/if}} + {{if empty($data_list)}} + + + + {{/if}} + +
      姓名电话标题内容回复是否显示回复时间时间
      {{$v.name}}{{$v.tel}}{{$v.title}}{{$v.content}} + {{if $v['is_reply'] eq 1}} + {{$v.reply}} + {{else /}} + 未回复 + {{/if}} + {{$v.is_show_text}}{{$v.reply_time}}{{$v.add_time}}
      +
      没有相关数据
      +
      +
      + + + {{if !empty($data_list)}} + {{$page_html|raw}} + {{/if}} +
      +
      + +
      + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/index/view/default/buy/index.html b/application/index/view/default/buy/index.html index c1d7a298d..e083e30db 100755 --- a/application/index/view/default/buy/index.html +++ b/application/index/view/default/buy/index.html @@ -26,7 +26,7 @@ {{if !empty($user_address_list)}}
        {{foreach $user_address_list as $address}} -
      • +
      • {{if !empty($address.alias)}} @@ -70,12 +70,12 @@
        -
        +

        选择支付

        {{if !empty($payment_list)}}
          {{foreach $payment_list as $payment}} -
        • +
        • {{if !empty($payment.logo)}} {{/if}} @@ -153,6 +153,13 @@
          没有商品
          {{/if}} + +
          +

          + 合计 ¥{{$base.total_price}} +

          +
          +
          @@ -165,12 +172,17 @@
          - -
          -

          - 合计(含运费) ¥{{$base.total_price}} -

          -
          + + {{if !empty($extension_data)}} +
            + {{foreach $extension_data as $ext}} +
          • + {{$ext.name}} + {{$ext.tips}} +
          • + {{/foreach}} +
          + {{/if}}
          @@ -180,7 +192,7 @@ 实付款: ¥ - {{$base.total_price}} + {{$base.actual_price}}
          diff --git a/application/index/view/default/config.json b/application/index/view/default/config.json index 5b2f6403b..8e8519588 100755 --- a/application/index/view/default/config.json +++ b/application/index/view/default/config.json @@ -1,6 +1,6 @@ { "name":"默认模板", - "ver":"1.3.0", + "ver":"1.4.0", "author":"Devil", "home":"http://shopxo.net/" } \ No newline at end of file diff --git a/application/index/view/default/goods/index.html b/application/index/view/default/goods/index.html index d1af19eed..0d5063d42 100755 --- a/application/index/view/default/goods/index.html +++ b/application/index/view/default/goods/index.html @@ -80,18 +80,32 @@

          {{$goods.title}}

        - + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
        + plugins_view_goods_detail_base_top +
        + {{/if}} + {{if !empty($plugins_view_goods_detail_base_top_data) and is_array($plugins_view_goods_detail_base_top_data)}} + {{foreach $plugins_view_goods_detail_base_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + +
        - {{if isset($goods['original_price']) and $goods['original_price'] gt 0}} + {{if isset($goods['original_price']) and $goods['original_price'] gt 0 and !empty($goods['show_field_original_price_text'])}}
        -
        原价
        +
        {{$goods.show_field_original_price_text|raw}}
        ¥ {{$goods.original_price}}
        {{/if}}
        -
        促销价
        +
        {{if empty($goods['show_field_price_text'])}}销售价{{else /}}{{$goods.show_field_price_text|raw}}{{/if}}
        ¥ {{$goods.price}} @@ -101,17 +115,31 @@
        + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
        + plugins_view_goods_detail_panel_bottom +
        + {{/if}} + {{if !empty($plugins_view_goods_detail_panel_bottom_data) and is_array($plugins_view_goods_detail_panel_bottom_data)}} + {{foreach $plugins_view_goods_detail_panel_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}}
          -
        • +
        • 累计销量{{$goods.sales_count}}
        • -
        • +
        • 浏览次数{{$goods.access_count}}
        • -
        • +
        • 累计评价{{$goods.comments_count}}
        @@ -237,9 +265,24 @@
        - +
        + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
        + plugins_view_goods_detail_left_top +
        + {{/if}} + {{if !empty($plugins_view_goods_detail_left_top_data) and is_array($plugins_view_goods_detail_left_top_data)}} + {{foreach $plugins_view_goods_detail_left_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + +
          @@ -263,7 +306,24 @@
        + +
        + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
        + plugins_view_goods_detail_tabs_top +
        + {{/if}} + {{if !empty($plugins_view_goods_detail_tabs_top_data) and is_array($plugins_view_goods_detail_tabs_top_data)}} + {{foreach $plugins_view_goods_detail_tabs_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + +
        • @@ -329,6 +389,20 @@
        + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
        + plugins_view_goods_detail_tabs_bottom +
        + {{/if}} + {{if !empty($plugins_view_goods_detail_tabs_bottom_data) and is_array($plugins_view_goods_detail_tabs_bottom_data)}} + {{foreach $plugins_view_goods_detail_tabs_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}}
      diff --git a/application/index/view/default/message/index.html b/application/index/view/default/message/index.html index 21c424fcb..cfbce7f25 100755 --- a/application/index/view/default/message/index.html +++ b/application/index/view/default/message/index.html @@ -83,7 +83,7 @@ - +
      diff --git a/application/index/view/default/order/detail.html b/application/index/view/default/order/detail.html index 056f3f39f..8434742b2 100755 --- a/application/index/view/default/order/detail.html +++ b/application/index/view/default/order/detail.html @@ -191,19 +191,33 @@ 您可以 {{/if}} {{if in_array($data['status'], [0,1])}} - + {{/if}} {{if in_array($data['status'], [1])}} - + {{/if}} {{if in_array($data['status'], [3])}} - + {{/if}} {{if in_array($data['status'], [4]) and $data['user_is_comments'] eq 0}} - 评价 + 评价 {{/if}} {{if in_array($data['status'], [4,5,6])}} - + + {{/if}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
      + plugins_service_order_handle_operation_html +
      + {{/if}} + {{if !empty($data['plugins_service_order_handle_operation_html']) and is_array($data['plugins_service_order_handle_operation_html'])}} + {{foreach $data.plugins_service_order_handle_operation_html as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} {{/if}} {{if in_array($data['status'], [3,4])}} @@ -282,6 +296,17 @@
      + {{if !empty($data['extension_data'])}} +
      + {{foreach $data.extension_data as $ertk=>$ext}} +
      +
      {{$ext.name}}:
      +
      {{$ext.tips}}
      +
      + {{/foreach}} +
      + {{/if}} +
      {{if !empty($data.price)}}
      @@ -289,6 +314,12 @@
      ¥{{$data.price}}
      {{/if}} + {{if !empty($data.increase_price)}} +
      +
      增加金额:
      +
      +¥{{$data.increase_price}}
      +
      + {{/if}} {{if !empty($data.preferential_price)}}
      优惠金额:
      @@ -342,7 +373,7 @@
      没有支付方式
      {{/if}}
      -
      +
      diff --git a/application/index/view/default/order/index.html b/application/index/view/default/order/index.html index 3f2a3d33b..5482557b4 100755 --- a/application/index/view/default/order/index.html +++ b/application/index/view/default/order/index.html @@ -41,21 +41,21 @@ 时间: - + ~ - + 价格: - + ~ - + @@ -190,19 +190,33 @@ {{if in_array($order['status'], [0,1])}} - + {{/if}} {{if in_array($order['status'], [1])}} - 支付 + 支付 {{/if}} {{if in_array($order['status'], [3])}} - + {{/if}} {{if in_array($order['status'], [4]) and $order['user_is_comments'] eq 0}} - 评价 + 评价 {{/if}} {{if in_array($order['status'], [4,5,6])}} - + + {{/if}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
      + plugins_service_order_handle_operation_html +
      + {{/if}} + {{if !empty($order['plugins_service_order_handle_operation_html']) and is_array($order['plugins_service_order_handle_operation_html'])}} + {{foreach $order.plugins_service_order_handle_operation_html as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} {{/if}} {{/if}} diff --git a/application/index/view/default/personal/index.html b/application/index/view/default/personal/index.html index 7d921381d..2ae00f43b 100755 --- a/application/index/view/default/personal/index.html +++ b/application/index/view/default/personal/index.html @@ -28,18 +28,26 @@
      {{foreach $personal_show_list as $k=>$v}} - {{if isset($user[$k])}} + {{if isset($user[$k]) or (isset($v['is_ext']) and $v['is_ext'] eq 1)}}
      {{$v.name}}
      - {{if empty($user[$k])}} - 未填写 - {{elseif $k eq 'avatar' /}} - + {{if isset($v['is_ext']) and $v['is_ext'] eq 1}} + {{$v.value}} {{else /}} - {{$user[$k]}} - {{/if}} - {{if isset($v['tips'])}} - {{$v.tips|raw}} + {{if empty($user[$k])}} + 未填写 + {{elseif $k eq 'avatar' /}} + + {{else /}} + {{$user[$k]}} + {{/if}} + {{/if}} + {{if !empty($v['tips'])}} + {{if !empty($v['path'])}} + {{:str_replace('{path}', MyUrl($v['path']), $v['tips'])}} + {{else /}} + {{$v.tips|raw}} + {{/if}} {{/if}}
      {{/if}} diff --git a/application/index/view/default/personal/save_info.html b/application/index/view/default/personal/save_info.html index b6cfe1124..03400de6f 100755 --- a/application/index/view/default/personal/save_info.html +++ b/application/index/view/default/personal/save_info.html @@ -37,7 +37,7 @@
      -
      +
      diff --git a/application/index/view/default/public/header_top_nav.html b/application/index/view/default/public/header_top_nav.html index 87550fbda..acbd603cc 100755 --- a/application/index/view/default/public/header_top_nav.html +++ b/application/index/view/default/public/header_top_nav.html @@ -16,76 +16,63 @@ 您好 {{$user.user_name_view}},欢迎来到 {{:MyC('home_site_name')}} [退出] {{/if}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
      + plugins_view_header_navigation_top_left +
      + {{/if}} + {{if !empty($plugins_view_header_navigation_top_left_data) and is_array($plugins_view_header_navigation_top_left_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{foreach $plugins_view_header_navigation_top_left_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}}
- \ No newline at end of file + -
+ 原电子邮箱校验 返回 @@ -39,7 +39,7 @@
-
+
@@ -56,8 +56,8 @@ diff --git a/application/index/view/default/safety/login_pwd_info.html b/application/index/view/default/safety/login_pwd_info.html index 88cd0a64f..7fb6249a5 100755 --- a/application/index/view/default/safety/login_pwd_info.html +++ b/application/index/view/default/safety/login_pwd_info.html @@ -40,7 +40,7 @@
-
+
diff --git a/application/index/view/default/safety/mobile_info.html b/application/index/view/default/safety/mobile_info.html index 470ee49c1..c7cbb18fc 100755 --- a/application/index/view/default/safety/mobile_info.html +++ b/application/index/view/default/safety/mobile_info.html @@ -39,7 +39,7 @@
-
+
@@ -56,8 +56,8 @@ diff --git a/application/index/view/default/safety/new_email_info.html b/application/index/view/default/safety/new_email_info.html index a77fb4182..8f3aab8f4 100755 --- a/application/index/view/default/safety/new_email_info.html +++ b/application/index/view/default/safety/new_email_info.html @@ -39,7 +39,7 @@
-
+
@@ -56,8 +56,8 @@ diff --git a/application/index/view/default/safety/new_mobile_info.html b/application/index/view/default/safety/new_mobile_info.html index cbf324dcc..f46f2d3b2 100755 --- a/application/index/view/default/safety/new_mobile_info.html +++ b/application/index/view/default/safety/new_mobile_info.html @@ -39,7 +39,7 @@
-
+
@@ -56,8 +56,8 @@ diff --git a/application/index/view/default/user/email_reg_info.html b/application/index/view/default/user/email_reg_info.html index 4b0331700..59fec28e4 100755 --- a/application/index/view/default/user/email_reg_info.html +++ b/application/index/view/default/user/email_reg_info.html @@ -23,38 +23,57 @@ -
{{/if}} - -
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_user_email_reg_info +
+ {{/if}} + {{if !empty($plugins_view_user_email_reg_info_data) and is_array($plugins_view_user_email_reg_info_data)}} + {{foreach $plugins_view_user_email_reg_info_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} +
+ +
+
- -
- - - - +
+ +
+ + + + +
-
- -
- - - - +
+ +
+ + + + +
-

+ +

忘记密码? -

+
@@ -69,8 +88,8 @@
- 'reg'])}}"' /> - 看不清换一张 + + 看不清换一张
diff --git a/application/index/view/default/user/forget_pwd_info.html b/application/index/view/default/user/forget_pwd_info.html index 2daa82b10..82f82d219 100755 --- a/application/index/view/default/user/forget_pwd_info.html +++ b/application/index/view/default/user/forget_pwd_info.html @@ -22,29 +22,34 @@ 立即登录
{{/if}} - -
+
+
- -
- - - - +
+ +
+ + + + +
-
- -
- - - - + +
+ +
+ + + + +
-

+ +

-

+
@@ -59,8 +64,8 @@
- 'forget'])}}"' /> - 看不清换一张 + + 看不清换一张
diff --git a/application/index/view/default/user/login_info.html b/application/index/view/default/user/login_info.html index d6ab44132..cbac71ff9 100755 --- a/application/index/view/default/user/login_info.html +++ b/application/index/view/default/user/login_info.html @@ -21,20 +21,37 @@ {{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}} 还没有帐号? 立即注册 -
{{/if}} - -
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_user_login_info_top +
+ {{/if}} + {{if !empty($plugins_view_user_login_info_top_data) and is_array($plugins_view_user_login_info_top_data)}} + {{foreach $plugins_view_user_login_info_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} +
+ +
+
- -
+ +
+
-

+ +

忘记密码? -

+
diff --git a/application/index/view/default/user/modal_login_info.html b/application/index/view/default/user/modal_login_info.html index a0fab3339..3d46c2970 100755 --- a/application/index/view/default/user/modal_login_info.html +++ b/application/index/view/default/user/modal_login_info.html @@ -9,20 +9,37 @@ {{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}} 还没有帐号? 立即注册 -
{{/if}} - -
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_user_login_info_top +
+ {{/if}} + {{if !empty($plugins_view_user_login_info_top_data) and is_array($plugins_view_user_login_info_top_data)}} + {{foreach $plugins_view_user_login_info_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} +
+ +
+
- -
+ +
+
-

+ +

忘记密码? -

+
diff --git a/application/index/view/default/user/reg_info.html b/application/index/view/default/user/reg_info.html index 2095c51e3..b6d05b317 100755 --- a/application/index/view/default/user/reg_info.html +++ b/application/index/view/default/user/reg_info.html @@ -26,6 +26,20 @@ {{else /}} 暂时关闭邮箱注册 {{/if}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_user_reg_info +
+ {{/if}} + {{if !empty($plugins_view_user_reg_info_data) and is_array($plugins_view_user_reg_info_data)}} + {{foreach $plugins_view_user_reg_info_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}}
diff --git a/application/index/view/default/user/sms_reg_info.html b/application/index/view/default/user/sms_reg_info.html index bbe71542e..6f59b3b34 100755 --- a/application/index/view/default/user/sms_reg_info.html +++ b/application/index/view/default/user/sms_reg_info.html @@ -23,38 +23,56 @@ -
{{/if}} - -
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_user_sms_reg_info +
+ {{/if}} + {{if !empty($plugins_view_user_sms_reg_info_data) and is_array($plugins_view_user_sms_reg_info_data)}} + {{foreach $plugins_view_user_sms_reg_info_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} +
+ +
+
- -
- - - - +
+ +
+ + + + +
-
- -
- - - - +
+ +
+ + + + +
-

+

忘记密码? -

+
@@ -69,8 +87,8 @@
- 'reg'])}}"' /> - 看不清换一张 + + 看不清换一张
diff --git a/application/index/view/default/userintegral/index.html b/application/index/view/default/userintegral/index.html index 0f54124a7..45eac4992 100755 --- a/application/index/view/default/userintegral/index.html +++ b/application/index/view/default/userintegral/index.html @@ -59,7 +59,7 @@ - +
diff --git a/application/install/config/template.php b/application/install/config/template.php old mode 100644 new mode 100755 diff --git a/application/install/controller/Common.php b/application/install/controller/Common.php old mode 100644 new mode 100755 diff --git a/application/install/controller/Error.php b/application/install/controller/Error.php old mode 100644 new mode 100755 diff --git a/application/install/controller/Index.php b/application/install/controller/Index.php old mode 100644 new mode 100755 diff --git a/application/install/view/index/check.html b/application/install/view/index/check.html old mode 100644 new mode 100755 diff --git a/application/install/view/index/create.html b/application/install/view/index/create.html old mode 100644 new mode 100755 index 7fe98d3f3..8bf43dcc9 --- a/application/install/view/index/create.html +++ b/application/install/view/index/create.html @@ -79,7 +79,7 @@ -
+
上一步
diff --git a/application/install/view/index/index.html b/application/install/view/index/index.html old mode 100644 new mode 100755 diff --git a/application/install/view/index/successful.html b/application/install/view/index/successful.html old mode 100644 new mode 100755 diff --git a/application/lang/zh-cn.php b/application/lang/zh-cn.php index 2739d5f31..bb8bf384a 100755 --- a/application/lang/zh-cn.php +++ b/application/lang/zh-cn.php @@ -22,6 +22,7 @@ return array( '1.1.0' => array('value' => '1.1.0', 'name' => 'v1.1.0'), '1.2.0' => array('value' => '1.2.0', 'name' => 'v1.2.0'), '1.3.0' => array('value' => '1.3.0', 'name' => 'v1.3.0'), + '1.4.0' => array('value' => '1.4.0', 'name' => 'v1.4.0'), ), // 性别 @@ -210,6 +211,7 @@ return array( 0 => array('id' => 0, 'name' => '正常', 'checked' => true), 1 => array('id' => 1, 'name' => '禁止发言', 'tips' => '用户被禁止发言'), 2 => array('id' => 2, 'name' => '禁止登录', 'tips' => '用户被禁止登录'), + 3 => array('id' => 3, 'name' => '待审核', 'tips' => '用户等待审核中'), ), // 是否已评价 diff --git a/application/middleware.php b/application/middleware.php old mode 100644 new mode 100755 diff --git a/application/plugins/answers/Admin.php b/application/plugins/answers/Admin.php new file mode 100644 index 000000000..9d00a5d7c --- /dev/null +++ b/application/plugins/answers/Admin.php @@ -0,0 +1,291 @@ +assign('data', isset($base['data']) ? $base['data'] : []); + + // 幻灯片 + $data_params = [ + 'where' => ['is_enable'=>1], + ]; + $slider = Service::SlideList($data_params); + $this->assign('slider', isset($slider['data']) ? $slider['data'] : []); + + // 商品数据 + $goods = Service::GoodsList(); + $this->assign('goods_list', $goods['data']['goods']); + + return $this->fetch('../../../plugins/view/answers/admin/index'); + } + + /** + * 基础信息编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function baseinfo($params = []) + { + $ret = PluginsService::PluginsData('answers', ['images', 'images_bottom']); + if($ret['code'] == 0) + { + // 是否 + $is_whether_list = [ + 0 => array('id' => 0, 'name' => '否', 'checked' => true), + 1 => array('id' => 1, 'name' => '是'), + ]; + + $this->assign('is_whether_list', $is_whether_list); + $this->assign('data', $ret['data']); + + // 获取推荐问答 + if(!empty($ret['data']['category_ids'])) + { + $answers = Service::AnswerList(['n'=>100, 'field'=>'id,content as title', 'category_ids'=> $ret['data']['category_ids']]); + $this->assign('answers_rc_list', $answers['data']); + } else { + $this->assign('answers_rc_list', []); + } + + return $this->fetch('../../../plugins/view/answers/admin/baseinfo'); + } else { + return $ret['msg']; + } + } + + /** + * 基础数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function basesave($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'answers', 'data'=>$params], ['images', 'images_bottom']); + } + + /** + * 幻灯片页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function slider($params = []) + { + $ret = Service::SlideList(); + if($ret['code'] == 0) + { + $this->assign('data_list', $ret['data']); + return $this->fetch('../../../plugins/view/answers/admin/slider'); + } else { + return $ret['msg']; + } + } + + /** + * 幻灯片编辑 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function sliderinfo($params = []) + { + // 数据 + $data = []; + if(!empty($params['id'])) + { + $data_params = array( + 'where' => ['id'=>intval($params['id'])], + ); + $ret = Service::SlideList($data_params); + $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; + } + $this->assign('data', $data); + + return $this->fetch('../../../plugins/view/answers/admin/sliderinfo'); + } + + /** + * 幻灯片保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function slidersave($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + return Service::SlideSave($params); + } + + /** + * 幻灯片删除 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-15T11:03:30+0800 + * @param [array] $params [输入参数] + */ + public function sliderdelete($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + return Service::SlideDelete($params); + } + + /** + * 幻灯片状态更新 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2017-01-12T22:23:06+0800 + * @param [array] $params [输入参数] + */ + public function sliderstatusupdate($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + return Service::SlideStatusUpdate($params); + } + + + /** + * 推荐商品编辑编辑 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function goodsinfo($params = []) + { + // 商品数据 + $goods = Service::GoodsList(); + $this->assign('goods', $goods['data']); + + // 商品分类 + $this->assign('goods_category_list', GoodsService::GoodsCategory()); + + return $this->fetch('../../../plugins/view/answers/admin/goodsinfo'); + } + + /** + * 商品搜索 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function goodssearch($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 搜索数据 + return Service::GoodsSearchList($params); + } + + /** + * 商品保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function goodssave($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 搜索数据 + return Service::GoodsSave($params); + } + + /** + * 问答搜索 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function answerssearch($params = []) + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 问答内容 + return Service::AnswerList(['n'=>100, 'field'=>'id,content as title']); + } +} +?> \ No newline at end of file diff --git a/application/plugins/answers/Hook.php b/application/plugins/answers/Hook.php new file mode 100644 index 000000000..0360e4607 --- /dev/null +++ b/application/plugins/answers/Hook.php @@ -0,0 +1,59 @@ + 0, + 'pid' => 0, + 'name' => $ret['data']['application_name'], + 'url' => PluginsHomeUrl('answers', 'index', 'index'), + 'data_type' => 'custom', + 'is_show' => 1, + 'is_new_window_open' => 0, + 'items' => [], + ]; + array_unshift($params['header'], $nav); + } + } + } + } +} +?> \ No newline at end of file diff --git a/application/plugins/answers/Index.php b/application/plugins/answers/Index.php new file mode 100644 index 000000000..53e649466 --- /dev/null +++ b/application/plugins/answers/Index.php @@ -0,0 +1,224 @@ +assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []); + + // 幻灯片 + $data_params = [ + 'where' => ['is_enable'=>1], + ]; + $slider = Service::SlideList($data_params); + $this->assign('plugins_answers_slider', isset($slider['data']) ? $slider['data'] : []); + + // 商品数据 + $goods = Service::GoodsList(); + $this->assign('plugins_answers_goods_list', $goods['data']['goods']); + + // 最新问答内容 + $middle_new_page_number = isset($base['data']['middle_new_page_number']) ? intval($base['data']['middle_new_page_number']) : 15; + $answer = Service::AnswerList(['n'=>$middle_new_page_number]); + $this->assign('plugins_answers_middle_answer_list', $answer['data']); + + // 推荐问答 + if(!empty($base['data']['category_ids'])) + { + $answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]); + $this->assign('plugins_answers_rc_list', $answers['data']); + } else { + $this->assign('plugins_answers_rc_list', []); + } + + // 最新商品 + if(!empty($base['data']['home_new_goods_number'])) + { + $goods = GoodsService::GoodsList(['where'=>['is_delete_time'=>0], 'field'=>'id,title,images,min_price', 'n'=>intval($base['data']['home_new_goods_number'])]); + $this->assign('plugins_new_goods_list', $goods['data']); + } + + // 浏览器标题 + $seo_name = empty($base['data']['application_name']) ? '问答' : $base['data']['application_name']; + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($seo_name, 1)); + + return $this->fetch('../../../plugins/view/answers/index/index'); + } + + /** + * 详情入口 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-07 + * @desc description + * @param [array] $params [输入参数] + */ + public function detail($params = []) + { + // 基础数据 + $base = PluginsService::PluginsData('answers', ['images', 'images_bottom']); + $this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []); + + // 商品数据 + $goods = Service::GoodsList(); + $this->assign('plugins_answers_goods_list', $goods['data']['goods']); + + // 推荐问答 + if(!empty($base['data']['category_ids'])) + { + $answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]); + $this->assign('plugins_answers_rc_list', $answers['data']); + } else { + $this->assign('plugins_answers_rc_list', []); + } + + // 获取问答数据 + $detail = Service::AnswerRow($params); + $this->assign('plugins_answers_detail', $detail); + + // 浏览次数 + if($detail['code'] == 0 && !empty($detail['data']['id'])) + { + AnswerService::AnswerAccessCountInc(['answer_id'=>$detail['data']['id']]); + } + + // 浏览器标题 + if(!empty($detail['data']['title'])) + { + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($detail['data']['title'])); + } else if(!empty($detail['data']['content'])) + { + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($detail['data']['content'])); + } + + return $this->fetch('../../../plugins/view/answers/index/detail'); + } + + /** + * 搜索 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-11 + * @desc description + * @param [array] $params [输入参数] + */ + public function search($params = []) + { + if(input('post.answers_keywords')) + { + $answers_keywords = str_replace(['?', ' ', '+', '-'], '', trim(input('post.answers_keywords'))); + return redirect(PluginsHomeUrl('answers', 'index', 'search', ['answers_keywords'=>$answers_keywords])); + } else { + // 基础数据 + $base = PluginsService::PluginsData('answers', ['images', 'images_bottom']); + $this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []); + + // 商品数据 + $goods = Service::GoodsList(); + $this->assign('plugins_answers_goods_list', $goods['data']['goods']); + + // 推荐问答 + if(!empty($base['data']['category_ids'])) + { + $answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]); + $this->assign('plugins_answers_rc_list', $answers['data']); + } else { + $this->assign('plugins_answers_rc_list', []); + } + + // 获取搜索数据 + // 分页 + $number = isset($base['data']['search_page_number']) ? intval($base['data']['search_page_number']) : 28; + + // 条件 + $keywords_arr = empty($params['answers_keywords']) ? [] : ['keywords'=>$params['answers_keywords']]; + $where = Service::AnswerListWhere(array_merge($params, $keywords_arr)); + + // 获取总数 + $total = AnswerService::AnswerTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'page' => isset($params['page']) ? intval($params['page']) : 1, + 'url' => PluginsHomeUrl('answers', 'index', 'search'), + ); + $page = new \base\Page($page_params); + $this->assign('page_html', $page->GetPageHtml()); + + // 获取列表 + $data_params = array( + 'm' => $page->GetPageStarNumber(), + 'n' => $number, + 'where' => $where, + 'field' => 'id,title,content,add_time,is_reply', + ); + $data = AnswerService::AnswerList($data_params); + $this->assign('plugins_answers_data_list', $data['data']); + + // 参数 + $this->assign('params', $params); + + // 浏览器标题 + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('问答搜索', 1)); + + return $this->fetch('../../../plugins/view/answers/index/search'); + } + } + + /** + * 提问 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function answer($params = []) + { + $params = input('post.'); + $params['user'] = UserService::LoginUserInfo(); + return AnswerService::Add($params); + } +} +?> \ No newline at end of file diff --git a/application/plugins/answers/Service.php b/application/plugins/answers/Service.php new file mode 100644 index 000000000..dbe30a5e8 --- /dev/null +++ b/application/plugins/answers/Service.php @@ -0,0 +1,408 @@ +where($where)->order('sort asc')->select(); + if(!empty($data)) + { + $common_is_enable_tips = lang('common_is_enable_tips'); + foreach($data as &$v) + { + // 是否启用 + $v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name']; + + // 图片地址 + $v['images_url_old'] = $v['images_url']; + $v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']); + + // 时间 + $v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']); + $v['add_time_date'] = date('Y-m-d', $v['add_time']); + $v['upd_time_time'] = date('Y-m-d H:i:s', $v['upd_time']); + $v['upd_time_date'] = date('Y-m-d', $v['upd_time']); + } + } + return DataReturn('处理成功', 0, $data); + } + + /** + * 幻灯片数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-12-19 + * @desc description + * @param [array] $params [输入参数] + */ + public static function SlideSave($params = []) + { + // 请求类型 + $p = [ + [ + 'checked_type' => 'length', + 'key_name' => 'name', + 'checked_data' => '2,60', + 'error_msg' => '名称长度 2~60 个字符', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'images_url', + 'checked_data' => '255', + 'error_msg' => '请上传图片', + ], + [ + 'checked_type' => 'fun', + 'key_name' => 'url', + 'is_checked' => 1, + 'checked_data' => 'CheckUrl', + 'error_msg' => 'url格式有误', + ], + [ + 'checked_type' => 'length', + 'key_name' => 'sort', + 'checked_data' => '3', + 'error_msg' => '顺序 0~255 之间的数值', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 附件 + $data_fields = ['images_url']; + $attachment = ResourcesService::AttachmentParams($params, $data_fields); + + // 数据 + $data = [ + 'name' => $params['name'], + 'url' => $params['url'], + 'images_url' => $attachment['data']['images_url'], + 'sort' => intval($params['sort']), + 'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0, + ]; + + if(empty($params['id'])) + { + $data['add_time'] = time(); + if(Db::name('PluginsAnswersSlide')->insertGetId($data) > 0) + { + return DataReturn('添加成功', 0); + } + return DataReturn('添加失败', -100); + } else { + $data['upd_time'] = time(); + if(Db::name('PluginsAnswersSlide')->where(['id'=>intval($params['id'])])->update($data)) + { + return DataReturn('编辑成功', 0); + } + return DataReturn('编辑失败', -100); + } + } + + /** + * 幻灯片删除 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-12-18 + * @desc description + * @param [array] $params [输入参数] + */ + public static function SlideDelete($params = []) + { + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'id', + 'error_msg' => '操作id有误', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 删除操作 + if(Db::name('PluginsAnswersSlide')->where(['id'=>$params['id']])->delete()) + { + return DataReturn('删除成功'); + } + + return DataReturn('删除失败或资源不存在', -100); + } + + /** + * 幻灯片状态更新 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-06T21:31:53+0800 + * @param [array] $params [输入参数] + */ + public static function SlideStatusUpdate($params = []) + { + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'id', + 'error_msg' => '操作id有误', + ], + [ + 'checked_type' => 'in', + 'key_name' => 'state', + 'checked_data' => [0,1], + 'error_msg' => '状态有误', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 数据更新 + if(Db::name('PluginsAnswersSlide')->where(['id'=>intval($params['id'])])->update(['is_enable'=>intval($params['state'])])) + { + return DataReturn('编辑成功'); + } + return DataReturn('编辑失败或数据未改变', -100); + } + + /** + * 商品搜索 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-06T21:31:53+0800 + * @param [array] $params [输入参数] + */ + public static function GoodsSearchList($params = []) + { + // 条件 + $where = [ + ['g.is_delete_time', '=', 0], + ['g.is_shelves', '=', 1] + ]; + + // 关键字 + if(!empty($params['keywords'])) + { + $where[] = ['g.title', 'like', '%'.$params['keywords'].'%']; + } + + // 分类id + if(!empty($params['category_id'])) + { + $category_ids = GoodsService::GoodsCategoryItemsIds([$params['category_id']], 1); + $category_ids[] = $params['category_id']; + $where[] = ['gci.category_id', 'in', $category_ids]; + } + + // 指定字段 + $field = 'g.id,g.title'; + + // 获取数据 + return GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field, 'is_admin_access'=>1]); + } + + /** + * 关联商品保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-07 + * @desc description + * @param [array] $params [输入参数] + */ + public static function GoodsSave($params = []) + { + // 清除商品id + Db::name('PluginsAnswersGoods')->where('id', '>', 0)->delete(); + + // 写入商品id + if(!empty($params['category_ids'])) + { + $ids_all = explode(',', $params['category_ids']); + $data = []; + foreach($ids_all as $goods_id) + { + $data[] = [ + 'goods_id' => $goods_id, + 'add_time' => time(), + ]; + } + if(Db::name('PluginsAnswersGoods')->insertAll($data) < count($data)) + { + return DataReturn('操作失败', -100); + } + } + return DataReturn('操作成功', 0); + } + + /** + * 商品列表 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-06T21:31:53+0800 + * @param [array] $params [输入参数] + */ + public static function GoodsList($params = []) + { + // 获取推荐商品id + $goods_ids = Db::name('PluginsAnswersGoods')->column('goods_id'); + if(empty($goods_ids)) + { + return DataReturn('没有商品', 0, ['goods'=>[], 'goods_ids'=>[]]); + } + + // 条件 + $where = [ + ['g.is_delete_time', '=', 0], + ['g.is_shelves', '=', 1], + ['g.id', 'in', $goods_ids], + ]; + + // 指定字段 + $field = 'g.id,g.title,g.images,g.min_price'; + + // 获取数据 + $ret = GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]); + return DataReturn('操作成功', 0, ['goods'=>$ret['data'], 'goods_ids'=>$goods_ids]); + } + + /** + * 条件 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-11 + * @desc description + * @param [array] $params [输入参数] + */ + public static function AnswerListWhere($params = []) + { + // 条件 + $where = [ + ['is_delete_time', '=', 0], + ['is_show', '=', 1], + ]; + + // 搜索关键字 + if(!empty($params['keywords'])) + { + $where[] = ['title|content', 'like', '%'.$params['keywords'].'%']; + } + + // 指定问答id + if(!empty($params['category_ids'])) + { + $where[] = ['id', 'in', explode(',', $params['category_ids'])]; + } + + return $where; + } + + /** + * 问答列表 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-06T21:31:53+0800 + * @param [array] $params [输入参数] + */ + public static function AnswerList($params = []) + { + // 字段 + $field = empty($params['field']) ? 'id,name,title,content,reply,is_reply,reply_time,add_time' : $params['field']; + + // 获取列表 + $data_params = array( + 'm' => 0, + 'n' => isset($params['n']) ? intval($params['n']) : 10, + 'where' => self::AnswerListWhere($params), + 'field' => $field, + ); + return AnswerService::AnswerList($data_params); + } + + /** + * 获取一条问答 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-06T21:31:53+0800 + * @param [array] $params [输入参数] + */ + public static function AnswerRow($params = []) + { + // 参数 + if(empty($params['id'])) + { + return DataReturn('问答id有误', -1); + } + // 条件 + $where = [ + ['is_delete_time', '=', 0], + ['is_show', '=', 1], + ['id', '=', intval($params['id'])], + ]; + + // 字段 + $field = 'id,name,title,content,reply,is_reply,access_count,reply_time,add_time'; + + // 获取列表 + $data_params = array( + 'm' => 0, + 'n' => 1, + 'where' => $where, + 'field' => $field, + ); + $ret = AnswerService::AnswerList($data_params); + if(isset($ret['data'][0])) + { + $ret['data'] = $ret['data'][0]; + } + return $ret; + } +} +?> \ No newline at end of file diff --git a/application/plugins/answers/config.json b/application/plugins/answers/config.json new file mode 100644 index 000000000..aee1534c9 --- /dev/null +++ b/application/plugins/answers/config.json @@ -0,0 +1,24 @@ +{ + "base":{ + "plugins":"answers", + "name":"问答增强版", + "logo":"\/static\/upload\/images\/plugins_answers\/2019\/03\/06\/1551853529634743.png", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"问答系统增强、独立首页、详情、搜索、可配置推荐问答及商品", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":true + }, + "hook":{ + "plugins_service_navigation_header_handle":[ + "app\\plugins\\answers\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/answers/install.sql b/application/plugins/answers/install.sql new file mode 100644 index 000000000..0e6a86093 --- /dev/null +++ b/application/plugins/answers/install.sql @@ -0,0 +1,23 @@ +# 问答系统商品 - 应用 +CREATE TABLE `s_plugins_answers_goods` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id', + `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id', + `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', + PRIMARY KEY (`id`), + KEY `goods_id` (`goods_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='问答系统商品 - 应用'; + +# 问答系统轮播图 - 应用 +CREATE TABLE `s_plugins_answers_slide` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id', + `name` char(60) NOT NULL DEFAULT '' COMMENT '别名', + `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址', + `url` char(255) NOT NULL DEFAULT '' COMMENT 'url地址', + `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)', + `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序', + `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', + `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`id`), + KEY `is_enable` (`is_enable`), + KEY `sort` (`sort`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='问答系统轮播图 - 应用'; \ No newline at end of file diff --git a/application/plugins/answers/uninstall.sql b/application/plugins/answers/uninstall.sql new file mode 100644 index 000000000..f2e5e4671 --- /dev/null +++ b/application/plugins/answers/uninstall.sql @@ -0,0 +1,5 @@ +# 问答系统商品 - 应用 +DROP TABLE `s_plugins_answers_goods`; + +# 问答系统轮播图 - 应用 +DROP TABLE `s_plugins_answers_slide`; \ No newline at end of file diff --git a/application/plugins/commongobacktop/Admin.php b/application/plugins/commongobacktop/Admin.php index a67f10f14..e428721f4 100755 --- a/application/plugins/commongobacktop/Admin.php +++ b/application/plugins/commongobacktop/Admin.php @@ -79,7 +79,7 @@ class Admin extends Controller */ public function save($params = []) { - return PluginsService::PluginsDataSave(['plugins'=>'commongobacktop', 'data'=>$params]); + return PluginsService::PluginsDataSave(['plugins'=>'commongobacktop', 'data'=>$params], ['images']); } } ?> \ No newline at end of file diff --git a/application/plugins/commongobacktop/Hook.php b/application/plugins/commongobacktop/Hook.php index 7dbe9fce9..6ae036a64 100755 --- a/application/plugins/commongobacktop/Hook.php +++ b/application/plugins/commongobacktop/Hook.php @@ -32,41 +32,28 @@ class Hook extends Controller */ public function run($params = []) { - // 是否控制器钩子 - // is_control 当前为控制器业务处理 - // hook_name 钩子名称 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + if(!empty($params['hook_name'])) { - // 参数一 描述 - // 参数二 0 为处理成功, 负数为失败 - // 参数三 返回数据 - return DataReturn('返回描述', 0); - - // 默认返回视图 - } else { - if(!empty($params['hook_name'])) + switch($params['hook_name']) { - switch($params['hook_name']) - { - case 'plugins_view_common_bottom' : - $ret = $this->html($params); - break; + case 'plugins_view_common_bottom' : + $ret = $this->html($params); + break; - case 'plugins_common_page_bottom' : - $ret = $this->js($params); - break; + case 'plugins_common_page_bottom' : + $ret = $this->js($params); + break; - case 'plugins_common_header' : - $ret = $this->css($params); - break; + case 'plugins_common_header' : + $ret = $this->css($params); + break; - default : - $ret = ''; - } - return $ret; - } else { - return ''; + default : + $ret = ''; } + return $ret; + } else { + return ''; } } diff --git a/application/plugins/commononlineservice/Hook.php b/application/plugins/commononlineservice/Hook.php index 79057e630..f0393374c 100755 --- a/application/plugins/commononlineservice/Hook.php +++ b/application/plugins/commononlineservice/Hook.php @@ -33,9 +33,9 @@ class Hook extends Controller public function run($params = []) { // 是否控制器钩子 - // is_control 当前为控制器业务处理 + // is_backend 当前为后端业务处理 // hook_name 钩子名称 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { // 参数一 描述 // 参数二 0 为处理成功, 负数为失败 diff --git a/application/plugins/commonrightnavigation/Admin.php b/application/plugins/commonrightnavigation/Admin.php index be883b2d4..92132f8bf 100755 --- a/application/plugins/commonrightnavigation/Admin.php +++ b/application/plugins/commonrightnavigation/Admin.php @@ -79,7 +79,7 @@ class Admin extends Controller */ public function save($params = []) { - return PluginsService::PluginsDataSave(['plugins'=>'commonrightnavigation', 'data'=>$params]); + return PluginsService::PluginsDataSave(['plugins'=>'commonrightnavigation', 'data'=>$params], ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']); } } ?> \ No newline at end of file diff --git a/application/plugins/commonrightnavigation/Hook.php b/application/plugins/commonrightnavigation/Hook.php index a57c70e13..adc13e26c 100755 --- a/application/plugins/commonrightnavigation/Hook.php +++ b/application/plugins/commonrightnavigation/Hook.php @@ -34,9 +34,9 @@ class Hook extends Controller public function run($params = []) { // 是否控制器钩子 - // is_control 当前为控制器业务处理 + // is_backend 当前为后端业务处理 // hook_name 钩子名称 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { // 参数一 描述 // 参数二 0 为处理成功, 负数为失败 diff --git a/application/plugins/commonrightnavigation/Index.php b/application/plugins/commonrightnavigation/Index.php old mode 100644 new mode 100755 index 1278047e8..3162f0a98 --- a/application/plugins/commonrightnavigation/Index.php +++ b/application/plugins/commonrightnavigation/Index.php @@ -13,6 +13,7 @@ namespace app\plugins\commonrightnavigation; use think\Controller; use app\service\AnswerService; use app\service\BuyService; +use app\service\UserService; /** * 右侧快捷导航 - 前端 @@ -34,7 +35,7 @@ class Index extends Controller public function answer($params = []) { $params = input('post.'); - $params['user'] = session('user'); + $params['user'] = UserService::LoginUserInfo(); return AnswerService::Add($params); } @@ -57,7 +58,7 @@ class Index extends Controller $this->assign('module_controller_action', $module_name.$controller_name.$action_name); // 购物车 - $cart_list = BuyService::CartList(['user'=>session('user')]); + $cart_list = BuyService::CartList(['user'=>UserService::LoginUserInfo()]); // 基础数据 $base = [ diff --git a/application/plugins/commontopmaxpicture/Admin.php b/application/plugins/commontopmaxpicture/Admin.php index fd70b9eb6..59446be6e 100755 --- a/application/plugins/commontopmaxpicture/Admin.php +++ b/application/plugins/commontopmaxpicture/Admin.php @@ -79,7 +79,7 @@ class Admin extends Controller */ public function save($params = []) { - return PluginsService::PluginsDataSave(['plugins'=>'commontopmaxpicture', 'data'=>$params]); + return PluginsService::PluginsDataSave(['plugins'=>'commontopmaxpicture', 'data'=>$params], ['images']); } } ?> \ No newline at end of file diff --git a/application/plugins/commontopmaxpicture/Hook.php b/application/plugins/commontopmaxpicture/Hook.php index a3a08052a..f602c2cde 100755 --- a/application/plugins/commontopmaxpicture/Hook.php +++ b/application/plugins/commontopmaxpicture/Hook.php @@ -31,8 +31,8 @@ class Hook extends Controller */ public function run($params = []) { - // 是否控制器钩子 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + // 是否后端钩子 + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { return DataReturn('无需处理', 0); diff --git a/application/plugins/commontopnotice/Hook.php b/application/plugins/commontopnotice/Hook.php index c5f3b834e..6a9a3bec4 100755 --- a/application/plugins/commontopnotice/Hook.php +++ b/application/plugins/commontopnotice/Hook.php @@ -32,8 +32,8 @@ class Hook extends Controller */ public function run($params = []) { - // 是否控制器钩子 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + // 是否后端钩子 + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { return DataReturn('无需处理', 0); diff --git a/application/plugins/expressforkdn/Admin.php b/application/plugins/expressforkdn/Admin.php new file mode 100644 index 000000000..13791d3bd --- /dev/null +++ b/application/plugins/expressforkdn/Admin.php @@ -0,0 +1,64 @@ +assign('express_list', ExpressService::ExpressList()); + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/expressforkdn/admin/index'); + } else { + return $ret['msg']; + } + } + + /** + * 编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function saveinfo($params = []) + { + $ret = PluginsService::PluginsData('expressforkdn'); + if($ret['code'] == 0) + { + $this->assign('express_list', ExpressService::ExpressList()); + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/expressforkdn/admin/saveinfo'); + } else { + return $ret['msg']; + } + } + /** + * 数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function save($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'expressforkdn', 'data'=>$params]); + } +} +?> \ No newline at end of file diff --git a/application/plugins/expressforkdn/Hook.php b/application/plugins/expressforkdn/Hook.php new file mode 100644 index 000000000..6deebf954 --- /dev/null +++ b/application/plugins/expressforkdn/Hook.php @@ -0,0 +1,317 @@ +operation($params); + break; + + // 弹窗代码 + case 'plugins_view_common_bottom' : + case 'plugins_admin_view_common_bottom' : + $ret = $this->html($params); + break; + + // 页面底部 + case 'plugins_common_page_bottom' : + case 'plugins_admin_common_page_bottom' : + $ret = $this->js($params); + break; + + // header代码 + case 'plugins_common_header' : + case 'plugins_admin_common_header' : + $ret = $this->css($params); + break; + + default : + $ret = ''; + } + return $ret; + } + return ''; + } + + /** + * css + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function css($params = []) + { + return ''; + } + + /** + * js + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function js($params = []) + { + return ''; + } + + /** + * 视图 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function html($params = []) + { + // 获取应用数据 + $ret = PluginsService::PluginsData('expressforkdn', ['images']); + if($ret['code'] == 0) + { + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/expressforkdn/admin/content'); + } else { + return $ret['msg']; + } + } + + /** + * 操作 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function operation($params = []) + { + if(empty($params['order'])) + { + return DataReturn('订单为空', -1); + } + + // 钩子html + if(isset($params['order']['status']) && in_array($params['order']['status'], [3,4])) + { + + $params['order']['plugins_service_order_handle_operation_html'][] = ''; + } + + return DataReturn('处理成功', 0); + } + + /** + * 获取物流信息 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-12 + * @desc description + * @param [array] $params [输入参数] + * @return [type] [description] + */ + public function getexpinfo($params = []) + { + // html + $html = ''; + + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'express_id', + 'error_msg' => '快递id有误', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'express_number', + 'error_msg' => '快递单号有误', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1, '

'.$ret.'

'); + } + + // 获取配置数据 + $ret = PluginsService::PluginsData('expressforkdn'); + if($ret['code'] == 0) + { + // 是否配置物流代码 + if(empty($ret['data']['express_ids'][$params['express_id']])) + { + return DataReturn('请先再后台配置物流代码', -1, '

请先再后台配置物流代码

'); + } + + // 获取快递信息 + $data = $this->expresstraces(['shipper_code'=>$ret['data']['express_ids'][$params['express_id']],'logistic_code'=>$params['express_number'], 'config'=>$ret['data']]); + + // 状态列表 + $status_arr = [ + 0 => '暂无物流信息', + 1 => '快递公司已揽收', + 2 => '快递正在配送途中...', + 3 => '该物流已被签收', + 4 => '该物流问题件,请咨询物流商处理!', + ]; + if(!isset($data['State']) || !isset($status_arr[$data['State']])) + { + return DataReturn('查询失败', -1, '

查询失败

'); + } + + // 开始处理 + $html .='

'.$status_arr[$data['State']].'

'; + $html .= '
    '; + + // 快递信息 + if(in_array($data['State'], [2,3]) && !empty($data['Traces']) && is_array($data['Traces'])) + { + foreach($data['Traces'] as $k=>$v) + { + $html .='
  • '.$v['AcceptTime'].''.$v['AcceptStation'].'
  • '; + } + } + return DataReturn('处理成功', 0, $html); + } else { + return DataReturn($ret['msg'], -100); + } + } + + /** + * 获取物流信息 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-12 + * @desc description + * @param [array] $params [输入参数] + * @return [type] [description] + */ + public function expresstraces($params = []) + { + // 参数 + if(empty($params['shipper_code']) || empty($params['logistic_code']) || empty($params['config'])) + { + return ['State'=>0, 'Reason'=>'请求参数有误']; + } + + // 请求数据 + $url = 'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx'; + $request_data = json_encode([ + 'OrderCode' => '', + 'ShipperCode' => $params['shipper_code'], + 'LogisticCode' => $params['logistic_code'], + ]); + $data = array( + 'EBusinessID' => $params['config']['ebid'], + 'RequestType' => '1002', + 'RequestData' => urlencode($request_data) , + 'DataType' => '2', + ); + $data['DataSign'] = $this->encrypt($request_data, $params['config']['appkey']); + return $this->request_post($url, $data); + } + + /** + * post提交数据 + * @param string $url 请求Url + * @param array $data 提交的数据 + * @return url响应返回的html + */ + public function request_post($url, $data) + { + $temps = array(); + foreach ($data as $key => $value) { + $temps[] = sprintf('%s=%s', $key, $value); + } + $post_data = implode('&', $temps); + $url_info = parse_url($url); + if(empty($url_info['port'])) + { + $url_info['port']=80; + } + $httpheader = "POST " . $url_info['path'] . " HTTP/1.0\r\n"; + $httpheader.= "Host:" . $url_info['host'] . "\r\n"; + $httpheader.= "Content-Type:application/x-www-form-urlencoded\r\n"; + $httpheader.= "Content-Length:" . strlen($post_data) . "\r\n"; + $httpheader.= "Connection:close\r\n\r\n"; + $httpheader.= $post_data; + $fd = fsockopen($url_info['host'], $url_info['port']); + fwrite($fd, $httpheader); + $gets = ""; + $headerFlag = true; + while (!feof($fd)) { + if (($header = @fgets($fd)) && ($header == "\r\n" || $header == "\n")) { + break; + } + } + while (!feof($fd)) { + $gets.= fread($fd, 128); + } + fclose($fd); + + return json_decode($gets, true); + } + /** + * 电商Sign签名生成 + * @param data 内容 + * @param appkey Appkey + * @return DataSign签名 + */ + public function encrypt($data, $appkey) { + return urlencode(base64_encode(md5($data.$appkey))); + } +} +?> \ No newline at end of file diff --git a/application/plugins/expressforkdn/config.json b/application/plugins/expressforkdn/config.json new file mode 100644 index 000000000..531289217 --- /dev/null +++ b/application/plugins/expressforkdn/config.json @@ -0,0 +1,42 @@ +{ + "base":{ + "plugins":"expressforkdn", + "name":"快递鸟API接口", + "logo":"\/static\/upload\/images\/plugins_expressforkdn\/2019\/03\/11\/1552286675575734.png", + "author":"guoguo", + "author_url":"http:\/\/gadmin.cojz8.com", + "version":"1.0.0", + "desc":"集成快递鸟第三方后台查询接口", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":false + }, + "hook":{ + "plugins_view_common_bottom":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_admin_view_common_bottom":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_common_page_bottom":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_admin_common_page_bottom":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_common_header":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_admin_common_header":[ + "app\\plugins\\expressforkdn\\Hook" + ], + "plugins_service_order_handle_begin":[ + "app\\plugins\\expressforkdn\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/freightfee/Admin.php b/application/plugins/freightfee/Admin.php new file mode 100644 index 000000000..312216619 --- /dev/null +++ b/application/plugins/freightfee/Admin.php @@ -0,0 +1,133 @@ +assign('data', $this->DataHandle($ret['data'])); + return $this->fetch('../../../plugins/view/freightfee/admin/index'); + } else { + return $ret['msg']; + } + } + + /** + * 编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function saveinfo($params = []) + { + $ret = PluginsService::PluginsData('freightfee'); + if($ret['code'] == 0) + { + // 是否 + $is_whether_list = [ + 0 => array('id' => 0, 'name' => '按件数', 'checked' => true), + 1 => array('id' => 1, 'name' => '按重量'), + ]; + + // 地区 + $region = RegionService::RegionItems(['pid'=>0, 'field'=>'id,name']); + if(!empty($region)) + { + $region = array_map(function($v) + { + $v['items'] = RegionService::RegionItems(['pid'=>$v['id'], 'field'=>'id,name']); + return $v; + }, $region); + } + + // 支付方式 + $this->assign('payment_list', PaymentService::PaymentList(['is_enable'=>1, 'is_open_user'=>1])); + + $this->assign('region_list', $region); + $this->assign('is_whether_list', $is_whether_list); + $this->assign('data', $this->DataHandle($ret['data'])); + return $this->fetch('../../../plugins/view/freightfee/admin/saveinfo'); + } else { + return $ret['msg']; + } + } + + /** + * 数据处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-22 + * @desc description + * @param [array] $data [应用数据] + */ + private function DataHandle($data) + { + if(!empty($data['data'])) + { + if(empty($data['payment'])) + { + $data['payment'] = []; + $data['payment_names'] = ''; + } else { + $data['payment'] = explode(',', $data['payment']); + $data['payment_names'] = implode('、', array_map(function($v){return mb_substr($v, strrpos($v, '-')+1, null, 'utf-8');}, $data['payment'])); + } + + foreach($data['data'] as &$v) + { + $v['region_names'] = empty($v['region_show']) ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name')); + } + } + return $data; + } + + /** + * 数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function save($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'freightfee', 'data'=>$params]); + } +} +?> \ No newline at end of file diff --git a/application/plugins/freightfee/Hook.php b/application/plugins/freightfee/Hook.php new file mode 100644 index 000000000..b7506a163 --- /dev/null +++ b/application/plugins/freightfee/Hook.php @@ -0,0 +1,241 @@ +FreightFeeCalculate($params); + break; + + default : + $ret = ''; + } + return $ret; + } + } + + /** + * 运费计算 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $params [输入参数] + */ + public function FreightFeeCalculate($params = []) + { + $ret = PluginsService::PluginsData('freightfee'); + if($ret['code'] == 0) + { + // 默认运费 + $price = 0; + + // 支付方式免运费 + $is_payment = true; + if(!empty($ret['data']['payment']) && !empty($params['params']['payment_id'])) + { + $payment = array_map(function($v){return explode('-', $v);}, explode(',', $ret['data']['payment'])); + if(!empty($payment) && is_array($payment)) + { + foreach($payment as $v) + { + if(isset($v[0]) && $v[0] == $params['params']['payment_id']) + { + $is_payment = false; + break; + } + } + } + } + + // 是否设置运费数据 + if($is_payment === true && !empty($ret['data']['data'][0])) + { + // 规则 + $rules = $this->RulesHandle($ret['data']['data'], $params['data']['base']['address']); + + // 计费方式 + if(!empty($rules)) + { + switch($ret['data']['valuation']) + { + // 按件 + case 0 : + $price = $this->PieceCalculate($rules, $params['data']); + break; + + // 按量 + case 1 : + $price = $this->QuantityCalculate($rules, $params['data']); + break; + } + } + } + + // 扩展展示数据 + $show_name = empty($ret['data']['show_name']) ? '运费' : $ret['data']['show_name']; + $params['data']['extension_data'][] = [ + 'name' => $show_name, + 'price' => $price, + 'type' => 1, + 'tips' => '+¥'.$price.'元', + ]; + + // 金额 + $params['data']['base']['increase_price'] += $price; + $params['data']['base']['actual_price'] += $price; + + return DataReturn('无需处理', 0); + } else { + return $ret['msg']; + } + } + + /** + * 按重计费 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [规则] + * @param [array] $buy [生成订单数据] + */ + public function QuantityCalculate($rules, $buy) + { + $price = 0; + if($rules['first_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['first']) + { + $price = $rules['first_price']; + } + if($rules['continue_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['continue']+$rules['first']) + { + $number = ($buy['base']['spec_weight_total']-$rules['first'])/$rules['continue']; + if($number > 0) + { + $price += round($rules['continue_price']*$number); + } + } + + return $price; + } + + /** + * 按件计费 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [规则] + * @param [array] $buy [生成订单数据] + */ + public function PieceCalculate($rules, $buy) + { + $price = 0; + if($rules['first_price'] > 0 && $buy['base']['buy_count'] >= $rules['first']) + { + $price = $rules['first_price']; + } + if($rules['continue_price'] > 0 && $buy['base']['buy_count'] >= $rules['continue']+$rules['first']) + { + $number = round(($buy['base']['buy_count']-$rules['first'])/$rules['continue']); + if($number > 0) + { + $price += round($rules['continue_price']*$number); + } + } + + return $price; + } + + /** + * 运费规则匹配 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $rules [运费规则列表] + * @param [array] $address [用户地址] + */ + public function RulesHandle($rules, $address) + { + if(count($rules) > 1 && !empty($address)) + { + $data = [ + 'province' => ['rules' => [], 'number' => 0], + 'city' => ['rules' => [], 'number' => 0], + ]; + foreach($rules as $k=>$v) + { + if($k != 0) + { + $region = explode('-', $v['region']); + if(!empty($region)) + { + if(in_array($address['province'], $region)) + { + $data['province']['rules'] = $v; + $data['province']['number']++; + } + if(in_array($address['city'], $region)) + { + $data['city']['rules'] = $v; + $data['city']['number']++; + } + } + } + } + if($data['city']['number'] > 0) + { + if($data['province']['number'] > $data['city']['number']) + { + return $data['province']['rules']; + } + return $data['city']['rules']; + } else { + if($data['province']['number'] > 0) + { + return $data['province']['rules']; + } + } + } + return $rules[0]; + } +} +?> \ No newline at end of file diff --git a/application/plugins/freightfee/config.json b/application/plugins/freightfee/config.json new file mode 100644 index 000000000..45b0bfd3e --- /dev/null +++ b/application/plugins/freightfee/config.json @@ -0,0 +1,28 @@ +{ + "base":{ + "plugins":"freightfee", + "name":"运费设置", + "logo":"\/static\/upload\/images\/plugins_freightfee\/2019\/03\/18\/1552894366387964.jpg", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"快递运费设置", + "apply_terminal":[ + "pc", + "h5", + "app", + "alipay", + "weixin", + "baidu" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":false + }, + "hook":{ + "plugins_service_buy_handle":[ + "app\\plugins\\freightfee\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/newuserreduction/Admin.php b/application/plugins/newuserreduction/Admin.php new file mode 100644 index 000000000..53e0a1fbe --- /dev/null +++ b/application/plugins/newuserreduction/Admin.php @@ -0,0 +1,85 @@ +assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/newuserreduction/admin/index'); + } else { + return $ret['msg']; + } + } + + /** + * 编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function saveinfo($params = []) + { + $ret = PluginsService::PluginsData('newuserreduction'); + if($ret['code'] == 0) + { + // 是否 + $is_whether_list = [ + 0 => array('id' => 0, 'name' => '否', 'checked' => true), + 1 => array('id' => 1, 'name' => '是'), + ]; + + $this->assign('is_whether_list', $is_whether_list); + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/newuserreduction/admin/saveinfo'); + } else { + return $ret['msg']; + } + } + + /** + * 数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function save($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'newuserreduction', 'data'=>$params]); + } +} +?> \ No newline at end of file diff --git a/application/plugins/newuserreduction/Hook.php b/application/plugins/newuserreduction/Hook.php new file mode 100644 index 000000000..8d447b952 --- /dev/null +++ b/application/plugins/newuserreduction/Hook.php @@ -0,0 +1,153 @@ +ReductionCalculate($params); + break; + + default : + $ret = ''; + } + return $ret; + } + } + + /** + * 立减计算 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-21 + * @desc description + * @param [array] $params [输入参数] + */ + public function ReductionCalculate($params = []) + { + $ret = PluginsService::PluginsData('newuserreduction'); + if($ret['code'] == 0) + { + // 是否设置需满金额 + if(isset($ret['data']['full_amount']) && $ret['data']['full_amount'] > 0 && $params['data']['base']['total_price'] < $ret['data']['full_amount']) + { + return DataReturn('无需处理', 0); + } + + // 默认金额 + $price = isset($ret['data']['price']) ? (float) $ret['data']['price'] : 0; + $unit = '元'; + $price_show = $price; + if($price > 0 && $this->IsNewUser($params)) + { + // 是否随机 + if(isset($ret['data']['is_random']) && $ret['data']['is_random'] == 1) + { + // 随机金额需要提交步骤生效 + if(!isset($params['params']['is_order_submit']) || $params['params']['is_order_submit'] != 1) + { + $price = 0; + $price_show = '随机减'; + $unit = ''; + } else { + $price = $this->RandomFloat(0, $price); + $price_show = $price; + } + } + + // 扩展展示数据 + $show_name = empty($ret['data']['show_name']) ? '新用户立减' : $ret['data']['show_name']; + $params['data']['extension_data'][] = [ + 'name' => $show_name, + 'price' => $price, + 'type' => 0, + 'tips' => '-¥'.$price_show.$unit, + ]; + + // 金额 + $params['data']['base']['increase_price'] -= $price; + $params['data']['base']['actual_price'] -= $price; + } + return DataReturn('无需处理', 0); + } else { + return $ret['msg']; + } + } + + /** + * 是否满足新用户条件 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-25 + * @desc description + * @param [array] $params [输入参数] + */ + private function IsNewUser($params = []) + { + // 用户信息是否存在 + if(empty($params['params']['user'])) + { + return false; + } + + // 获取用户订单 + // 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) + $where = [ + ['user_id', '=', intval($params['params']['user']['id'])], + ['status', '<=', 4], + ]; + $temp = Db::name('Order')->where($where)->count(); + return empty($temp); + } + + /** + * 生成随机金额 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-25 + * @desc description + * @param [int] $min [最小值] + * @param [int] $max [最大值] + */ + private function RandomFloat($min = 0, $max = 10) + { + return sprintf("%.2f", $min+mt_rand()/mt_getrandmax()*($max-$min)); + } +} +?> \ No newline at end of file diff --git a/application/plugins/newuserreduction/config.json b/application/plugins/newuserreduction/config.json new file mode 100644 index 000000000..ebc2908e9 --- /dev/null +++ b/application/plugins/newuserreduction/config.json @@ -0,0 +1,28 @@ +{ + "base":{ + "plugins":"newuserreduction", + "name":"新用户立减", + "logo":"\/static\/upload\/images\/plugins_newuserreduction\/2019\/03\/25\/1553483752670109.jpg", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"新用户立减优惠", + "apply_terminal":[ + "pc", + "h5", + "app", + "alipay", + "weixin", + "baidu" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":false + }, + "hook":{ + "plugins_service_buy_handle":[ + "app\\plugins\\newuserreduction\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/touristbuy/Admin.php b/application/plugins/touristbuy/Admin.php new file mode 100644 index 000000000..240237ca5 --- /dev/null +++ b/application/plugins/touristbuy/Admin.php @@ -0,0 +1,85 @@ +assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/touristbuy/admin/index'); + } else { + return $ret['msg']; + } + } + + /** + * 编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function saveinfo($params = []) + { + $ret = PluginsService::PluginsData('touristbuy'); + if($ret['code'] == 0) + { + // 是否 + $is_whether_list = [ + 0 => array('id' => 0, 'name' => '否', 'checked' => true), + 1 => array('id' => 1, 'name' => '是'), + ]; + + $this->assign('is_whether_list', $is_whether_list); + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/touristbuy/admin/saveinfo'); + } else { + return $ret['msg']; + } + } + + /** + * 数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function save($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'touristbuy', 'data'=>$params]); + } +} +?> \ No newline at end of file diff --git a/application/plugins/touristbuy/Hook.php b/application/plugins/touristbuy/Hook.php new file mode 100644 index 000000000..71dfc90be --- /dev/null +++ b/application/plugins/touristbuy/Hook.php @@ -0,0 +1,198 @@ +LoginNavTopHtml($params); + break; + + // 用户登录页面顶部 + case 'plugins_view_user_login_info_top' : + case 'plugins_view_user_sms_reg_info' : + case 'plugins_view_user_email_reg_info' : + $ret = $this->UserLoginInfoHtml($params); + break; + + // header代码 + case 'plugins_common_header' : + $ret = $this->Style($params); + break; + + // 导航链接 + case 'plugins_service_navigation_header_handle' : + $ret = $this->NavTitle($params); + break; + + // 系统运行开始 + case 'plugins_service_system_begin' : + $ret = $this->SystemBegin($params); + break; + + default : + $ret = DataReturn('无需处理', 0); + } + return $ret; + + // 默认返回视图 + } else { + return ''; + } + } + + /** + * 系统运行开始 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-18 + * @desc description + * @param [array] $params [输入参数] + */ + public function SystemBegin($params = []) + { + // 是否开启默认游客 + $ret = PluginsService::PluginsData('touristbuy'); + if($ret['code'] == 0 && isset($ret['data']['is_default_tourist']) && $ret['data']['is_default_tourist'] == 1 && strtolower(request()->module()) == 'index') + { + return Service::TouristReg(); + } + return DataReturn('无需处理', 0); + } + + /** + * css + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function NavTitle($params = []) + { + if(!empty($params['header']) && is_array($params['header'])) + { + // 获取应用数据 + $ret = PluginsService::PluginsData('touristbuy'); + if($ret['code'] == 0 && !empty($ret['data']['application_name'])) + { + $params['header'][] = [ + 'id' => 0, + 'pid' => 0, + 'name' => $ret['data']['application_name'], + 'url' => PluginsHomeUrl('touristbuy', 'index', 'index'), + 'data_type' => 'custom', + 'is_show' => 1, + 'is_new_window_open' => 0, + 'items' => [], + ]; + } + } + } + + /** + * css + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-06T16:16:34+0800 + * @param [array] $params [输入参数] + */ + public function Style($params = []) + { + return ''; + } + + /** + * 前端顶部小导航展示登入 + * @author Guoguo + * @blog http://gadmin.cojz8.com + * @version 1.0.0 + * @datetime 2019年3月14日 + * @param [array] $params [输入参数] + */ + public function UserLoginInfoHtml($params = []) + { + // 获取已登录用户信息,已登录则不展示入口 + $user = UserService::LoginUserInfo(); + if(empty($user)) + { + // 当前模块/控制器/方法 + $module_name = strtolower(request()->module()); + $controller_name = strtolower(request()->controller()); + $action_name = strtolower(request()->action()); + + // 当前窗口登录父级 + $is_parent = ($module_name.$controller_name.$action_name == 'indexusermodallogininfo') ? 1 : 0; + + // 获取应用数据 + $ret = PluginsService::PluginsData('touristbuy'); + $login_name = empty($ret['data']['login_name']) ? '游客登录' : $ret['data']['login_name']; + return ''; + } + return ''; + } + + /** + * 前端顶部小导航展示登入 + * @author Guoguo + * @blog http://gadmin.cojz8.com + * @version 1.0.0 + * @datetime 2019年3月14日 + * @param [array] $params [输入参数] + */ + public function LoginNavTopHtml($params = []) + { + // 获取已登录用户信息,已登录则不展示入口 + $user = UserService::LoginUserInfo(); + if(empty($user)) + { + // 获取应用数据 + $ret = PluginsService::PluginsData('touristbuy'); + $login_name = empty($ret['data']['login_name']) ? '游客登录' : $ret['data']['login_name']; + return ''.$login_name.''; + } + return ''; + } +} +?> \ No newline at end of file diff --git a/application/plugins/touristbuy/Index.php b/application/plugins/touristbuy/Index.php new file mode 100644 index 000000000..ae77a767b --- /dev/null +++ b/application/plugins/touristbuy/Index.php @@ -0,0 +1,139 @@ +assign('data', $ret['data']); + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('订单查询', 1)); + return $this->fetch('../../../plugins/view/touristbuy/index/index'); + } else { + return $ret['msg']; + } + } + + /** + * 订单详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-03-15T23:51:50+0800 + * @param [array] $params [输入参数] + */ + public function detail($params = []) + { + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'order_no', + 'error_msg' => '请输入订单号', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'name', + 'error_msg' => '请输入收件人姓名', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'tel', + 'error_msg' => '请输入收件人电话', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + $this->assign('msg', $ret); + return $this->fetch('public/tips_error'); + } + + // 参数 + $params['user_type'] = 'user'; + + // 条件 + $where = OrderService::OrderListWhere($params); + $where[] = ['order_no', '=', $params['order_no']]; + $where[] = ['receive_name', '=', $params['name']]; + $where[] = ['receive_tel', '=', $params['tel']]; + + // 获取列表 + $data_params = array( + 'm' => 0, + 'n' => 1, + 'where' => $where, + ); + $data = OrderService::OrderList($data_params); + if(!empty($data['data'][0])) + { + $this->assign('data', $data['data'][0]); + $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('订单详情', 1)); + + // 参数 + $this->assign('params', $params); + return $this->fetch('../../../plugins/view/touristbuy/index/detail'); + } else { + $this->assign('msg', '没有相关数据'); + return $this->fetch('public/tips_error'); + } + } + + /** + * 游客登录 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-03-15T22:31:29+0800 + * @param [array] $params [输入参数] + */ + public function login($params = []) + { + $ret = Service::TouristReg(); + if($ret['code'] == 0) + { + if(isset($params['is_parent']) && $params['is_parent'] == 1) + { + return ''; + } else { + return $this->redirect(__MY_URL__); + } + } else { + $this->assign('msg', $ret['msg']); + return $this->fetch('public/error'); + } + } +} +?> \ No newline at end of file diff --git a/application/plugins/touristbuy/Service.php b/application/plugins/touristbuy/Service.php new file mode 100644 index 000000000..1a9997950 --- /dev/null +++ b/application/plugins/touristbuy/Service.php @@ -0,0 +1,94 @@ + $nickname, + 'nickname' => $nickname, + 'upd_time' => time(), + ]; + if(Db::name('User')->where(['id'=>$tourist_user_id])->update($upd_data)) + { + // 用户登录session纪录 + if(UserService::UserLoginRecord($tourist_user_id)) + { + return DataReturn($nickname.'登录成功', 0); + } + } + session('tourist_user_id', null); + } + + // 游客数据 + $data = [ + 'username' => $nickname, + 'nickname' => $nickname, + 'status' => 0, + 'add_time' => time(), + 'upd_time' => time(), + ]; + + // 数据添加 + $user_id = Db::name('User')->insertGetId($data); + if($user_id > 0) + { + // 单独存储用户id + session('tourist_user_id', $user_id); + + // 用户登录session纪录 + if(UserService::UserLoginRecord($user_id)) + { + return DataReturn($nickname.'登录成功', 0); + } + } + return DataReturn($nickname.'登录失败', -100); + } +} +?> \ No newline at end of file diff --git a/application/plugins/touristbuy/config.json b/application/plugins/touristbuy/config.json new file mode 100644 index 000000000..c61090e48 --- /dev/null +++ b/application/plugins/touristbuy/config.json @@ -0,0 +1,42 @@ +{ + "base":{ + "plugins":"touristbuy", + "name":"游客购买", + "logo":"\/static\/upload\/images\/plugins_touristbuy\/2019\/03\/15\/1552656656517586.jpg", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"无需登录实现游客购物,在线支付,订单查询", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":true + }, + "hook":{ + "plugins_service_system_begin":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_common_header":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_view_header_navigation_top_left":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_view_user_login_info_top":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_view_user_sms_reg_info":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_view_user_email_reg_info":[ + "app\\plugins\\touristbuy\\Hook" + ], + "plugins_service_navigation_header_handle":[ + "app\\plugins\\touristbuy\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/usercentertopnotice/Hook.php b/application/plugins/usercentertopnotice/Hook.php index a23a50867..535a9f3a6 100755 --- a/application/plugins/usercentertopnotice/Hook.php +++ b/application/plugins/usercentertopnotice/Hook.php @@ -32,8 +32,8 @@ class Hook extends Controller */ public function run($params = []) { - // 是否控制器钩子 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + // 是否后端钩子 + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { return DataReturn('无需处理', 0); diff --git a/application/plugins/userloginrewardintegral/Hook.php b/application/plugins/userloginrewardintegral/Hook.php index 0394faa75..4b3958c70 100755 --- a/application/plugins/userloginrewardintegral/Hook.php +++ b/application/plugins/userloginrewardintegral/Hook.php @@ -34,15 +34,15 @@ class Hook */ public function run($params = []) { - // 是否控制器钩子 - if(isset($params['is_control']) && $params['is_control'] === true && !empty($params['hook_name'])) + // 是否后端钩子 + if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name'])) { if(!empty($params['user_id'])) { switch($params['hook_name']) { // 用户登录成功后赠送积分 - case 'plugins_control_user_login_end' : + case 'plugins_service_user_login_end' : $ret = $this->LoginGiveIntegral($params); break; diff --git a/application/plugins/userloginrewardintegral/config.json b/application/plugins/userloginrewardintegral/config.json index 42ba38693..cfa30ca39 100755 --- a/application/plugins/userloginrewardintegral/config.json +++ b/application/plugins/userloginrewardintegral/config.json @@ -17,7 +17,7 @@ "is_home":false }, "hook":{ - "plugins_control_user_login_end":[ + "plugins_service_user_login_end":[ "app\\plugins\\userloginrewardintegral\\Hook" ] } diff --git a/application/plugins/usernotloginhidegoodsprice/Admin.php b/application/plugins/usernotloginhidegoodsprice/Admin.php new file mode 100755 index 000000000..04490d04c --- /dev/null +++ b/application/plugins/usernotloginhidegoodsprice/Admin.php @@ -0,0 +1,96 @@ +assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/usernotloginhidegoodsprice/admin/index'); + } else { + return $ret['msg']; + } + } + + /** + * 编辑页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function saveinfo($params = []) + { + $ret = PluginsService::PluginsData('usernotloginhidegoodsprice'); + if($ret['code'] == 0) + { + // 限制终端 + $ret['data']['limit_terminal'] = empty($ret['data']['limit_terminal']) ? [] : explode(',', $ret['data']['limit_terminal']); + + $this->assign('data', $ret['data']); + return $this->fetch('../../../plugins/view/usernotloginhidegoodsprice/admin/saveinfo'); + } else { + return $ret['msg']; + } + } + + /** + * 数据保存 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-07T08:21:54+0800 + * @param [array] $params [输入参数] + */ + public function save($params = []) + { + return PluginsService::PluginsDataSave(['plugins'=>'usernotloginhidegoodsprice', 'data'=>$params]); + } +} +?> \ No newline at end of file diff --git a/application/plugins/usernotloginhidegoodsprice/Hook.php b/application/plugins/usernotloginhidegoodsprice/Hook.php new file mode 100755 index 000000000..5ec927fd6 --- /dev/null +++ b/application/plugins/usernotloginhidegoodsprice/Hook.php @@ -0,0 +1,151 @@ +PriceHandle($params); + + // 默认返回视图 + } else { + return ''; + } + } + + /** + * 价格处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-02-14T22:19:08+0800 + * @param [array] $params [参数] + */ + private function PriceHandle($params) + { + // 后端访问不处理 + if(isset($params['params']['is_admin_access']) && $params['params']['is_admin_access'] == 1) + { + return DataReturn('无需处理', 0); + } + + // 用户是否已登录 + $user = UserService::LoginUserInfo(); + if(!empty($user)) + { + // 查询用户状态是否正常 + $ret = UserService::UserStatusCheck('id', $user['id']); + if($ret['code'] == 0) + { + return DataReturn('无需处理', 0); + } + } + + // 获取应用数据 + $ret = PluginsService::PluginsData('usernotloginhidegoodsprice'); + if($ret['code'] == 0) + { + // 限制终端 + if(!empty($ret['data']['limit_terminal'])) + { + $limit_terminal_all = explode(',', $ret['data']['limit_terminal']); + $client_type = APPLICATION_CLIENT_TYPE; + if($client_type == 'pc' && IsMobile()) + { + $client_type = 'h5'; + } + if(!in_array($client_type, $limit_terminal_all)) + { + return DataReturn('无需处理', 0); + } + } + + // 原价 + $original_price_placeholder = isset($ret['data']['original_price_placeholder']) ? $ret['data']['original_price_placeholder'] : ''; + + // 销售价 + $price_placeholder = empty($ret['data']['price_placeholder']) ? '登录可见' : $ret['data']['price_placeholder']; + + switch($params['hook_name']) + { + // 商品数据处理后 + case 'plugins_service_goods_handle_end' : + // 商品原价 + if(isset($params['goods']['original_price'])) + { + $params['goods']['original_price'] = $original_price_placeholder; + } + if(isset($params['goods']['min_original_price'])) + { + $params['goods']['min_original_price'] = $original_price_placeholder; + } + if(isset($params['goods']['max_original_price'])) + { + $params['goods']['max_original_price'] = $original_price_placeholder; + } + + // 销售价 + if(isset($params['goods']['price'])) + { + $params['goods']['price'] = $price_placeholder; + } + if(isset($params['goods']['min_price'])) + { + $params['goods']['min_price'] = $price_placeholder; + } + if(isset($params['goods']['max_price'])) + { + $params['goods']['max_price'] = $price_placeholder; + } + break; + + // 商品规格基础数据 + case 'plugins_service_goods_spec_base' : + if(isset($params['spec_base']['original_price'])) + { + $params['spec_base']['original_price'] = $original_price_placeholder; + } + if(isset($params['spec_base']['price'])) + { + $params['spec_base']['price'] = $price_placeholder; + } + break; + + // 默认 + default : + return DataReturn('无需处理', 0); + } + + return DataReturn('处理成功', 0); + } else { + return $ret; + } + } +} +?> \ No newline at end of file diff --git a/application/plugins/usernotloginhidegoodsprice/config.json b/application/plugins/usernotloginhidegoodsprice/config.json new file mode 100755 index 000000000..6ea5de002 --- /dev/null +++ b/application/plugins/usernotloginhidegoodsprice/config.json @@ -0,0 +1,31 @@ +{ + "base":{ + "plugins":"usernotloginhidegoodsprice", + "name":"未登录隐藏商品价格", + "logo":"\/static\/upload\/images\/plugins_usernotloginhidegoodsprice\/2019\/02\/26\/1551184745400164.png", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"用户未登录不展示商品价格", + "apply_terminal":[ + "pc", + "h5", + "app", + "alipay", + "weixin", + "baidu" + ], + "apply_version":[ + "1.4.0" + ], + "is_home":false + }, + "hook":{ + "plugins_service_goods_handle_end":[ + "app\\plugins\\usernotloginhidegoodsprice\\Hook" + ], + "plugins_service_goods_spec_base":[ + "app\\plugins\\usernotloginhidegoodsprice\\Hook" + ] + } +} \ No newline at end of file diff --git a/application/plugins/view/answers/admin/baseinfo.html b/application/plugins/view/answers/admin/baseinfo.html new file mode 100755 index 000000000..31bc4d738 --- /dev/null +++ b/application/plugins/view/answers/admin/baseinfo.html @@ -0,0 +1,147 @@ +{{include file="public/header" /}} + + +
    +
    + +
    + + 问答系统 + 返回 + + +
    + + +
    + +
    + +
      + {{if !empty($data['images_old'])}} +
    • + + + × +
    • + {{/if}} +
    +
    +上传图片
    +
    +
    + + +
    +
    + +
    + {{foreach $is_whether_list as $v}} + + {{/foreach}} +
    +
    + +
    + +
      + {{if !empty($data['images_bottom_old'])}} +
    • + + + × +
    • + {{/if}} +
    +
    +上传图片
    +
    +
    + + +
    +
    + +
    + {{foreach $is_whether_list as $v}} + + {{/foreach}} +
    +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + +
    +
    + + +
    +
    + +
    +
    可选
    +
      +
      没有相关数据
      +
    +
    + +
    +
    已选
    +
      +
      没有相关数据
      + {{if !empty($answers_rc_list)}} + {{foreach $answers_rc_list as $v}} +
    • + {{$v.title}} + +
    • + {{/foreach}} + {{/if}} +
    +
    +
    +
    + +
    + +
    + + +
    +
    + + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/admin/goodsinfo.html b/application/plugins/view/answers/admin/goodsinfo.html new file mode 100644 index 000000000..2625b64a6 --- /dev/null +++ b/application/plugins/view/answers/admin/goodsinfo.html @@ -0,0 +1,82 @@ +{{include file="public/header" /}} + + +
    +
    + + + {{if empty($data['id'])}} + 商品添加 + {{else /}} + 商品编辑 + {{/if}} + + 返回 + + +
    + +
    +
    +
    + + + +
    +
    + +
    +
    可选
    +
      +
      没有相关数据
      +
    +
    + +
    +
    已选
    +
      +
      没有相关数据
      + {{if !empty($goods['goods'])}} + {{foreach $goods['goods'] as $v}} +
    • + {{$v.title}} + +
    • + {{/foreach}} + {{/if}} +
    +
    +
    +
    + +
    + + +
    + + +
    +
    +
    + + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/admin/index.html b/application/plugins/view/answers/admin/index.html new file mode 100644 index 000000000..951a025cc --- /dev/null +++ b/application/plugins/view/answers/admin/index.html @@ -0,0 +1,178 @@ +{{include file="public/header" /}} + + +
    +
    + + 问答系统 + 返回 + + +
    + +
    +
    + 基础数据 + 编辑 +
    +
    +
    + +
    + {{if empty($data['application_name'])}} + 未设置应用导航名称 + {{else /}} + {{$data.application_name}} + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['right_top_rec_name'])}} + 推荐问答 + {{else /}} + {{$data.right_top_rec_name}} + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['middle_new_name'])}} + 最新问答 + {{else /}} + {{$data.middle_new_name}} + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['right_top_goods_name'])}} + 推荐商品 + {{else /}} + {{$data.right_top_goods_name}} + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['middle_new_page_number'])}} + 默认 15 条 + {{else /}} + {{$data.middle_new_page_number}} 条 + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['search_page_number'])}} + 默认 28 条 + {{else /}} + {{$data.search_page_number}} 条 + {{/if}} +
    +
    + +
    + +
    + {{if empty($data['home_new_goods_number'])}} + 不展示 + {{else /}} + {{$data.home_new_goods_number}} 条 + {{/if}} +
    +
    + +
    + +
    + + + +
    +
    + +
    + +
    + + + +
    +
    +
    +
    + + +
    +
    + 幻灯片 + 编辑 +
    +
    + {{if !empty($slider)}} +
    + +
    + {{else /}} + 没有幻灯片 + {{/if}} +
    +
    + + +
    +
    + 右侧商品 + 编辑 +
    +
    + {{if !empty($goods_list)}} + + {{else /}} + 没有商品数据 + {{/if}} +
    +
    +
    +
    +
    + + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/admin/slider.html b/application/plugins/view/answers/admin/slider.html new file mode 100644 index 000000000..382002e0e --- /dev/null +++ b/application/plugins/view/answers/admin/slider.html @@ -0,0 +1,70 @@ +{{include file="public/header" /}} + + +
    +
    + + 问答系统 + 返回 + + +
    + +
    + 新增 +
    + + + +
+ + + + + + + + + + + + {{if !empty($data_list)}} + {{foreach $data_list as $v}} + + + + + + + + + {{/foreach}} + {{else /}} + + {{/if}} + +
名称图片url地址是否启用创建时间操作
{{$v.name}} + {{if !empty($v['images_url'])}} + + + + {{else /}} + 暂无图片 + {{/if}} + {{$v.url}} + + {{$v.add_time_time}} + + + + +
没有相关数据
+ +
+
+
+ + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/admin/sliderinfo.html b/application/plugins/view/answers/admin/sliderinfo.html new file mode 100644 index 000000000..ffd6e6802 --- /dev/null +++ b/application/plugins/view/answers/admin/sliderinfo.html @@ -0,0 +1,64 @@ +{{include file="public/header" /}} + + +
+
+ + + {{if empty($data['id'])}} + 幻灯片添加 + {{else /}} + 幻灯片编辑 + {{/if}} + + 返回 + + +
+ +
+
+ + +
+ +
+ + +
+ +
+ +
    +
  • + + +
  • +
+
+上传图片
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+
+
+ + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/index/detail.html b/application/plugins/view/answers/index/detail.html new file mode 100644 index 000000000..38a9c9a13 --- /dev/null +++ b/application/plugins/view/answers/index/detail.html @@ -0,0 +1,134 @@ +{{include file="public/header" /}} + + +{{include file="public/header_top_nav" /}} + + +{{include file="public/nav_search" /}} + + +{{include file="public/header_nav" /}} + + +{{include file="public/goods_category" /}} + + +
+ +
+ {{if isset($plugins_answers_detail['code']) and $plugins_answers_detail['code'] eq 0}} + {{if !empty($plugins_answers_detail['data']['content'])}} +
+ {{if !empty($plugins_answers_detail['data']['title'])}} +

主题:{{$plugins_answers_detail.data.title}}

+ {{/if}} +

阅读数:{{$plugins_answers_detail.data.access_count}}

+
+
{{$plugins_answers_detail.data.content}}
+ +
+ {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} +
+ 管理员已回答 +

{{$plugins_answers_detail.data.reply}}

+
+ + {{else /}} +
+ 管理员待回复 +
+ {{/if}} +
+ {{else /}} +
没有相关数据
+ {{/if}} + {{else /}} +
{{$plugins_answers_detail.msg}}
+ {{/if}} +
+ + +
+ + {{include file="../../../plugins/view/answers/index/operation" /}} + + +
+
+

+ {{if empty($plugins_answers_data['right_top_rec_name'])}} + 推荐问答 + {{else /}} + {{$plugins_answers_data.right_top_rec_name}} + {{/if}} +

+ 更多 » +
+
+ {{if !empty($plugins_answers_rc_list)}} + + {{/if}} +
+
+ + +
+
+

+ {{if empty($plugins_answers_data['right_top_goods_name'])}} + 推荐商品 + {{else /}} + {{$plugins_answers_data.right_top_goods_name}} + {{/if}} +

+ 更多 » +
+ {{if !empty($plugins_answers_goods_list)}} + + {{/if}} +
+
+ + + {{include file="../../../plugins/view/answers/index/popup" /}} +
+ + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/index/index.html b/application/plugins/view/answers/index/index.html new file mode 100644 index 000000000..3a613090b --- /dev/null +++ b/application/plugins/view/answers/index/index.html @@ -0,0 +1,202 @@ +{{include file="public/header" /}} + + +{{include file="public/header_top_nav" /}} + + +{{include file="public/nav_search" /}} + + +{{include file="public/header_nav" /}} + + +{{include file="public/goods_category" /}} + + +
+
+ +
+ {{if !empty($plugins_answers_slider)}} +
+ +
+ {{/if}} +
+ + +
+ + {{include file="../../../plugins/view/answers/index/operation" /}} + + +
+
+

+ {{if empty($plugins_answers_data['right_top_rec_name'])}} + 推荐问答 + {{else /}} + {{$plugins_answers_data.right_top_rec_name}} + {{/if}} +

+ 更多 » +
+
+ {{if !empty($plugins_answers_rc_list)}} + + {{/if}} +
+
+
+
+ + + {{if !empty($plugins_answers_data['images'])}} +
+ + + +
+ {{/if}} + +
+ +
+
+
+

+ {{if empty($plugins_answers_data['middle_new_name'])}} + 最新问答 + {{else /}} + {{$plugins_answers_data.middle_new_name}} + {{/if}} +

+ 更多 » +
+
+ {{if !empty($plugins_answers_middle_answer_list)}} + + + {{else /}} +
没有相关数据
+ {{/if}} +
+
+
+ + +
+
+

+ {{if empty($plugins_answers_data['right_top_goods_name'])}} + 推荐商品 + {{else /}} + {{$plugins_answers_data.right_top_goods_name}} + {{/if}} +

+ 更多 » +
+ {{if !empty($plugins_answers_goods_list)}} + + {{/if}} +
+
+ + + {{if !empty($plugins_answers_data['images_bottom'])}} +
+ + + +
+ {{/if}} + + + {{if !empty($plugins_new_goods_list)}} +
+
+

最新商品

+ 更多 » +
+ +
+ {{/if}} + + + {{include file="../../../plugins/view/answers/index/popup" /}} +
+ + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/answers/index/operation.html b/application/plugins/view/answers/index/operation.html new file mode 100644 index 000000000..4c97b5289 --- /dev/null +++ b/application/plugins/view/answers/index/operation.html @@ -0,0 +1,17 @@ + + + + +
+ +
\ No newline at end of file diff --git a/application/plugins/view/answers/index/popup.html b/application/plugins/view/answers/index/popup.html new file mode 100644 index 000000000..30ecf677b --- /dev/null +++ b/application/plugins/view/answers/index/popup.html @@ -0,0 +1,31 @@ +
+
+
+

提问

+ × +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
\ No newline at end of file diff --git a/application/plugins/view/answers/index/search.html b/application/plugins/view/answers/index/search.html new file mode 100644 index 000000000..8f067a399 --- /dev/null +++ b/application/plugins/view/answers/index/search.html @@ -0,0 +1,125 @@ +{{include file="public/header" /}} + + +{{include file="public/header_top_nav" /}} + + +{{include file="public/nav_search" /}} + + +{{include file="public/header_nav" /}} + + +{{include file="public/goods_category" /}} + + + + + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/plugins/view/commongobacktop/admin/index.html b/application/plugins/view/commongobacktop/admin/index.html index bf1462ea9..d359840e8 100755 --- a/application/plugins/view/commongobacktop/admin/index.html +++ b/application/plugins/view/commongobacktop/admin/index.html @@ -12,7 +12,7 @@
- +
diff --git a/application/plugins/view/commongobacktop/admin/saveinfo.html b/application/plugins/view/commongobacktop/admin/saveinfo.html index 7d32eedce..aff6f342d 100755 --- a/application/plugins/view/commongobacktop/admin/saveinfo.html +++ b/application/plugins/view/commongobacktop/admin/saveinfo.html @@ -11,7 +11,7 @@
- +
  • @@ -22,7 +22,7 @@
- +
{{foreach $is_whether_list as $v}}
-
+
diff --git a/application/plugins/view/commononlineservice/admin/saveinfo.html b/application/plugins/view/commononlineservice/admin/saveinfo.html index efd37533f..d1cfc302b 100755 --- a/application/plugins/view/commononlineservice/admin/saveinfo.html +++ b/application/plugins/view/commononlineservice/admin/saveinfo.html @@ -16,7 +16,7 @@
- +
@@ -26,7 +26,7 @@
- +
{{foreach $is_whether_list as $v}}