Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
87590024
ShopXO
项目概览
jamesyang1999
/
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,发现更多精彩内容 >>
提交
87590024
编写于
12月 17, 2018
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
goods category
上级
f65c4efd
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
226 addition
and
171 deletion
+226
-171
application/admin/config/app.php
application/admin/config/app.php
+9
-9
application/admin/controller/Admin.php
application/admin/controller/Admin.php
+1
-0
application/admin/controller/Goods.php
application/admin/controller/Goods.php
+3
-0
application/admin/controller/GoodsCategory.php
application/admin/controller/GoodsCategory.php
+16
-96
application/admin/controller/User.php
application/admin/controller/User.php
+1
-0
application/admin/lang/zh-cn.php
application/admin/lang/zh-cn.php
+15
-0
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+2
-2
application/admin/view/default/goodscategory/index.html
application/admin/view/default/goodscategory/index.html
+21
-21
application/admin/view/default/public/footer.html
application/admin/view/default/public/footer.html
+1
-1
application/service/GoodsService.php
application/service/GoodsService.php
+113
-25
application/service/ResourcesService.php
application/service/ResourcesService.php
+24
-0
application/service/SearchService.php
application/service/SearchService.php
+2
-2
extend/base/Uploader.php
extend/base/Uploader.php
+4
-3
public/static/common/lib/ueditor/themes/default/css/ueditor.css
.../static/common/lib/ueditor/themes/default/css/ueditor.css
+13
-11
public/static/common/lib/ueditor/ueditor.config.js
public/static/common/lib/ueditor/ueditor.config.js
+1
-1
未找到文件。
application/admin/config/app.php
浏览文件 @
87590024
...
...
@@ -50,7 +50,7 @@ return array(
'imageUrlPrefix'
=>
''
,
// 上传保存路径,可以自定义保存路径和文件名格式
'imagePathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/image
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'imagePathFormat'
=>
__MY_ROOT__
.
'static/upload/
image/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 涂鸦图片上传配置项
...
...
@@ -61,7 +61,7 @@ return array(
'scrawlFieldName'
=>
'upfile'
,
// 上传保存路径,可以自定义保存路径和文件名格式
'scrawlPathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/scrawl
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'scrawlPathFormat'
=>
__MY_ROOT__
.
'static/upload/
image/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 上传大小限制,单位B
'scrawlMaxSize'
=>
MyC
(
'home_max_limit_image'
,
2048000
,
true
),
...
...
@@ -78,7 +78,7 @@ return array(
'snapscreenActionName'
=>
'uploadimage'
,
// 上传保存路径,可以自定义保存路径和文件名格式
'snapscreenPathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/screenshot
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'snapscreenPathFormat'
=>
__MY_ROOT__
.
'static/upload/
image/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 图片访问路径前缀
'snapscreenUrlPrefix'
=>
''
,
...
...
@@ -98,7 +98,7 @@ return array(
'catcherFieldName'
=>
'source'
,
// 上传保存路径,可以自定义保存路径和文件名格式
'catcherPathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/catchimage
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'catcherPathFormat'
=>
__MY_ROOT__
.
'static/upload/
image/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 图片访问路径前缀
'catcherUrlPrefix'
=>
''
,
...
...
@@ -118,7 +118,7 @@ return array(
'videoFieldName'
=>
'upfile'
,
// 上传保存路径,可以自定义保存路径和文件名格式
'videoPathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/video
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'videoPathFormat'
=>
__MY_ROOT__
.
'static/upload/
video/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 视频访问路径前缀
'videoUrlPrefix'
=>
''
,
...
...
@@ -138,7 +138,7 @@ return array(
'fileFieldName'
=>
'upfile'
,
// 上传保存路径,可以自定义保存路径和文件名格式
'filePathFormat'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/file
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
'filePathFormat'
=>
__MY_ROOT__
.
'static/upload/
file/'
.
input
(
'path_type'
,
'other'
)
.
'
/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 文件访问路径前缀
'fileUrlPrefix'
=>
''
,
...
...
@@ -155,7 +155,7 @@ return array(
'imageManagerActionName'
=>
'listimage'
,
// 指定要列出图片的目录
'imageManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/image
/'
,
'imageManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
image/'
.
input
(
'path_type'
,
'other'
)
.
'
/'
,
// 每次列出文件数量
'imageManagerListSize'
=>
20
,
...
...
@@ -175,7 +175,7 @@ return array(
'fileManagerActionName'
=>
'listfile'
,
// 指定要列出文件的目录
'fileManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/file
/'
,
'fileManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
file/'
.
input
(
'path_type'
,
'other'
)
.
'
/'
,
// 文件访问路径前缀
'fileManagerUrlPrefix'
=>
''
,
...
...
@@ -190,7 +190,7 @@ return array(
'videoManagerActionName'
=>
'listvideo'
,
// 指定要列出文件的目录
'videoManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
'
.
input
(
'path_type'
,
'other'
)
.
'/video
/'
,
'videoManagerListPath'
=>
__MY_ROOT__
.
'static/upload/
video/'
.
input
(
'path_type'
,
'other'
)
.
'
/'
,
// 文件访问路径前缀
'videoManagerUrlPrefix'
=>
''
,
...
...
application/admin/controller/Admin.php
浏览文件 @
87590024
...
...
@@ -55,6 +55,7 @@ class Admin extends Common
'number'
=>
$number
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
url
(
'admin/admin/index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
...
...
application/admin/controller/Goods.php
浏览文件 @
87590024
...
...
@@ -131,6 +131,9 @@ class Goods extends Common
// 参数
$this
->
assign
(
'params'
,
$params
);
// 编辑器文件存放地址
$this
->
assign
(
'editor_path_type'
,
'goods'
);
return
$this
->
fetch
();
}
...
...
application/admin/controller/GoodsCategory.php
浏览文件 @
87590024
<?php
namespace
app\admin\controller
;
use
app\service\GoodsService
;
/**
* 分类管理
* @author Devil
...
...
@@ -44,7 +45,11 @@ class GoodsCategory extends Common
// 是否
$this
->
assign
(
'common_is_text_list'
,
lang
(
'common_is_text_list'
));
$this
->
display
(
'Index'
);
// 编辑器文件存放地址
$this
->
assign
(
'editor_path_type'
,
'goods_category'
);
return
$this
->
fetch
();
}
/**
...
...
@@ -62,43 +67,11 @@ class GoodsCategory extends Common
$this
->
error
(
lang
(
'common_unauthorized_access'
));
}
// 获取数据
$field
=
array
(
'id'
,
'pid'
,
'icon'
,
'name'
,
'sort'
,
'is_enable'
,
'bg_color'
,
'big_images'
,
'vice_name'
,
'describe'
,
'is_home_recommended'
);
$data
=
db
(
'GoodsCategory'
)
->
field
(
$field
)
->
where
(
array
(
'pid'
=>
intval
(
I
(
'id'
,
0
))))
->
select
();
if
(
!
empty
(
$data
))
{
$image_host
=
config
(
'IMAGE_HOST'
);
foreach
(
$data
as
&
$v
)
{
$v
[
'is_son'
]
=
$this
->
IsExistSon
(
$v
[
'id'
]);
$v
[
'ajax_url'
]
=
url
(
'Admin/GoodsCategory/GetNodeSon'
,
array
(
'id'
=>
$v
[
'id'
]));
$v
[
'delete_url'
]
=
url
(
'Admin/GoodsCategory/Delete'
);
$v
[
'icon_url'
]
=
empty
(
$v
[
'icon'
])
?
''
:
$image_host
.
$v
[
'icon'
];
$v
[
'big_images_url'
]
=
empty
(
$v
[
'big_images'
])
?
''
:
$image_host
.
$v
[
'big_images'
];
$v
[
'json'
]
=
json_encode
(
$v
);
}
}
$msg
=
empty
(
$data
)
?
lang
(
'common_not_data_tips'
)
:
lang
(
'common_operation_success'
);
$this
->
ajaxReturn
(
$msg
,
0
,
$data
);
// 开始操作
$ret
=
GoodsService
::
GoodsCategoryNodeSon
(
input
());
return
json
(
$ret
);
}
/**
* [IsExistSon 节点是否存在子数据]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-25T15:22:47+0800
* @param [int] $id [节点id]
* @return [string] [有数据ok, 则no]
*/
private
function
IsExistSon
(
$id
)
{
if
(
!
empty
(
$id
))
{
return
(
db
(
'GoodsCategory'
)
->
where
(
array
(
'pid'
=>
$id
))
->
count
()
>
0
)
?
'ok'
:
'no'
;
}
return
'no'
;
}
/**
* [Save 分类保存]
...
...
@@ -115,62 +88,9 @@ class GoodsCategory extends Common
$this
->
error
(
lang
(
'common_unauthorized_access'
));
}
// icon
$this
->
FileSave
(
'icon'
,
'file_icon'
,
'goods_category'
);
// 大图片
$this
->
FileSave
(
'big_images'
,
'file_big_images'
,
'goods_category'
);
// id为空则表示是新增
$m
=
D
(
'GoodsCategory'
);
// 公共额外数据处理
$m
->
sort
=
intval
(
I
(
'sort'
));
// 添加
if
(
empty
(
$_POST
[
'id'
]))
{
if
(
$m
->
create
(
$_POST
,
1
))
{
// 额外数据处理
$m
->
add_time
=
time
();
$m
->
name
=
I
(
'name'
);
$m
->
vice_name
=
I
(
'vice_name'
);
$m
->
describe
=
I
(
'describe'
);
$m
->
is_home_recommended
=
intval
(
I
(
'is_home_recommended'
,
0
));
// 写入数据库
if
(
$m
->
add
())
{
$this
->
ajaxReturn
(
lang
(
'common_operation_add_success'
));
}
else
{
$this
->
ajaxReturn
(
lang
(
'common_operation_add_error'
),
-
100
);
}
}
}
else
{
// 编辑
if
(
$m
->
create
(
$_POST
,
2
))
{
// 额外数据处理
$m
->
name
=
I
(
'name'
);
$m
->
upd_time
=
time
();
$m
->
vice_name
=
I
(
'vice_name'
);
$m
->
describe
=
I
(
'describe'
);
$m
->
is_home_recommended
=
intval
(
I
(
'is_home_recommended'
,
0
));
// 移除 id
unset
(
$m
->
id
,
$m
->
pid
);
// 更新数据库
if
(
$m
->
where
(
array
(
'id'
=>
I
(
'id'
)))
->
save
())
{
$this
->
ajaxReturn
(
lang
(
'common_operation_edit_success'
));
}
else
{
$this
->
ajaxReturn
(
lang
(
'common_operation_edit_error'
),
-
100
);
}
}
}
$this
->
ajaxReturn
(
$m
->
getError
(),
-
1
);
// 开始操作
$ret
=
GoodsService
::
GoodsCategorySave
(
input
());
return
json
(
$ret
);
}
/**
...
...
@@ -192,12 +112,12 @@ class GoodsCategory extends Common
{
if
(
$m
->
delete
(
I
(
'id'
)))
{
$this
->
ajaxRetur
n
(
lang
(
'common_operation_delete_success'
));
return
jso
n
(
lang
(
'common_operation_delete_success'
));
}
else
{
$this
->
ajaxRetur
n
(
lang
(
'common_operation_delete_error'
),
-
100
);
return
jso
n
(
lang
(
'common_operation_delete_error'
),
-
100
);
}
}
else
{
$this
->
ajaxRetur
n
(
$m
->
getError
(),
-
1
);
return
jso
n
(
$m
->
getError
(),
-
1
);
}
}
}
...
...
application/admin/controller/User.php
浏览文件 @
87590024
...
...
@@ -56,6 +56,7 @@ class User extends Common
'number'
=>
$number
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
url
(
'admin/user/index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
...
...
application/admin/lang/zh-cn.php
浏览文件 @
87590024
...
...
@@ -300,5 +300,20 @@ return array(
'goods_video_text'
=>
'短视频'
,
'goods_video_tips'
=>
'视频比图文更有具带入感,仅支持 mp4 格式'
,
// 商品分类
'goods_category_add_name'
=>
'分类添加'
,
'goods_category_edit_name'
=>
'分类编辑'
,
'goods_category_big_images_text'
=>
'大图片'
,
'goods_category_vice_name_text'
=>
'副名称'
,
'goods_category_vice_name_format'
=>
'副名称最大60个字符'
,
'goods_category_describe_text'
=>
'描述'
,
'goods_category_describe_format'
=>
'描述最大200个字符'
,
'goods_category_home_recommended_text'
=>
'首页推荐'
,
);
?>
\ No newline at end of file
application/admin/view/default/goods/save_info.html
浏览文件 @
87590024
...
...
@@ -137,7 +137,7 @@
{{/if}}
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.goods-recommended-images-view"
>
+上传图片
</div>
</div>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
{{:lang('goods_is_deduction_inventory_text')}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{:lang('goods_is_deduction_inventory_tips')}})
</span></label>
<input
name=
"is_deduction_inventory"
value=
"1"
type=
"checkbox"
data-off-text=
"{{:lang('common_operation_off_is_text')}}"
data-on-text=
"{{:lang('common_operation_on_is_text')}}"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
(
isset
($
data
['
is_deduction_inventory
'])
and
$
data
['
is_deduction_inventory
']
eq
1)
or
empty
($
data
)}}
checked=
"true"
{{/
if
}}
/>
...
...
@@ -321,7 +321,7 @@
<div
id=
"goods-nav-web"
class=
"division-block"
>
<label
class=
"block nav-detail-title"
>
{{:lang('goods_nav_web_name')}}
</label>
<div
class=
"am-form-group"
>
<textarea
class=
"am-radius am-validate"
name=
"content_web"
maxlength=
"105000"
id=
"editor-tag"
data-
url=
"{{:url('admin/ueditor/index', ['path_type'=>'goods_pc'])}}"
data-
validation-message=
"{{:lang('goods_content_web_format')}}"
>
{{if !empty($data)}}{{$data.content_web}}{{/if}}
</textarea>
<textarea
class=
"am-radius am-validate"
name=
"content_web"
maxlength=
"105000"
id=
"editor-tag"
data-validation-message=
"{{:lang('goods_content_web_format')}}"
>
{{if !empty($data)}}{{$data.content_web}}{{/if}}
</textarea>
</div>
</div>
...
...
application/admin/view/default/goodscategory/index.html
浏览文件 @
87590024
...
...
@@ -18,32 +18,32 @@
</div>
<div
class=
"am-popup-bd"
>
<!-- form start -->
<form
class=
"am-form form-validation admin-save"
action=
"{{:url('
Admin/GoodsCategory/S
ave')}}"
method=
"POST"
request-type=
"ajax-reload"
request-value=
""
>
<form
class=
"am-form form-validation admin-save"
action=
"{{:url('
admin/goodscategory/s
ave')}}"
method=
"POST"
request-type=
"ajax-reload"
request-value=
""
>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
{{:lang('common_icon_text')}}
</label>
<
button
type=
"button"
class=
"am-btn am-btn-default am-btn-sm am-radiu
s"
>
<i
class=
"am-icon-cloud-upload"
></i>
{{:lang('common_select_images_text')}}
</button
>
<input
type=
"text"
name=
"icon"
class=
"am-radius js-choice-one original-images-url original-icon-images-url"
data-choice-one-to=
'input[name="file_icon"]'
value=
""
data-validation-message=
"{{:lang('common_select_images_tips')}}"
readonly=
"readonly
"
/>
<i
class=
"am-icon-trash-o am-icon-sm original-images-url-delete"
data-input-tag=
"input.original-icon-images-url"
data-image-tag=
"#form-img-icon"
data-tips-tag=
"#form-icon-tips"
data-file-tag=
"input.file_icon-tag"
></i
>
<input
type=
"file"
name=
"file_icon"
multiple
data-validation-message=
"{{:lang('common_select_images_tips')}}"
accept=
"image/gif,image/jpeg,image/jpg,image/png"
class=
"js-choice-one images-file-event file_icon-tag"
data-choice-one-to=
".original-icon-images-url"
data-tips-tag=
"#form-icon-tips"
data-image-tag=
"#form-img-icon"
/
>
<
div
id=
"form-icon-tips"
class=
"m-t-5)}}</div
>
<
img src="
{{$
image_host
}}/
Public
/
Admin
/
Default
/
Images
/
default-images.png
"
id=
"form-img-icon"
class=
"block m-t-5 am-img-thumbnail am-radius"
width=
"50"
height=
"50"
data-default=
"{{$image_host}}/Public/Admin/Default/Images/default-images.png"
/
>
<
ul
class=
"plug-file-upload-view goods-category-icon-images-view"
data-form-name=
"icon"
data-max-number=
"1"
data-dialog-type=
"image
s"
>
<li
>
<input
type=
"hidden"
name=
"icon"
value=
"
"
/>
<img
class=
"icon-images-view"
src=
"{{$image_host}}/Public/admin/default/images/default-images.png"
/
>
</li
>
<
/ul
>
<
div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.goods-category-icon-images-view"
>
+上传图片
</div
>
</div>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
{{:lang('goods_category_big_images_text')}}
</label>
<
button
type=
"button"
class=
"am-btn am-btn-default am-btn-sm am-radiu
s"
>
<i
class=
"am-icon-cloud-upload"
></i>
{{:lang('common_select_images_text')}}
</button
>
<input
type=
"text"
name=
"big_images"
class=
"am-radius js-choice-one original-images-url original-big-images-url"
data-choice-one-to=
'input[name="file_big_images"]'
value=
""
data-validation-message=
"{{:lang('common_select_images_tips')}}"
readonly=
"readonly
"
/>
<i
class=
"am-icon-trash-o am-icon-sm original-images-url-delete"
data-input-tag=
".original-big-images-url"
data-image-tag=
"#form-img-big_images"
data-tips-tag=
"#form-big_images-tips"
data-file-tag=
"input.file_big_images-tag"
></i
>
<input
type=
"file"
name=
"file_big_images"
multiple
data-validation-message=
"{{:lang('common_select_images_tips')}}"
accept=
"image/gif,image/jpeg,image/jpg,image/png"
class=
"js-choice-one images-file-event file_big_images-tag"
data-choice-one-to=
".original-big-images-url"
data-tips-tag=
"#form-big_images-tips"
data-image-tag=
"#form-img-big_images"
/
>
<
div
id=
"form-big_images-tips"
class=
"m-t-5)}}</div
>
<
img src="
{{$
image_host
}}/
Public
/
Admin
/
Default
/
Images
/
default-images.png
"
id=
"form-img-big_images"
class=
"block m-t-5 am-img-thumbnail am-radius"
width=
"50"
height=
"50"
data-default=
"{{$image_host}}/Public/Admin/Default/Images/default-images.png"
/
>
<
ul
class=
"plug-file-upload-view goods-category-big_images-images-view"
data-form-name=
"big_images"
data-max-number=
"1"
data-dialog-type=
"image
s"
>
<li
>
<input
type=
"hidden"
name=
"big_images"
value=
"
"
/>
<img
class=
"big_images-images-view"
src=
"{{$image_host}}/Public/admin/default/images/default-images.png"
/
>
</li
>
<
/ul
>
<
div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.goods-category-big_images-images-view"
>
+上传图片
</div
>
</div>
<div
class=
"am-form-group"
>
<label>
{{:lang('common_background_color')}}
</label>
<input
type=
"hidden"
name=
"bg_color"
value=
""
/>
<button
class=
"am-btn am-btn-default colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r"
type=
"button"
data-input-tag=
"button.bg-color-tag"
data-color-tag=
"input[name='bg_color']"
data-color-style=
"background-color"
>
<img
src=
"
__PUBLIC__/Common/I
mages/colorpicker.png"
/>
<img
src=
"
{{$image_host}}/static/common/i
mages/colorpicker.png"
/>
</button>
</div>
<div
class=
"am-form-group"
>
...
...
@@ -61,8 +61,8 @@
<div
class=
"am-form-group"
>
<label>
{{:lang('goods_category_home_recommended_text')}}
</label>
<div>
<foreach
name=
"common_is_text_list"
item=
"v"
>
<label
class=
"am-radio-inline m-r-1
)}}
{{foreach $common_is_text_list as $v}}
<label
class=
"am-radio-inline m-r-1
0"
>
<input
type=
"radio"
name=
"is_home_recommended"
value=
"{{$v.id}}"
data-am-ucheck
/>
{{$v.name}}
</label>
{{/foreach}}
...
...
@@ -86,9 +86,9 @@
<!-- save win end -->
<!-- list start -->
<div
id=
"tree"
class=
"m-t-15"
data-rank=
"3"
data-additional=
'[{"field":"bg_color", "value":"", "type":"input"}, {"field":"bg_color", "value":"", "type":"css", "tag":"button.colorpicker-submit", "style":"background-color"}, {"field":"
file_icon", "value":"", "type":"file", "tag":"input.file_icon-tag"}, {"field":"icon", "value":"", "type":"input"}, {"field":"icon_url", "value":"{{$image_host}}/Public/Admin/Default/Images/default-images.png", "type":"attr", "tag":"#form-img-icon", "style":"src"}, {"value":"", "type":"html", "tag":"#form-icon-tips"}, {"field":"file_big_images", "value":"", "type":"file", "tag":"input.file_big_images-tag"}, {"field":"big_images", "value":"", "type":"input"}, {"field":"big_images_url", "value":"{{$image_host}}/Public/Admin/Default/Images/default-images.png", "type":"attr", "tag":"#form-img-big_images", "style":"src"}, {"value":"", "type":"html", "tag":"#form-big_images-tips
"}, {"field":"vice_name", "value":"", "type":"input"}, {"field":"describe", "value":"", "type":"textarea"}, {"field":"is_home_recommended", "value":"0", "type":"input"}]'
>
<div
id=
"tree"
class=
"m-t-15"
data-rank=
"3"
data-additional=
'[{"field":"bg_color", "value":"", "type":"input"}, {"field":"bg_color", "value":"", "type":"css", "tag":"button.colorpicker-submit", "style":"background-color"}, {"field":"
icon", "value":"", "type":"input"}, {"field":"icon_url", "value":"{{$image_host}}/static/admin/default/images/default-images.png", "type":"attr", "tag":".icon-images-view", "style":"src"}, {"field":"big_images", "value":"", "type":"input"}, {"field":"big_images_url", "value":"{{$image_host}}/static/admin/default/images/default-images.png", "type":"attr", "tag":".big_images-images-view", "style":"src
"}, {"field":"vice_name", "value":"", "type":"input"}, {"field":"describe", "value":"", "type":"textarea"}, {"field":"is_home_recommended", "value":"0", "type":"input"}]'
>
<div
class=
"m-t-30 t-c"
>
<img
src=
"
__PUBLIC__/Common/I
mages/loading.gif"
/>
<img
src=
"
{{$image_host}}/static/common/i
mages/loading.gif"
/>
<p>
{{:lang('common_form_loading_tips')}}
</p>
</div>
</div>
...
...
@@ -101,5 +101,5 @@
{{include file="public/footer" /}}
<!-- footer end -->
<script>
Tree
(
0
,
"
{{:url('
Admin/GoodsCategory/GetNodeS
on')}}
"
,
0
,
1
);
Tree
(
0
,
"
{{:url('
admin/goodscategory/getnodes
on')}}
"
,
0
,
1
);
</script>
\ No newline at end of file
application/admin/view/default/public/footer.html
浏览文件 @
87590024
<!-- commom html -->
{{include file="public/common" /}}
<textarea
id=
"upload-editor-view"
style=
"display: none;"
></textarea>
<textarea
id=
"upload-editor-view"
data-url=
"{{:url('admin/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}"
style=
"display: none;"
></textarea>
</body>
</html>
...
...
application/service/GoodsService.php
浏览文件 @
87590024
...
...
@@ -965,7 +965,7 @@ class GoodsService
// 其它附件
$data_fields
=
[
'home_recommended_images'
,
'video'
];
$attachment
=
self
::
GetGoods
AttachmentParams
(
$params
,
$data_fields
);
$attachment
=
ResourcesService
::
AttachmentParams
(
$params
,
$data_fields
);
if
(
$attachment
[
'code'
]
!=
0
)
{
return
$attachment
;
...
...
@@ -1238,30 +1238,6 @@ class GoodsService
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* 附件集合处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-08-07
* @desc description
* @param [array] $params [输入参数]
* @param [array] $data [字段列表]
*/
private
static
function
GetGoodsAttachmentParams
(
$params
,
$data
)
{
$result
=
[];
if
(
!
empty
(
$data
))
{
foreach
(
$data
as
$field
)
{
$result
[
$field
]
=
isset
(
$params
[
$field
])
?
ResourcesService
::
AttachmentPathHandle
(
$params
[
$field
])
:
''
;
}
}
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* 商品分类添加
* @author Devil
...
...
@@ -1833,5 +1809,117 @@ class GoodsService
}
return
DataReturn
(
'没有相关规格类型'
,
-
100
);
}
/**
* 获取商品分类节点数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-16T23:54:46+0800
* @param [array] $params [输入参数]
*/
public
static
function
GoodsCategoryNodeSon
(
$params
=
[])
{
// id
$id
=
isset
(
$params
[
'id'
])
?
intval
(
$params
[
'id'
])
:
0
;
// 获取数据
$field
=
'id,pid,icon,name,sort,is_enable,bg_color,big_images,vice_name,describe,is_home_recommended'
;
$data
=
db
(
'GoodsCategory'
)
->
field
(
$field
)
->
where
([
'pid'
=>
$id
])
->
select
();
if
(
!
empty
(
$data
))
{
$image_host
=
config
(
'IMAGE_HOST'
);
foreach
(
$data
as
&
$v
)
{
$v
[
'is_son'
]
=
(
db
(
'GoodsCategory'
)
->
where
([
'pid'
=>
$v
[
'id'
]])
->
count
()
>
0
)
?
'ok'
:
'no'
;
$v
[
'ajax_url'
]
=
url
(
'admin/goodscategory/getnodeson'
,
array
(
'id'
=>
$v
[
'id'
]));
$v
[
'delete_url'
]
=
url
(
'admin/goodscategory/delete'
);
$v
[
'icon_url'
]
=
empty
(
$v
[
'icon'
])
?
''
:
$image_host
.
$v
[
'icon'
];
$v
[
'big_images_url'
]
=
empty
(
$v
[
'big_images'
])
?
''
:
$image_host
.
$v
[
'big_images'
];
$v
[
'json'
]
=
json_encode
(
$v
);
}
return
DataReturn
(
'操作成功'
,
0
,
$data
);
}
return
DataReturn
(
'没有相关数据'
,
-
100
);
}
/**
* 商品分类保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-17T01:04:03+0800
* @param [array] $params [输入参数]
*/
public
static
function
GoodsCategorySave
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'length'
,
'key_name'
=>
'name'
,
'checked_data'
=>
'2,16'
,
'error_msg'
=>
'名称格式 2~16 个字符'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'vice_name'
,
'checked_data'
=>
'60'
,
'is_checked'
=>
1
,
'error_msg'
=>
'副名称格式 最多30个字符'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'describe'
,
'checked_data'
=>
'200'
,
'is_checked'
=>
1
,
'error_msg'
=>
'描述格式 最多200个字符'
,
],
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 其它附件
$data_fields
=
[
'icon'
,
'big_images'
];
$attachment
=
ResourcesService
::
AttachmentParams
(
$params
,
$data_fields
);
if
(
$attachment
[
'code'
]
!=
0
)
{
return
$attachment
;
}
// 数据
$data
=
[
'name'
=>
$params
[
'name'
],
'pid'
=>
isset
(
$params
[
'pid'
])
?
intval
(
$params
[
'pid'
])
:
0
,
'vice_name'
=>
isset
(
$params
[
'vice_name'
])
?
$params
[
'vice_name'
]
:
''
,
'describe'
=>
isset
(
$params
[
'describe'
])
?
$params
[
'describe'
]
:
''
,
'bg_color'
=>
isset
(
$params
[
'bg_color'
])
?
$params
[
'bg_color'
]
:
''
,
'is_home_recommended'
=>
isset
(
$params
[
'is_home_recommended'
])
?
intval
(
$params
[
'is_home_recommended'
])
:
0
,
'sort'
=>
isset
(
$params
[
'sort'
])
?
intval
(
$params
[
'sort'
])
:
0
,
'icon'
=>
$attachment
[
'data'
][
'icon'
],
'big_images'
=>
$attachment
[
'data'
][
'big_images'
],
];
// 添加
if
(
empty
(
$params
[
'id'
]))
{
$data
[
'add_time'
]
=
time
();
if
(
db
(
'GoodsCategory'
)
->
insertGetId
(
$data
)
>
0
)
{
return
DataReturn
(
'添加成功'
,
0
);
}
return
DataReturn
(
'添加失败'
,
-
100
);
}
else
{
$data
[
'upd_time'
]
=
time
();
if
(
db
(
'GoodsCategory'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
{
return
DataReturn
(
'编辑成功'
,
0
);
}
return
DataReturn
(
'编辑失败'
,
-
100
);
}
}
}
?>
\ No newline at end of file
application/service/ResourcesService.php
浏览文件 @
87590024
...
...
@@ -190,6 +190,30 @@ class ResourcesService
return
str_replace
([
__MY_URL__
,
__MY_ROOT__
],
DS
,
$value
);
}
/**
* 附件集合处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-08-07
* @desc description
* @param [array] $params [输入参数]
* @param [array] $data [字段列表]
*/
public
static
function
AttachmentParams
(
$params
,
$data
)
{
$result
=
[];
if
(
!
empty
(
$data
))
{
foreach
(
$data
as
$field
)
{
$result
[
$field
]
=
isset
(
$params
[
$field
])
?
self
::
AttachmentPathHandle
(
$params
[
$field
])
:
''
;
}
}
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* APP获取首页导航
* @author Devil
...
...
application/service/SearchService.php
浏览文件 @
87590024
...
...
@@ -95,11 +95,11 @@ class SearchService
}
if
(
!
empty
(
$params
[
'min_price'
]))
{
$where
[]
=
[
'g.price'
,
'EGT'
,
$params
[
'min_price'
]];
$where
[]
=
[
'g.
min_
price'
,
'EGT'
,
$params
[
'min_price'
]];
}
if
(
!
empty
(
$params
[
'max_price'
]))
{
$where
[]
=
[
'g.price'
,
'LT'
,
$params
[
'max_price'
]];
$where
[]
=
[
'g.
min_
price'
,
'LT'
,
$params
[
'max_price'
]];
}
// 获取商品总数
...
...
extend/base/Uploader.php
浏览文件 @
87590024
...
...
@@ -108,13 +108,14 @@ class Uploader
return
;
}
if
(
!
is_writeable
(
$dirname
))
{
$this
->
stateInfo
=
$this
->
getStateInfo
(
"ERROR_DIR_NOT_WRITEABLE"
);
return
;
}
//创建目录失败
if
(
!
is_dir
(
$dirname
)
&&
!
mkdir
(
$dirname
,
0777
,
true
))
{
$this
->
stateInfo
=
$this
->
getStateInfo
(
"ERROR_CREATE_DIR"
);
return
;
}
else
if
(
!
is_writeable
(
$dirname
))
{
$this
->
stateInfo
=
$this
->
getStateInfo
(
"ERROR_DIR_NOT_WRITEABLE"
);
return
;
}
//移动文件
...
...
public/static/common/lib/ueditor/themes/default/css/ueditor.css
浏览文件 @
87590024
...
...
@@ -1166,11 +1166,13 @@ div.edui-box {
word-wrap
:
break-word
;
word-break
:
normal
;
}
#edui_fixedlayer
{
z-index
:
1200
!important
;
}
/* 弹出对话框按钮和对话框大小 */
.edui-default
.edui-dialog
{
z-index
:
2000
;
position
:
absolute
;
z-index
:
1210
!important
;
}
.edui-dialog
div
{
...
...
@@ -1226,30 +1228,30 @@ div.edui-box {
}
.edui-default
.edui-dialog-titlebar
{
height
:
26
px
;
height
:
30
px
;
border-bottom
:
1px
solid
#c6c6c6
;
/*background: url(../images/dialog-title-bg.png) repeat-x bottom;*/
position
:
relative
;
cursor
:
move
;
background-color
:
#f5f5f5
;
border-top-right-radius
:
8
px
;
border-top-left-radius
:
8
px
;
border-top-right-radius
:
3
px
;
border-top-left-radius
:
3
px
;
}
.edui-default
.edui-dialog-caption
{
font-weight
:
bold
;
font-size
:
12px
;
line-height
:
26
px
;
line-height
:
30
px
;
padding-left
:
5px
;
}
.edui-default
.edui-dialog-draghandle
{
height
:
26
px
;
height
:
30
px
;
}
.edui-default
.edui-dialog-closebutton
{
position
:
absolute
!important
;
right
:
5px
;
top
:
3
px
;
top
:
5
px
;
}
.edui-default
.edui-dialog-closebutton
.edui-button-body
{
...
...
@@ -1265,8 +1267,8 @@ div.edui-box {
.edui-default
.edui-dialog-foot
{
height
:
40px
;
border-bottom-right-radius
:
8
px
;
border-bottom-left-radius
:
8
px
;
border-bottom-right-radius
:
3
px
;
border-bottom-left-radius
:
3
px
;
}
.edui-default
.edui-dialog-buttons
{
...
...
@@ -1304,7 +1306,7 @@ div.edui-box {
filter
:
alpha
(
opacity
=
30
);
background-color
:
#ccc
;
position
:
absolute
;
/*z-index: 1999;*/
z-index
:
1200
!important
;
}
.edui-default
.edui-dialog-dragmask
{
...
...
public/static/common/lib/ueditor/ueditor.config.js
浏览文件 @
87590024
...
...
@@ -24,7 +24,7 @@
/**
* 服务器地址
*/
var
SERVER_URL
=
$
(
'
#
editor-tag
'
).
data
(
'
url
'
);
var
SERVER_URL
=
$
(
'
#
upload-editor-view
'
).
data
(
'
url
'
);
/**
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录