mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 10:59:47 +08:00
问答系统优化+后台数据编辑优化
This commit is contained in:
parent
804012bfd2
commit
77e21a40fd
@ -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 = [
|
||||
|
@ -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'));
|
||||
|
@ -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'));
|
||||
|
@ -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'));
|
||||
|
@ -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'));
|
||||
|
@ -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]));
|
||||
|
@ -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);
|
||||
|
@ -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'));
|
||||
|
@ -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'));
|
||||
|
@ -48,6 +48,7 @@
|
||||
<th>标题</th>
|
||||
<th class="am-hide-sm-only">内容</th>
|
||||
<th class="am-hide-sm-only">回复内容</th>
|
||||
<th class="am-hide-sm-only">访问次数</th>
|
||||
<th class="am-hide-sm-only">回复时间</th>
|
||||
<th class="am-hide-sm-only">创建时间</th>
|
||||
<th>是否显示</th>
|
||||
@ -98,6 +99,7 @@
|
||||
<span class="cr-ddd">未回复</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-hide-sm-only">{{$v.access_count}}</td>
|
||||
<td class="am-hide-sm-only">{{$v.reply_time}}</td>
|
||||
<td class="am-hide-sm-only">{{$v.add_time}}</td>
|
||||
<td>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/sqlconsole/implement')}}" method="POST" request-type="ajax-fun" request-value="ViewImplementBack">
|
||||
<div class="am-form-group">
|
||||
<textarea rows="6" name="sql" class="am-radius" placeholder="SQL语句" data-validation-message="请填写需要执行的SQL语句" required>{{if !empty($data)}}{{$data.sql}}{{/if}}</textarea>
|
||||
<textarea rows="6" name="sql" class="am-radius" placeholder="SQL语句" data-validation-message="请填写需要执行的SQL语句" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">执行</button>
|
||||
|
@ -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']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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']);
|
||||
|
@ -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(
|
||||
|
@ -20,7 +20,7 @@
|
||||
<ul class="plug-file-upload-view plugins-images-view" data-form-name="images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['images_old'])}}
|
||||
<li>
|
||||
<input type="text" name="images" value="{{$data.images_old}}" data-validation-message="请上传图片" required />
|
||||
<input type="text" name="images" value="{{$data.images_old}}" data-validation-message="请上中间横幅传图片" required />
|
||||
<img src="{{$data.images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
@ -28,14 +28,12 @@
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<label>中间横幅-链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="链接地址" name="url" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data['url'])}} value="{{$data.url}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否新窗口打开</label>
|
||||
<label>中间横幅-是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
@ -45,6 +43,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">底部横幅<span class="am-form-group-label-tips">建议1200像数X80像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-images-bottom-view" data-form-name="images_bottom" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['images_bottom_old'])}}
|
||||
<li>
|
||||
<input type="text" name="images_bottom" value="{{$data.images_bottom_old}}" data-validation-message="请上传底部横幅图片" required />
|
||||
<img src="{{$data.images_bottom}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-bottom-view">+上传图片</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>底部横幅-链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="链接地址" name="url_bottom" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data['url_bottom'])}} value="{{$data.url_bottom}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>底部横幅-是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_new_window_open_bottom" value="{{$v.id}}" {{if isset($data['is_new_window_open_bottom']) and $data['is_new_window_open_bottom'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open_bottom']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>右侧推荐问答名称<span class="am-form-group-label-tips">默认 推荐问答</span></label>
|
||||
<input type="text" name="right_top_rec_name" placeholder="右侧推荐问答名称" maxlength="30" data-validation-message="右侧推荐问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_rec_name'])}} value="{{$data.right_top_rec_name}}"{{/if}} />
|
||||
@ -62,7 +88,17 @@
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>最新问答展示数量<span class="am-form-group-label-tips">默认 15 条</span></label>
|
||||
<input type="number" name="middle_new_page_number" placeholder="右侧推荐商品名称" maxlength="30" data-validation-message="请填写最新问答展示数量" class="am-radius" value="{{if !empty($data['middle_new_page_number'])}}{{$data.middle_new_page_number}}{{else /}}15{{/if}}" />
|
||||
<input type="number" name="middle_new_page_number" placeholder="最新问答展示数量" maxlength="30" data-validation-message="请填写最新问答展示数量" class="am-radius" value="{{if !empty($data['middle_new_page_number'])}}{{$data.middle_new_page_number}}{{else /}}15{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>搜索问答展示数量<span class="am-form-group-label-tips">默认 28 条</span></label>
|
||||
<input type="number" name="search_page_number" placeholder="搜索问答展示数量" maxlength="30" data-validation-message="请填写搜索问答展示数量数量" class="am-radius" value="{{if !empty($data['search_page_number'])}}{{$data.search_page_number}}{{else /}}28{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>首页开启最新商品展示<span class="am-form-group-label-tips">空则不展示</span></label>
|
||||
<input type="number" name="home_new_goods_number" placeholder="首页开启最新商品展示" maxlength="30" data-validation-message="请填写首页开启最新商品展示数量" class="am-radius" value="{{if !empty($data['home_new_goods_number'])}}{{$data.home_new_goods_number}}{{/if}}" />
|
||||
</div>
|
||||
|
||||
<label>右侧推荐问答</label>
|
||||
|
@ -71,6 +71,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>搜索问答展示数量</label>
|
||||
<div>
|
||||
{{if empty($data['search_page_number'])}}
|
||||
默认 28 条
|
||||
{{else /}}
|
||||
{{$data.search_page_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>首页开启最新商品展示</label>
|
||||
<div>
|
||||
{{if empty($data['home_new_goods_number'])}}
|
||||
不展示
|
||||
{{else /}}
|
||||
{{$data.home_new_goods_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>中间横幅</label>
|
||||
<div class="immages-tag">
|
||||
@ -79,6 +101,15 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>底部横幅</label>
|
||||
<div class="immages-tag">
|
||||
<a href="{{if empty($data['url_bottom'])}}javascript:;{{else /}}{{$data.url_bottom}}{{/if}}" {{if isset($data['is_new_window_open_bottom']) and $data['is_new_window_open_bottom'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{if !empty($data['images_bottom'])}}{{$data.images_bottom}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.png{{/if}}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -18,23 +18,34 @@
|
||||
<div class="am-u-md-8">
|
||||
{{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'])}}
|
||||
<h2>{{$plugins_answers_detail.data.title}}</h2>
|
||||
{{/if}}
|
||||
<div class="base-content">
|
||||
<p>{{$plugins_answers_detail.data.content}}</p>
|
||||
<p class="base-date gray-text">{{$plugins_answers_detail.data.add_time_date}}</p>
|
||||
<div class="base-title">
|
||||
{{if !empty($plugins_answers_detail['data']['title'])}}
|
||||
<h2><span class="highlighted">主题:</span>{{$plugins_answers_detail.data.title}}</h2>
|
||||
{{/if}}
|
||||
<p class="gray-text">阅读数:<span class="highlighted">{{$plugins_answers_detail.data.access_count}}</span></p>
|
||||
</div>
|
||||
<div class="base-content">{{$plugins_answers_detail.data.content}}</div>
|
||||
<div class="base-footer gray-text">
|
||||
留言时间:{{$plugins_answers_detail.data.add_time_date}}
|
||||
{{if !empty($plugins_answers_detail['data']['name'])}}
|
||||
|
||||
留言人:{{$plugins_answers_detail.data.name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="am-panel base {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} am-panel-success{{else /}} am-panel-warning{{/if}}">
|
||||
<div class="am-panel-bd">
|
||||
{{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}}
|
||||
<div class="am-panel-bd">
|
||||
<span class="am-badge am-radius am-badge-success">管理员已回答</span>
|
||||
<p class="reply-content">{{$plugins_answers_detail.data.reply}}</p>
|
||||
<p class="base-date gray-text">{{$plugins_answers_detail.data.reply_time_date}}</p>
|
||||
{{else /}}
|
||||
</div>
|
||||
<div class="base-footer gray-text reply-footer">
|
||||
回复时间:{{$plugins_answers_detail.data.reply_time_date}}
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="am-panel-bd">
|
||||
<span class="am-badge am-radius">管理员待回复</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
@ -101,6 +112,9 @@
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -86,69 +86,111 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 最新问答 -->
|
||||
<div class="am-u-md-8 answers-middle-list">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="answers-middle">
|
||||
<!-- 最新问答 -->
|
||||
<div class="am-u-md-8 answers-middle-list">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['middle_new_name'])}}
|
||||
最新问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.middle_new_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_middle_answer_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_middle_answer_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
<div class="am-list-news-ft">
|
||||
<a class="am-list-news-more am-btn am-btn-default" href="{{:PluginsHomeUrl('answers', 'index', 'search')}}">查看更多 »</a>
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="am-u-md-4 answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{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}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_middle_answer_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_middle_answer_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="am-u-md-4 answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
<!-- 底部横幅广告 -->
|
||||
{{if !empty($plugins_answers_data['images_bottom'])}}
|
||||
<div class="answers-middle-banner">
|
||||
<a href="{{if empty($plugins_answers_data['url_bottom'])}}javascript:;{{else /}}{{$plugins_answers_data.url_bottom}}{{/if}}" {{if isset($plugins_answers_data['is_new_window_open_bottom']) and $plugins_answers_data['is_new_window_open_bottom'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{$plugins_answers_data.images_bottom}}" />
|
||||
</a>
|
||||
</div>
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
{{/if}}
|
||||
|
||||
<!-- 最新商品 -->
|
||||
{{if !empty($plugins_new_goods_list)}}
|
||||
<div class="answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>最新商品</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-6 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_new_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 提问popup -->
|
||||
{{include file="../../../plugins/view/answers/index/popup" /}}
|
||||
|
@ -13,7 +13,7 @@
|
||||
{{include file="public/goods_category" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers plugins-answers-detail">
|
||||
<div class="am-g am-container plugins-answers plugins-answers-search">
|
||||
<!-- 详情 -->
|
||||
<div class="am-u-md-8">
|
||||
{{if !empty($plugins_answers_data_list)}}
|
||||
@ -23,6 +23,11 @@
|
||||
{{foreach $plugins_answers_data_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if isset($answers['is_reply']) and $answers['is_reply'] eq 1}}
|
||||
<span class="am-badge am-radius am-badge-success">已回复</span>
|
||||
{{else /}}
|
||||
<span class="am-badge am-radius">待回复</span>
|
||||
{{/if}}
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
@ -98,6 +103,9 @@
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -382,5 +382,23 @@ class AnswerService
|
||||
}
|
||||
return DataReturn('编辑失败或数据未改变', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问统计加1
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-10-15
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AnswerAccessCountInc($params = [])
|
||||
{
|
||||
if(!empty($params['answer_id']))
|
||||
{
|
||||
return Db::name('Answer')->where(['id'=>intval($params['answer_id'])])->setInc('access_count');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
@ -680,7 +680,7 @@ class GoodsService
|
||||
{
|
||||
if(!empty($params['goods_id']))
|
||||
{
|
||||
return Db::name('Goods')->where(array('id'=>intval($params['goods_id'])))->setInc('access_count');
|
||||
return Db::name('Goods')->where(['id'=>intval($params['goods_id'])])->setInc('access_count');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
/**
|
||||
* 编辑页面
|
||||
*/
|
||||
ul.plugins-images-view li {
|
||||
ul.plugins-images-view li, ul.plugins-images-bottom-view li {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
@ -3,6 +3,9 @@
|
||||
padding-top: 10px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
.plugins-answers .answers-goods {
|
||||
overflow: hidden;
|
||||
}
|
||||
.plugins-answers .answers-goods .am-list-news-hd {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
@ -47,6 +50,12 @@
|
||||
.plugins-answers .am-gallery-bordered .am-gallery-title {
|
||||
font-size: 12px;
|
||||
}
|
||||
.plugins-answers .answers-top, .plugins-answers .answers-middle {
|
||||
overflow: hidden;
|
||||
}
|
||||
.plugins-answers .answers-top, .plugins-answers .answers-middle-banner {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width:640px) {
|
||||
.plugins-answers .am-u-md-8, .plugins-answers .am-gallery {
|
||||
@ -64,10 +73,7 @@
|
||||
color: #d2364c;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.plugins-answers .answers-top, .plugins-answers .answers-middle-banner {
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.plugins-answers .answers-sidebar, .plugins-answers .answers-goods {
|
||||
padding-right: 1px;
|
||||
}
|
||||
@ -101,23 +107,30 @@
|
||||
.plugins-answers .am-list-news-hd {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.plugins-answers .answers-top {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
.plugins-answers-detail {
|
||||
.plugins-answers-detail, .plugins-answers-search {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.plugins-answers-detail .base-content {
|
||||
border: 1px dashed transparent;
|
||||
background: linear-gradient(white,white) padding-box,
|
||||
repeating-linear-gradient(-45deg, #ccc 0, #ccc 0.25em, white 0, white 0.6em);
|
||||
.plugins-answers-detail .am-u-md-8 {
|
||||
border: 1px solid #dedede;
|
||||
}
|
||||
.plugins-answers-detail .base-content, .plugins-answers-detail .base-footer {
|
||||
padding: 10px;
|
||||
}
|
||||
.plugins-answers-detail .base-date {
|
||||
.plugins-answers-detail .base-content {
|
||||
border-top: 1px solid #dedede;
|
||||
}
|
||||
.plugins-answers-detail .base-footer {
|
||||
text-align: right;
|
||||
margin-top: 5px;
|
||||
border-top: 1px dashed #e7e7e7;
|
||||
border-bottom: 1px dashed #e7e7e7;
|
||||
}
|
||||
.plugins-answers-detail .base {
|
||||
margin-top: 10px;
|
||||
@ -128,13 +141,38 @@
|
||||
background: #fff7ef;
|
||||
}
|
||||
.plugins-answers-detail .am-panel-success {
|
||||
background: #f2fff1;
|
||||
background: #e7ffe5;
|
||||
}
|
||||
.plugins-answers-detail .am-panel {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
.plugins-answers-detail .base-title {
|
||||
position: relative;
|
||||
height: 45px;
|
||||
padding: 10px;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
.plugins-answers-detail .base-title .highlighted {
|
||||
color: #FF9800;
|
||||
}
|
||||
.plugins-answers-detail h2 {
|
||||
font-weight: 500;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.plugins-answers-detail .base-title .gray-text {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 15px;
|
||||
}
|
||||
.plugins-answers-detail .base .reply-content {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.plugins-answers-detail .reply-footer {
|
||||
border-bottom: 0;
|
||||
}
|
||||
@media only screen and (max-width:640px) {
|
||||
.plugins-answers-detail .answers-btn-list {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
Loading…
Reference in New Issue
Block a user