diff --git a/application/admin/controller/Admin.php b/application/admin/controller/Admin.php index f120f66badee4c4bce537df33daf1cfa693dc2b3..de6a3795261f3ebf2c36ee1e12e35371b0b6aecc 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 b4c6e79202a891d69f9bf51caf628960137cb6c6..d2c3db9b68cd020e7fe1219f4f879a0733c2fa23 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 3987ef52549c78c408aa700989b94289590db2f3..5b8332464018a4a1706e019ee396492637b443d1 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 3f356d345be0861671279fb4ecee669c1c4b1003..6593f0de999a8554285a9c11f31312a58bc50e22 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 314f2c1249b7227cf1a6fb4e8bc53f3831fe83f1..785ba0311c4addc642aff4584ab2a3e6ba6e257c 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 bbbc699781f34835553980bec7c2895c9b3f79fc..803bafcf3945e86f13398de3e4158096601ede83 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 129289c587b2fb2231c40e2b177fbc742eee867a..5ee0aff6887a33152da3a3f811114eb9b32f0c4e 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 41f7e380906522159d89c37162d5618b2b5253f3..bfed445e79ed8e7386cefefc30c0d44f54d1e71e 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 d7d5f1a5bd7339a4ef1f9b4e79fe33751a93d25d..f44fd205419801c9805c5b64f302c39bb2e40215 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 1f9c9e5d7dae1abdb98c56e510bf2253e11b2c9f..061e06020b898c8fd6ed958ee1b9fab7bdd66848 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 0140673bb05b5345dedcca466c058c8888603b15..3762390e9132e910c4be35360ee25b4684d213ab 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 35650b243d9a997b2c37335b45fc5f6a361b7cc6..7e222072ca6bc440b347a684f1156a23bd982368 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 9d8a49a56791b641fb74d7c8b7994a2bc0070f97..dfd9785b9020cb4c2e8f17d749fdb45d3a68d148 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 10adc5cbe75cb6456634717494061a4e325df000..4c8bd7f5e36687da5a7a51298f96c1dedbf1f126 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 308e060565f7704aa6ac4e0d79c250f4117bd71f..31bc4d7381a96c2f8b6ac18743c1992c855fd977 100755 --- a/application/plugins/view/answers/admin/baseinfo.html +++ b/application/plugins/view/answers/admin/baseinfo.html @@ -20,7 +20,7 @@
+上传图片
-
- +
-
- +
{{foreach $is_whether_list as $v}}
+
+ + +
+上传图片
+
+
+ + +
+
+ +
+ {{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 a8b9a5dfc5d1dba749d965629150726867d01de4..951a025ccbe8e04c4674cfd6f793e3042f96afdb 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 d4a96fc7473c1f412c9ae0ae9225d69e24bb4b84..38a9c9a1326355665ba8656c4e0428eef0e9fb16 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 afcac572c180bc7db4751ac63895b42ab23868cc..ee202f4d9f3f62f9e1d8c10135f08c6bf2614362 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 4fa25ca5e33f49cda44a62cc7d121b7c43d3490c..8f067a3991084a7de1b995b4f4a995917860296e 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" /}} -
+