Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
387081e9
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
387081e9
编写于
6月 19, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
品牌列表优化
上级
0e54124b
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
321 addition
and
393 deletion
+321
-393
application/admin/controller/Article.php
application/admin/controller/Article.php
+0
-1
application/admin/controller/Brand.php
application/admin/controller/Brand.php
+52
-40
application/admin/controller/Goodscomments.php
application/admin/controller/Goodscomments.php
+0
-1
application/admin/controller/Slide.php
application/admin/controller/Slide.php
+0
-1
application/admin/form/Brand.php
application/admin/form/Brand.php
+162
-0
application/admin/view/default/brand/detail.html
application/admin/view/default/brand/detail.html
+29
-0
application/admin/view/default/brand/index.html
application/admin/view/default/brand/index.html
+9
-279
application/admin/view/default/brand/module/logo.html
application/admin/view/default/brand/module/logo.html
+6
-0
application/admin/view/default/brand/module/operate.html
application/admin/view/default/brand/module/operate.html
+13
-0
application/admin/view/default/brand/module/url.html
application/admin/view/default/brand/module/url.html
+4
-0
application/admin/view/default/link/module/info.html
application/admin/view/default/link/module/info.html
+1
-1
application/admin/view/default/link/module/url.html
application/admin/view/default/link/module/url.html
+1
-1
application/index/controller/Index.php
application/index/controller/Index.php
+2
-2
application/index/view/default/index/index.html
application/index/view/default/index/index.html
+3
-1
application/service/BrandService.php
application/service/BrandService.php
+29
-65
application/service/GoodsService.php
application/service/GoodsService.php
+1
-1
application/tags.php
application/tags.php
+9
-0
未找到文件。
application/admin/controller/Article.php
浏览文件 @
387081e9
...
...
@@ -99,7 +99,6 @@ class Article extends Common
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
$where
,
'is_category'
=>
1
,
];
$ret
=
ArticleService
::
ArticleList
(
$data_params
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
0
]))
?
[]
:
$ret
[
'data'
][
0
];
...
...
application/admin/controller/Brand.php
浏览文件 @
387081e9
...
...
@@ -50,50 +50,62 @@ class Brand extends Common
*/
public
function
Index
()
{
//
参
数
$
params
=
input
(
);
//
总
数
$
total
=
BrandService
::
BrandTotal
(
$this
->
form_where
);
// 分页
$number
=
MyC
(
'admin_page_number'
,
10
,
true
);
// 条件
$where
=
BrandService
::
BrandListWhere
(
$params
);
// 获取总数
$total
=
BrandService
::
BrandTotal
(
$where
);
// 分页
$page_params
=
array
(
'number'
=>
$number
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
MyUrl
(
'admin/brand/index'
),
);
$page_params
=
[
'number'
=>
$this
->
page_size
,
'total'
=>
$total
,
'where'
=>
$this
->
data_request
,
'page'
=>
$this
->
page
,
'url'
=>
MyUrl
(
'admin/brand/index'
),
];
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
// 获取列表
$data_params
=
array
(
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$number
,
'where'
=>
$where
,
'field'
=>
'*'
,
);
$data
=
BrandService
::
BrandList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
// 是否启用
$this
->
assign
(
'common_is_enable_list'
,
lang
(
'common_is_enable_list'
));
$data_params
=
[
'where'
=>
$this
->
form_where
,
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$this
->
page_size
,
];
$ret
=
BrandService
::
BrandList
(
$data_params
);
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
return
$this
->
fetch
();
}
// 品牌分类
$brand_category
=
BrandService
::
BrandCategoryList
([
'field'
=>
'id,name'
]);
$this
->
assign
(
'brand_category'
,
$brand_category
[
'data'
]);
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-05T08:21:54+0800
*/
public
function
Detail
()
{
if
(
!
empty
(
$this
->
data_request
[
'id'
]))
{
// 条件
$where
=
[
[
'id'
,
'='
,
intval
(
$this
->
data_request
[
'id'
])],
];
// 参数
$this
->
assign
(
'params'
,
$params
);
// 获取列表
$data_params
=
[
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
$where
,
];
$ret
=
BrandService
::
BrandList
(
$data_params
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
0
]))
?
[]
:
$ret
[
'data'
][
0
];
$this
->
assign
(
'data'
,
$data
);
}
return
$this
->
fetch
();
}
}
/**
* [SaveInfo 添加/编辑页面]
...
...
@@ -105,7 +117,7 @@ class Brand extends Common
public
function
SaveInfo
()
{
// 参数
$params
=
input
()
;
$params
=
$this
->
data_request
;
// 数据
$data
=
[];
...
...
@@ -165,7 +177,7 @@ class Brand extends Common
}
// 开始处理
$params
=
input
()
;
$params
=
$this
->
data_request
;
return
BrandService
::
BrandSave
(
$params
);
}
...
...
@@ -185,7 +197,7 @@ class Brand extends Common
}
// 开始处理
$params
=
input
()
;
$params
=
$this
->
data_request
;
$params
[
'user_type'
]
=
'admin'
;
return
BrandService
::
BrandDelete
(
$params
);
}
...
...
@@ -206,7 +218,7 @@ class Brand extends Common
}
// 开始处理
$params
=
input
()
;
$params
=
$this
->
data_request
;
return
BrandService
::
BrandStatusUpdate
(
$params
);
}
}
...
...
application/admin/controller/Goodscomments.php
浏览文件 @
387081e9
...
...
@@ -99,7 +99,6 @@ class Goodscomments extends Common
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
$where
,
'is_category'
=>
1
,
];
$ret
=
GoodsCommentsService
::
GoodsCommentsList
(
$data_params
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
0
]))
?
[]
:
$ret
[
'data'
][
0
];
...
...
application/admin/controller/Slide.php
浏览文件 @
387081e9
...
...
@@ -98,7 +98,6 @@ class Slide extends Common
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
$where
,
'is_category'
=>
1
,
];
$ret
=
SlideService
::
SlideList
(
$data_params
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
0
]))
?
[]
:
$ret
[
'data'
][
0
];
...
...
application/admin/form/Brand.php
0 → 100644
浏览文件 @
387081e9
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
use
app\service\BrandService
;
/**
* 品牌动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-19
* @desc description
*/
class
Brand
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-18
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'id'
,
'status_field'
=>
'is_enable'
,
'is_search'
=>
1
,
'search_url'
=>
MyUrl
(
'admin/brand/index'
),
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/brand/delete'
),
'delete_key'
=>
'ids'
,
'detail_title'
=>
'基础信息'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'名称'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'LOGO'
,
'view_type'
=>
'module'
,
'view_key'
=>
'brand/module/logo'
,
],
[
'label'
=>
'官网地址'
,
'view_type'
=>
'module'
,
'view_key'
=>
'brand/module/url'
,
'grid_size'
=>
'lg'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'form_name'
=>
'website_url'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'品牌分类'
,
'view_type'
=>
'field'
,
'view_key'
=>
'brand_category_name'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'brand_category_id'
,
'where_type'
=>
'in'
,
'data'
=>
$this
->
BrandCategoryList
(),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'是否启用'
,
'view_type'
=>
'status'
,
'view_key'
=>
'is_enable'
,
'post_url'
=>
MyUrl
(
'admin/brand/statusupdate'
),
'is_form_su'
=>
1
,
'align'
=>
'center'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_is_enable_list'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'排序'
,
'view_type'
=>
'field'
,
'view_key'
=>
'sort'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'add_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'更新时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'upd_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'brand/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
/**
* 品牌分类
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-19
* @desc description
*/
public
function
BrandCategoryList
()
{
$ret
=
BrandService
::
BrandCategoryList
([
'field'
=>
'id,name'
]);
return
isset
(
$ret
[
'data'
])
?
$ret
[
'data'
]
:
[];
}
}
?>
\ No newline at end of file
application/admin/view/default/brand/detail.html
0 → 100644
浏览文件 @
387081e9
<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}
<!-- 重写数据模块 -->
{{block name="detail_data"}}
<!-- 父级内容 -->
{__block__}
<!-- SEO信息 -->
<div
class=
"am-panel am-panel-default"
>
<div
class=
"am-panel-hd"
>
SEO信息
</div>
<div
class=
"am-panel-bd"
>
{{if !empty($data)}}
<dl
class=
"dl-content"
>
<dt>
SEO标题
</dt>
<dd>
{{$data.seo_title}}
</dd>
<dt>
SEO关键字
</dt>
<dd>
{{$data.seo_keywords}}
</dd>
<dt>
SEO描述
</dt>
<dd>
{{$data.seo_desc}}
</dd>
</dl>
{{else /}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
{{/if}}
</div>
</div>
{{/block}}
\ No newline at end of file
application/admin/view/default/brand/index.html
浏览文件 @
387081e9
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation form-search"
method=
"post"
action=
"{{:MyUrl('admin/brand/index')}}"
request-type=
"form"
>
<div
class=
"thin"
>
<div
class=
"am-input-group am-input-group-sm am-fl so"
>
<input
type=
"text"
autocomplete=
"off"
name=
"keywords"
class=
"am-radius"
placeholder=
"名称"
value=
"{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}"
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"submit"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
</span>
</div>
<label
class=
"am-fl thin_sub more-submit"
>
更多筛选条件
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
<input
type=
"checkbox"
name=
"is_more"
value=
"1"
id=
"is_more"
checked
/>
<i
class=
"am-icon-angle-up"
></i>
{{else /}}
<input
type=
"checkbox"
name=
"is_more"
value=
"1"
id=
"is_more"
/>
<i
class=
"am-icon-angle-down"
></i>
{{/if}}
</label>
</div>
<table
class=
"so-list more-where {{if !isset($params['is_more'])}}none{{/if}}"
>
<tbody>
<tr>
<td>
<span>
启用:
</span>
<select
name=
"is_enable"
class=
"chosen-select"
data-placeholder=
"是否启用..."
>
<option
value=
"-1"
>
是否启用...
</option>
{{foreach $common_is_enable_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
is_enable
'])
and
$
params
['
is_enable
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</td>
<td>
<span>
分类:
</span>
<select
name=
"brand_category_id"
class=
"chosen-select"
data-placeholder=
"品牌分类..."
>
<option
value=
"-1"
>
品牌分类...
</option>
{{foreach $brand_category as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
brand_category_id
'])
and
$
params
['
brand_category_id
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</td>
</tr>
<tr>
<td
class=
"time"
>
<span>
时间:
</span>
<span>
<input
type=
"text"
autocomplete=
"off"
name=
"time_start"
class=
"am-form-field am-input-sm am-radius Wdate"
placeholder=
"起始时间"
value=
"{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}"
data-validation-message=
"日期格式有误"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})"
autocomplete=
"off"
/><i
class=
"am-icon-calendar"
></i>
</span>
<em
class=
"text-grey"
>
~
</em>
<span>
<input
type=
"text"
autocomplete=
"off"
name=
"time_end"
class=
"am-form-field am-input-sm am-radius Wdate"
placeholder=
"结束时间"
value=
"{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}"
pattern=
"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
data-validation-message=
"日期格式有误"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})"
autocomplete=
"off"
/><i
class=
"am-icon-calendar"
></i>
</span>
</td>
<td>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius am-btn-xs btn-loading-example"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
<a
href=
"{{:MyUrl('admin/brand/index')}}"
class=
"am-btn am-btn-warning am-radius am-btn-sm reset-submit"
>
清除条件
</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- form end -->
<!-- top operation start -->
<div
class=
"am-g am-margin-top-sm"
>
<a
href=
"{{:MyUrl('admin/brand/saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"
>
新增
</a>
<!-- 顶部操作钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_brand_top_operate
</span>
</div>
{{/if}}
{{php}}
$hook_name = 'plugins_view_admin_brand_top_operate';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
if(!empty($hook_data)
&&
is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
</div>
<!-- top operation end -->
<!-- list start -->
<div
class=
"am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm"
>
<table
class=
"am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last"
>
<thead>
<tr>
<th>
名称
</th>
<th
class=
"am-grid-sm"
>
LOGO
</th>
<th>
品牌分类
</th>
<th
class=
"am-grid-sm"
>
官网地址
</th>
<th
class=
"am-text-center"
>
是否启用
</th>
<th
class=
"am-text-center"
>
更多
</th>
<th
class=
"am-text-center"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
{{
if
$
v
['
is_enable
']
eq
0}}
class=
"am-active"
{{/
if
}}
>
<td
class=
"am-text-middle"
>
{{$v.name}}
</td>
<td
class=
"am-text-middle"
>
{{if !empty($v['logo'])}}
<a
href=
"{{$v['logo']}}"
target=
"_blank"
>
<img
src=
"{{$v['logo']}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{else /}}
<span
class=
"cr-ddd"
>
暂无图片
</span>
{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{$v.brand_category_name}}
</td>
<td
class=
"am-text-middle"
>
{{$v.website_url}}
{{if !empty($v['website_url'])}}
<a
href=
"{{$v.website_url}}"
target=
"_blank"
>
<i
class=
"am-icon-external-link"
></i>
</a>
{{/if}}
</td>
<td
class=
"am-text-middle am-text-center"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/brand/statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{$v['is_enable']}}"
data-is-update-status=
"1"
></a>
</td>
<td
class=
"am-text-middle"
>
<p
class=
"am-text-center xo-cursor-pr"
>
<i
class=
"am-icon-caret-down"
></i>
<span
data-am-modal=
"{target: '#my-popup{{$v.id}}'}"
>
查看更多
</span>
</p>
<div
class=
"am-popup am-radius"
id=
"my-popup{{$v.id}}"
>
<div
class=
"am-popup-inner"
>
<div
class=
"am-popup-hd"
>
<h4
class=
"am-popup-title"
>
详情内容
</h4>
<span
data-am-modal-close
class=
"am-close"
>
×
</span>
</div>
<div
class=
"am-popup-bd"
>
<dl
class=
"dl-content"
>
<dt>
名称
</dt>
<dd>
{{$v.name}}
</dd>
<dt>
LOGO
</dt>
<dd>
{{if !empty($v['logo'])}}
<a
href=
"{{$v['logo']}}"
target=
"_blank"
>
<img
src=
"{{$v['logo']}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{else /}}
<span
class=
"cr-ddd"
>
暂无图片
</span>
{{/if}}
</dd>
<dt>
品牌分类
</dt>
<dd>
{{$v.brand_category_name}}
</dd>
<dt>
官网地址
</dt>
<dd>
{{$v.website_url}}
{{if !empty($v['website_url'])}}
<a
href=
"{{$v.website_url}}"
target=
"_blank"
>
<i
class=
"am-icon-external-link"
></i>
</a>
{{/if}}
</dd>
<dt>
是否启用
</dt>
<dd>
{{$v.is_enable_text}}
</dd>
<dt>
SEO标题
</dt>
<dd>
{{$v.seo_title}}
</dd>
<dt>
SEO关键字
</dt>
<dd>
{{$v.seo_keywords}}
</dd>
<dt>
SEO描述
</dt>
<dd>
{{$v.seo_desc}}
</dd>
<dt>
创建时间
</dt>
<dd>
{{$v.add_time_time}}
</dd>
<dt>
更新时间
</dt>
<dd>
{{$v.upd_time_time}}
</dd>
</dl>
</div>
</div>
</div>
</td>
<td
class=
"am-operate-grid"
>
<div
class=
"am-scrollable-vertical"
>
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/brand/saveinfo', array_merge($params, ['id'=>$v['id']]))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/brand/delete')}}"
data-id=
"{{$v.id}}"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
<!-- 品牌列表操作钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_brand_list_operate
</span>
</div>
{{/if}}
{{php}}
$hook_name = 'plugins_view_admin_brand_list_operate';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true, 'id'=>$v['id'], 'data'=>$v]);
if(!empty($hook_data)
&&
is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
</div>
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
{{/if}}
</div>
<!-- list end -->
<!-- bottom operation start -->
<div
class=
"am-g am-margin-top-sm"
>
<!-- 底部操作钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_brand_bottom_operate
</span>
</div>
{{/if}}
{{php}}
$hook_name = 'plugins_view_admin_brand_bottom_operate';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]);
if(!empty($hook_data)
&&
is_array($hook_data))
{
foreach($hook_data as $hook)
{
if(is_string($hook) || is_int($hook))
{
echo htmlspecialchars_decode($hook);
}
}
}
{{/php}}
</div>
<!-- bottom operation end -->
<!-- page start -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
<!-- page end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<a
href=
"{{:MyUrl('admin/brand/saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"
>
新增
</a>
<!-- 父级内容 -->
{__block__}
{{/block}}
\ No newline at end of file
application/admin/view/default/brand/module/logo.html
0 → 100644
浏览文件 @
387081e9
<!-- logo -->
{{if !empty($module_data) and !empty($module_data['logo'])}}
<a
href=
"{{$module_data['logo']}}"
target=
"_blank"
>
<img
src=
"{{$module_data.logo}}"
alt=
"{{$module_data.name}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{/if}}
\ No newline at end of file
application/admin/view/default/brand/module/operate.html
0 → 100644
浏览文件 @
387081e9
<!-- 操作栏 -->
<button
type=
"button"
class=
"am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup"
data-url=
"{{:MyUrl('admin/brand/detail', ['id'=>$module_data['id']])}}"
>
<i
class=
"am-icon-eye"
></i>
<span>
详情
</span>
</button>
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/brand/saveinfo', array('id'=>$module_data['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/brand/delete')}}"
data-id=
"{{$module_data.id}}"
data-key=
"ids"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
\ No newline at end of file
application/admin/view/default/brand/module/url.html
0 → 100644
浏览文件 @
387081e9
<!-- url -->
{{if !empty($module_data['website_url'])}}
<a
href=
"{{$module_data.website_url}}"
target=
"_blank"
title=
"{{$module_data.name}}"
>
{{$module_data.website_url}}
</a>
{{/if}}
\ No newline at end of file
application/admin/view/default/link/module/info.html
浏览文件 @
387081e9
<!--
商品
基础信息 -->
<!-- 基础信息 -->
{{if !empty($module_data)}}
<div
title=
"{{$module_data.name}}"
>
<span>
{{$module_data.name}}
</span>
...
...
application/admin/view/default/link/module/url.html
浏览文件 @
387081e9
<!--
商品基础信息
-->
<!--
url
-->
{{if !empty($module_data['url'])}}
<a
href=
"{{$module_data.url}}"
target=
"_blank"
title=
"{{$module_data.name}}"
>
{{$module_data.url}}
</a>
{{/if}}
\ No newline at end of file
application/index/controller/Index.php
浏览文件 @
387081e9
...
...
@@ -59,8 +59,8 @@ class Index extends Common
// 新闻
$params
=
[
'where'
=>
[
'
a.is_enable'
=>
1
,
'a.
is_home_recommended'
=>
1
],
'field'
=>
'
a.id,a.title,a.title_color,ac.name AS category_name
'
,
'where'
=>
[
'
is_enable'
=>
1
,
'
is_home_recommended'
=>
1
],
'field'
=>
'
id,title,title_color,article_category_id
'
,
'm'
=>
0
,
'n'
=>
9
,
];
...
...
application/index/view/default/index/index.html
浏览文件 @
387081e9
...
...
@@ -93,7 +93,9 @@
{{foreach $article_list as $article}}
<li>
<a
href=
"{{$article.url}}"
target=
"_blank"
>
<span>
[{{$article.category_name}}]
</span>
{{if isset($article['article_category_name'])}}
<span>
[{{$article.article_category_name}}]
</span>
{{/if}}
<span
{{
if
!
empty
($
article.title_color
)}}
style=
"color:{{$article.title_color}};"
{{/
if
}}
>
{{$article.title}}
</span>
</a>
</li>
...
...
application/service/BrandService.php
浏览文件 @
387081e9
...
...
@@ -45,6 +45,14 @@ class BrandService
$data
=
Db
::
name
(
'Brand'
)
->
where
(
$where
)
->
order
(
$order_by
)
->
limit
(
$m
,
$n
)
->
select
();
if
(
!
empty
(
$data
))
{
// 分类名称
$cnames
=
[];
$cids
=
array_column
(
$data
,
'brand_category_id'
);
if
(
!
empty
(
$cids
))
{
$cnames
=
Db
::
name
(
'BrandCategory'
)
->
where
([
'id'
=>
$cids
])
->
column
(
'name'
,
'id'
);
}
$common_is_enable_tips
=
lang
(
'common_is_enable_tips'
);
foreach
(
$data
as
&
$v
)
{
...
...
@@ -57,7 +65,7 @@ class BrandService
// 分类名称
if
(
isset
(
$v
[
'brand_category_id'
]))
{
$v
[
'brand_category_name'
]
=
Db
::
name
(
'BrandCategory'
)
->
where
([
'id'
=>
$v
[
'brand_category_id'
]])
->
value
(
'name'
)
;
$v
[
'brand_category_name'
]
=
isset
(
$cnames
[
$v
[
'brand_category_id'
]])
?
$cnames
[
$v
[
'brand_category_id'
]]
:
''
;
}
// logo
...
...
@@ -70,13 +78,11 @@ class BrandService
// 时间
if
(
isset
(
$v
[
'add_time'
]))
{
$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
[
'add_time'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
}
if
(
isset
(
$v
[
'upd_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'
]);
$v
[
'upd_time'
]
=
empty
(
$v
[
'upd_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'upd_time'
]);
}
}
}
...
...
@@ -96,50 +102,6 @@ class BrandService
return
(
int
)
Db
::
name
(
'Brand'
)
->
where
(
$where
)
->
count
();
}
/**
* 列表条件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
BrandListWhere
(
$params
=
[])
{
$where
=
[];
if
(
!
empty
(
$params
[
'keywords'
]))
{
$where
[]
=
[
'name'
,
'like'
,
'%'
.
$params
[
'keywords'
]
.
'%'
];
}
// 是否更多条件
if
(
isset
(
$params
[
'is_more'
])
&&
$params
[
'is_more'
]
==
1
)
{
// 等值
if
(
isset
(
$params
[
'is_enable'
])
&&
$params
[
'is_enable'
]
>
-
1
)
{
$where
[]
=
[
'is_enable'
,
'='
,
intval
(
$params
[
'is_enable'
])];
}
if
(
isset
(
$params
[
'brand_category_id'
])
&&
$params
[
'brand_category_id'
]
>
-
1
)
{
$where
[]
=
[
'brand_category_id'
,
'='
,
intval
(
$params
[
'brand_category_id'
])];
}
if
(
!
empty
(
$params
[
'time_start'
]))
{
$where
[]
=
[
'add_time'
,
'>'
,
strtotime
(
$params
[
'time_start'
])];
}
if
(
!
empty
(
$params
[
'time_end'
]))
{
$where
[]
=
[
'add_time'
,
'<'
,
strtotime
(
$params
[
'time_end'
])];
}
}
return
$where
;
}
/**
* 获取所有分类及下面品牌
* @author Devil
...
...
@@ -365,27 +327,24 @@ class BrandService
*/
public
static
function
BrandDelete
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
// 参数是否有误
if
(
empty
(
$params
[
'ids'
]))
{
return
DataReturn
(
$ret
,
-
1
);
return
DataReturn
(
'操作id有误'
,
-
1
);
}
// 是否数组
if
(
!
is_array
(
$params
[
'ids'
]))
{
$params
[
'ids'
]
=
explode
(
','
,
$params
[
'ids'
]);
}
// 删除操作
if
(
Db
::
name
(
'Brand'
)
->
where
([
'id'
=>
$params
[
'id'
]])
->
delete
())
if
(
Db
::
name
(
'Brand'
)
->
where
([
'id'
=>
$params
[
'id
s
'
]])
->
delete
())
{
return
DataReturn
(
'删除成功'
);
}
return
DataReturn
(
'删除失败
或资源不存在
'
,
-
100
);
return
DataReturn
(
'删除失败'
,
-
100
);
}
/**
...
...
@@ -405,6 +364,11 @@ class BrandService
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'field'
,
'error_msg'
=>
'未指定操作字段'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'state'
,
...
...
@@ -419,11 +383,11 @@ class BrandService
}
// 数据更新
if
(
Db
::
name
(
'Brand'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
([
'is_enable'
=>
intval
(
$params
[
'state'
]
)]))
if
(
Db
::
name
(
'Brand'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
([
$params
[
'field'
]
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
(
)]))
{
return
DataReturn
(
'
编辑
成功'
);
return
DataReturn
(
'
操作
成功'
);
}
return
DataReturn
(
'
编辑失败或数据未改变
'
,
-
100
);
return
DataReturn
(
'
操作失败
'
,
-
100
);
}
/**
...
...
application/service/GoodsService.php
浏览文件 @
387081e9
...
...
@@ -1719,7 +1719,7 @@ class GoodsService
// 参数是否有误
if
(
empty
(
$params
[
'ids'
]))
{
return
DataReturn
(
'
商品
id有误'
,
-
1
);
return
DataReturn
(
'
操作
id有误'
,
-
1
);
}
// 是否数组
if
(
!
is_array
(
$params
[
'ids'
]))
...
...
application/tags.php
浏览文件 @
387081e9
...
...
@@ -35,6 +35,7 @@ return array (
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
1
=>
'app\\plugins\\freightfee\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
...
...
@@ -84,5 +85,13 @@ return array (
array
(
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\freightfee\\Hook'
,
),
'plugins_view_goods_detail_title'
=>
array
(
0
=>
'app\\plugins\\freightfee\\Hook'
,
),
);
?>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录