From 77e21a40fd859cc661565156ffc0b6ea367af54f Mon Sep 17 00:00:00 2001 From: devil_gong Date: Wed, 13 Mar 2019 15:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=94=E7=B3=BB=E7=BB=9F=E4=BC=98?= =?UTF-8?q?=E5=8C=96+=E5=90=8E=E5=8F=B0=E6=95=B0=E6=8D=AE=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Admin.php | 8 +- application/admin/controller/Apphomenav.php | 6 +- application/admin/controller/Article.php | 6 +- application/admin/controller/Brand.php | 6 +- application/admin/controller/Customview.php | 6 +- application/admin/controller/Goods.php | 4 +- application/admin/controller/Power.php | 10 +- application/admin/controller/Slide.php | 6 +- application/admin/controller/User.php | 13 +- .../admin/view/default/answer/index.html | 2 + .../admin/view/default/sqlconsole/index.html | 2 +- application/plugins/answers/Admin.php | 6 +- application/plugins/answers/Index.php | 18 ++- application/plugins/answers/Service.php | 4 +- .../plugins/view/answers/admin/baseinfo.html | 48 ++++++- .../plugins/view/answers/admin/index.html | 31 +++++ .../plugins/view/answers/index/detail.html | 38 ++++-- .../plugins/view/answers/index/index.html | 126 ++++++++++++------ .../plugins/view/answers/index/search.html | 10 +- application/service/AnswerService.php | 18 +++ application/service/GoodsService.php | 2 +- public/static/plugins/css/answers/admin.css | 2 +- public/static/plugins/css/answers/index.css | 64 +++++++-- .../2019/03/13/1552463137211834.png | Bin 0 -> 48751 bytes 24 files changed, 330 insertions(+), 106 deletions(-) create mode 100644 public/static/upload/images/plugins_answers/2019/03/13/1552463137211834.png diff --git a/application/admin/controller/Admin.php b/application/admin/controller/Admin.php index f120f66ba..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 = [ 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/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 bbbc69978..803bafcf3 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -107,6 +107,7 @@ class Goods extends Common $params = input(); // 商品信息 + $data = []; if(!empty($params['id'])) { $data_params = [ @@ -122,12 +123,13 @@ class Goods extends Common { return $this->error('商品信息不存在', MyUrl('admin/goods/index')); } - $this->assign('data', $ret['data'][0]); + $data = $ret['data'][0]; // 获取商品编辑规格 $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/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/User.php b/application/admin/controller/User.php index d7d5f1a5b..f44fd2054 100755 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -131,6 +131,7 @@ class User extends Common $params = input(); // 用户编辑 + $data = []; if(!empty($params['id'])) { $data_params = [ @@ -138,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/view/default/answer/index.html b/application/admin/view/default/answer/index.html index 1f9c9e5d7..061e06020 100755 --- a/application/admin/view/default/answer/index.html +++ b/application/admin/view/default/answer/index.html @@ -48,6 +48,7 @@ 标题 内容 回复内容 + 访问次数 回复时间 创建时间 是否显示 @@ -98,6 +99,7 @@ 未回复 {{/if}} + {{$v.access_count}} {{$v.reply_time}} {{$v.add_time}} diff --git a/application/admin/view/default/sqlconsole/index.html b/application/admin/view/default/sqlconsole/index.html index 0140673bb..3762390e9 100755 --- a/application/admin/view/default/sqlconsole/index.html +++ b/application/admin/view/default/sqlconsole/index.html @@ -11,7 +11,7 @@
- +
diff --git a/application/plugins/answers/Admin.php b/application/plugins/answers/Admin.php index 35650b243..7e222072c 100644 --- a/application/plugins/answers/Admin.php +++ b/application/plugins/answers/Admin.php @@ -35,7 +35,7 @@ class Admin extends Controller public function index($params = []) { // 基础数据 - $base = PluginsService::PluginsData('answers', ['images']); + $base = PluginsService::PluginsData('answers', ['images', 'images_bottom']); $this->assign('data', isset($base['data']) ? $base['data'] : []); // 幻灯片 @@ -62,7 +62,7 @@ class Admin extends Controller */ public function baseinfo($params = []) { - $ret = PluginsService::PluginsData('answers', ['images']); + $ret = PluginsService::PluginsData('answers', ['images', 'images_bottom']); if($ret['code'] == 0) { // 是否 @@ -99,7 +99,7 @@ class Admin extends Controller */ public function basesave($params = []) { - return PluginsService::PluginsDataSave(['plugins'=>'answers', 'data'=>$params], ['images']); + return PluginsService::PluginsDataSave(['plugins'=>'answers', 'data'=>$params], ['images', 'images_bottom']); } /** diff --git a/application/plugins/answers/Index.php b/application/plugins/answers/Index.php index 9d8a49a56..dfd9785b9 100644 --- a/application/plugins/answers/Index.php +++ b/application/plugins/answers/Index.php @@ -15,6 +15,7 @@ use app\service\PluginsService; use app\service\AnswerService; use app\service\UserService; use app\service\SeoService; +use app\service\GoodsService; use app\plugins\answers\Service; /** @@ -66,6 +67,13 @@ class Index extends Controller $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)); @@ -105,6 +113,12 @@ class Index extends Controller $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'])) { @@ -152,7 +166,7 @@ class Index extends Controller // 获取搜索数据 // 分页 - $number = 10; + $number = isset($base['data']['search_page_number']) ? intval($base['data']['search_page_number']) : 28; // 条件 $keywords_arr = empty($params['answers_keywords']) ? [] : ['keywords'=>$params['answers_keywords']]; @@ -177,7 +191,7 @@ class Index extends Controller 'm' => $page->GetPageStarNumber(), 'n' => $number, 'where' => $where, - 'field' => 'id,title,content,add_time', + 'field' => 'id,title,content,add_time,is_reply', ); $data = AnswerService::AnswerList($data_params); $this->assign('plugins_answers_data_list', $data['data']); diff --git a/application/plugins/answers/Service.php b/application/plugins/answers/Service.php index 10adc5cbe..4c8bd7f5e 100644 --- a/application/plugins/answers/Service.php +++ b/application/plugins/answers/Service.php @@ -302,7 +302,7 @@ class Service ]; // 指定字段 - $field = 'g.id,g.title,g.images'; + $field = 'g.id,g.title,g.images,g.min_price'; // 获取数据 $ret = GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]); @@ -387,7 +387,7 @@ class Service ]; // 字段 - $field = 'title,content,reply,is_reply,reply_time,add_time'; + $field = 'id,name,title,content,reply,is_reply,access_count,reply_time,add_time'; // 获取列表 $data_params = array( diff --git a/application/plugins/view/answers/admin/baseinfo.html b/application/plugins/view/answers/admin/baseinfo.html index 308e06056..31bc4d738 100755 --- a/application/plugins/view/answers/admin/baseinfo.html +++ b/application/plugins/view/answers/admin/baseinfo.html @@ -20,7 +20,7 @@
    {{if !empty($data['images_old'])}}
  • - + ×
  • @@ -28,14 +28,12 @@
+上传图片
-
- +
-
- +
{{foreach $is_whether_list as $v}}
+
+ +
    + {{if !empty($data['images_bottom_old'])}} +
  • + + + × +
  • + {{/if}} +
+
+上传图片
+
+
+ + +
+
+ +
+ {{foreach $is_whether_list as $v}} + + {{/foreach}} +
+
+
@@ -62,7 +88,17 @@
- + +
+ +
+ + +
+ +
+ +
diff --git a/application/plugins/view/answers/admin/index.html b/application/plugins/view/answers/admin/index.html index a8b9a5dfc..951a025cc 100644 --- a/application/plugins/view/answers/admin/index.html +++ b/application/plugins/view/answers/admin/index.html @@ -71,6 +71,28 @@
+
+ +
+ {{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}} +
+
+
@@ -79,6 +101,15 @@
+ +
+ +
+ + + +
+
diff --git a/application/plugins/view/answers/index/detail.html b/application/plugins/view/answers/index/detail.html index d4a96fc74..38a9c9a13 100644 --- a/application/plugins/view/answers/index/detail.html +++ b/application/plugins/view/answers/index/detail.html @@ -18,23 +18,34 @@
{{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.content}}

-

{{$plugins_answers_detail.data.add_time_date}}

+
+ {{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}} + {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} +
管理员已回答

{{$plugins_answers_detail.data.reply}}

-

{{$plugins_answers_detail.data.reply_time_date}}

- {{else /}} +
+ + {{else /}} +
管理员待回复 - {{/if}} -
+
+ {{/if}}
{{else /}}
没有相关数据
@@ -101,6 +112,9 @@ {{$goods.title}} +
+ ¥{{$goods.min_price}} +
diff --git a/application/plugins/view/answers/index/index.html b/application/plugins/view/answers/index/index.html index afcac572c..ee202f4d9 100644 --- a/application/plugins/view/answers/index/index.html +++ b/application/plugins/view/answers/index/index.html @@ -86,69 +86,111 @@
{{/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['middle_new_name'])}} - 最新问答 + {{if empty($plugins_answers_data['right_top_goods_name'])}} + 推荐商品 {{else /}} - {{$plugins_answers_data.middle_new_name}} + {{$plugins_answers_data.right_top_goods_name}} {{/if}}

- 更多 » + 更多 »
-
- {{if !empty($plugins_answers_middle_answer_list)}} -
+
+ + {{/foreach}} + + {{/if}}
- -
-
-

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

- 更多 » + + {{if !empty($plugins_answers_data['images_bottom'])}} + - {{if !empty($plugins_answers_goods_list)}} -
+ {{/if}} {{include file="../../../plugins/view/answers/index/popup" /}} diff --git a/application/plugins/view/answers/index/search.html b/application/plugins/view/answers/index/search.html index 4fa25ca5e..8f067a399 100644 --- a/application/plugins/view/answers/index/search.html +++ b/application/plugins/view/answers/index/search.html @@ -13,7 +13,7 @@ {{include file="public/goods_category" /}} -
+