Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
65554306
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65554306
编写于
7月 06, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
web端仓库优化适配多商户
上级
ae9b15fd
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
82 addition
and
18 deletion
+82
-18
application/admin/controller/Admin.php
application/admin/controller/Admin.php
+2
-1
application/admin/controller/Common.php
application/admin/controller/Common.php
+2
-1
application/admin/view/default/order/module/goods.html
application/admin/view/default/order/module/goods.html
+7
-1
application/common.php
application/common.php
+5
-0
application/index/controller/Common.php
application/index/controller/Common.php
+1
-1
application/index/view/default/buy/index.html
application/index/view/default/buy/index.html
+7
-1
application/index/view/default/order/detail.html
application/index/view/default/order/detail.html
+7
-1
application/index/view/default/order/module/goods.html
application/index/view/default/order/module/goods.html
+7
-1
application/service/ResourcesService.php
application/service/ResourcesService.php
+4
-3
application/service/SystemBaseService.php
application/service/SystemBaseService.php
+13
-0
application/service/UeditorService.php
application/service/UeditorService.php
+2
-1
application/service/UserService.php
application/service/UserService.php
+3
-2
application/service/WarehouseService.php
application/service/WarehouseService.php
+9
-4
extend/base/Qrcode.php
extend/base/Qrcode.php
+2
-1
public/static/common/css/common.css
public/static/common/css/common.css
+11
-0
public/static/common/images/default-warehouse-icon.png
public/static/common/images/default-warehouse-icon.png
+0
-0
未找到文件。
application/admin/controller/Admin.php
浏览文件 @
65554306
...
...
@@ -12,6 +12,7 @@ namespace app\admin\controller;
use
think\facade\Hook
;
use
app\service\AdminService
;
use
app\service\SystemBaseService
;
/**
* 管理员
...
...
@@ -263,7 +264,7 @@ class Admin extends Common
$this
->
assign
(
'admin_login_type'
,
MyC
(
'admin_login_type'
,
[],
true
));
// 背景图片
$host
=
config
(
'shopxo.attachment_host'
);
$host
=
SystemBaseService
::
AttachmentHost
(
);
$bg_images_list
=
[
$host
.
'/static/admin/default/images/login/1.jpg'
,
$host
.
'/static/admin/default/images/login/2.jpg'
,
...
...
application/admin/controller/Common.php
浏览文件 @
65554306
...
...
@@ -18,6 +18,7 @@ use app\service\AdminPowerService;
use
app\service\ConfigService
;
use
app\service\ResourcesService
;
use
app\service\StoreService
;
use
app\service\SystemBaseService
;
/**
* 管理员公共控制器
...
...
@@ -248,7 +249,7 @@ class Common extends Controller
$this
->
assign
(
'default_price_regex'
,
lang
(
'common_regex_price'
));
// 附件host地址
$this
->
assign
(
'attachment_host'
,
config
(
'shopxo.attachment_host'
));
$this
->
assign
(
'attachment_host'
,
SystemBaseService
::
AttachmentHost
(
));
// css/js引入host地址
$this
->
assign
(
'public_host'
,
config
(
'shopxo.public_host'
));
...
...
application/admin/view/default/order/module/goods.html
浏览文件 @
65554306
...
...
@@ -38,7 +38,13 @@
<!-- 仓库信息 -->
{{if !empty($module_data['warehouse_name'])}}
<span
class=
"warehouse-item-container am-fr"
>
{{if !empty($module_data['warehouse_icon'])}}
<i
class=
"{{$module_data.warehouse_icon}}"
></i>
{{/if}}
{{if !empty($module_data['warehouse_icon'])}}
{{if IsUrl($module_data['warehouse_icon'])}}
<img
src=
"{{$module_data.warehouse_icon}}"
alt=
"{{$module_data.warehouse_name}}"
class=
"warehouse-icon"
/>
{{else /}}
<i
class=
"{{$module_data.warehouse_icon}}"
></i>
{{/if}}
{{/if}}
{{if empty($module_data['warehouse_url'])}}
<strong
class=
"warehouse-name"
>
{{$module_data.warehouse_name}}
</strong>
{{else /}}
...
...
application/common.php
浏览文件 @
65554306
...
...
@@ -11,6 +11,11 @@
// 应用公共文件
function
IsUrl
(
$value
)
{
return
in_array
(
substr
(
$value
,
0
,
6
),
[
'https:'
,
'http:/'
]);
}
/**
* 文件快速排序
* @author Devil
...
...
application/index/controller/Common.php
浏览文件 @
65554306
...
...
@@ -363,7 +363,7 @@ class Common extends Controller
$this
->
assign
(
'default_price_regex'
,
lang
(
'common_regex_price'
));
// 附件host地址
$this
->
assign
(
'attachment_host'
,
config
(
'shopxo.attachment_host'
));
$this
->
assign
(
'attachment_host'
,
SystemBaseService
::
AttachmentHost
(
));
// css/js引入host地址
$this
->
assign
(
'public_host'
,
config
(
'shopxo.public_host'
));
...
...
application/index/view/default/buy/index.html
浏览文件 @
65554306
...
...
@@ -264,7 +264,13 @@
<!-- 仓库信息 -->
<span
class=
"warehouse-item-container"
>
{{if !empty($v['icon'])}}
<i
class=
"{{$v.icon}}"
></i>
{{/if}}
{{if !empty($v['icon'])}}
{{if IsUrl($v['icon'])}}
<img
src=
"{{$v.icon}}"
alt=
"{{$v.name}}"
class=
"warehouse-icon"
/>
{{else /}}
<i
class=
"{{$v.icon}}"
></i>
{{/if}}
{{/if}}
{{if empty($v['url'])}}
<strong
class=
"warehouse-name"
>
{{$v.name}}
</strong>
{{else /}}
...
...
application/index/view/default/order/detail.html
浏览文件 @
65554306
...
...
@@ -142,7 +142,13 @@
<div
class=
"items-title am-fl"
>
出货服务:
</div>
<div
class=
"items-detail am-fl"
>
<span
class=
"warehouse-item-container"
>
{{if !empty($data['warehouse_icon'])}}
<i
class=
"{{$data.warehouse_icon}}"
></i>
{{/if}}
{{if !empty($data['warehouse_icon'])}}
{{if IsUrl($data['warehouse_icon'])}}
<img
src=
"{{$data.warehouse_icon}}"
alt=
"{{$data.warehouse_name}}"
class=
"warehouse-icon"
/>
{{else /}}
<i
class=
"{{$data.warehouse_icon}}"
></i>
{{/if}}
{{/if}}
{{if empty($data['warehouse_url'])}}
<strong
class=
"warehouse-name"
>
{{$data.warehouse_name}}
</strong>
{{else /}}
...
...
application/index/view/default/order/module/goods.html
浏览文件 @
65554306
...
...
@@ -30,7 +30,13 @@
<!-- 仓库信息 -->
{{if !empty($module_data['warehouse_name'])}}
<span
class=
"warehouse-item-container am-fr"
>
{{if !empty($module_data['warehouse_icon'])}}
<i
class=
"{{$module_data.warehouse_icon}}"
></i>
{{/if}}
{{if !empty($module_data['warehouse_icon'])}}
{{if IsUrl($module_data['warehouse_icon'])}}
<img
src=
"{{$module_data.warehouse_icon}}"
alt=
"{{$module_data.warehouse_name}}"
class=
"warehouse-icon"
/>
{{else /}}
<i
class=
"{{$module_data.warehouse_icon}}"
></i>
{{/if}}
{{/if}}
{{if empty($module_data['warehouse_url'])}}
<strong
class=
"warehouse-name"
>
{{$module_data.warehouse_name}}
</strong>
{{else /}}
...
...
application/service/ResourcesService.php
浏览文件 @
65554306
...
...
@@ -13,6 +13,7 @@ namespace app\service;
use
think\Db
;
use
think\facade\Hook
;
use
app\service\UserService
;
use
app\service\SystemBaseService
;
/**
* 资源服务层
...
...
@@ -36,7 +37,7 @@ class ResourcesService
public
static
function
ContentStaticReplace
(
$content
,
$type
=
'get'
)
{
// 配置文件附件url地址
$attachment_host
=
config
(
'shopxo.attachment_host'
);
$attachment_host
=
SystemBaseService
::
AttachmentHost
(
);
if
(
empty
(
$attachment_host
))
{
$attachment_host
=
substr
(
__MY_PUBLIC_URL__
,
0
,
-
1
);
...
...
@@ -75,7 +76,7 @@ class ResourcesService
public
static
function
AttachmentPathHandle
(
$value
)
{
// 配置文件附件url地址
$attachment_host
=
config
(
'shopxo.attachment_host'
);
$attachment_host
=
SystemBaseService
::
AttachmentHost
(
);
$attachment_host_path
=
empty
(
$attachment_host
)
?
__MY_PUBLIC_URL__
:
$attachment_host
.
DS
;
// 替换处理
...
...
@@ -125,7 +126,7 @@ class ResourcesService
{
if
(
substr
(
$value
,
0
,
4
)
!=
'http'
)
{
return
config
(
'shopxo.attachment_host'
)
.
$value
;
return
SystemBaseService
::
AttachmentHost
(
)
.
$value
;
}
return
$value
;
}
...
...
application/service/SystemBaseService.php
浏览文件 @
65554306
...
...
@@ -474,5 +474,18 @@ class SystemBaseService
// 获取内容
return
ConfigService
::
ConfigContentRow
(
'common_agreement_'
.
$params
[
'document'
]);
}
/**
* 附件地址
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-07-06
* @desc description
*/
public
static
function
AttachmentHost
()
{
return
config
(
'shopxo.attachment_host'
);
}
}
?>
\ No newline at end of file
application/service/UeditorService.php
浏览文件 @
65554306
...
...
@@ -11,6 +11,7 @@
namespace
app\service
;
use
app\service\ResourcesService
;
use
app\service\SystemBaseService
;
/**
* 百度编辑器附件服务层
...
...
@@ -275,7 +276,7 @@ class UeditorService
$field_name
=
self
::
$current_config
[
'catcherFieldName'
];
// 当前站点域名或者附件域名不下载
$attachment_host
=
GetUrlHost
(
config
(
'shopxo.attachment_host'
));
$attachment_host
=
GetUrlHost
(
SystemBaseService
::
AttachmentHost
(
));
// 抓取远程图片
$list
=
array
();
...
...
application/service/UserService.php
浏览文件 @
65554306
...
...
@@ -15,6 +15,7 @@ use think\facade\Hook;
use
app\service\RegionService
;
use
app\service\SafetyService
;
use
app\service\ResourcesService
;
use
app\service\SystemBaseService
;
/**
* 用户服务层
...
...
@@ -156,7 +157,7 @@ class UserService
{
$v
[
'avatar'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'avatar'
]);
}
else
{
$v
[
'avatar'
]
=
config
(
'shopxo.attachment_host'
)
.
'/static/index/'
.
strtolower
(
MyC
(
'common_default_theme'
,
'default'
,
true
))
.
'/images/default-user-avatar.jpg'
;
$v
[
'avatar'
]
=
SystemBaseService
::
AttachmentHost
(
)
.
'/static/index/'
.
strtolower
(
MyC
(
'common_default_theme'
,
'default'
,
true
))
.
'/images/default-user-avatar.jpg'
;
}
}
...
...
@@ -512,7 +513,7 @@ class UserService
{
$user
[
'avatar'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$user
[
'avatar'
]);
}
else
{
$user
[
'avatar'
]
=
config
(
'shopxo.attachment_host'
)
.
'/static/index/'
.
strtolower
(
config
(
'DEFAULT_THEME'
,
'default'
))
.
'/images/default-user-avatar.jpg'
;
$user
[
'avatar'
]
=
SystemBaseService
::
AttachmentHost
(
)
.
'/static/index/'
.
strtolower
(
config
(
'DEFAULT_THEME'
,
'default'
))
.
'/images/default-user-avatar.jpg'
;
}
// 移除特殊数据
...
...
application/service/WarehouseService.php
浏览文件 @
65554306
...
...
@@ -14,6 +14,7 @@ use think\Db;
use
think\facade\Hook
;
use
app\service\RegionService
;
use
app\service\WarehouseGoodsService
;
use
app\service\SystemBaseService
;
/**
* 仓库服务层
...
...
@@ -71,6 +72,12 @@ class WarehouseService
$region
=
Db
::
name
(
'Region'
)
->
where
([
'id'
=>
$ids
])
->
column
(
'name'
,
'id'
);
}
// 附件地址
$host
=
SystemBaseService
::
AttachmentHost
();
// 仓库icon
$warehouse_icon
=
$host
.
'/static/common/images/default-warehouse-icon.png'
;
// 循环处理数据
foreach
(
$data
as
&
$v
)
{
...
...
@@ -87,10 +94,8 @@ class WarehouseService
'warehouse_id'
=>
$data_id
,
]);
// icon
$v
[
'icon'
]
=
'am-icon-cube'
;
// url地址
// icon、url地址
$v
[
'icon'
]
=
$warehouse_icon
;
$v
[
'url'
]
=
''
;
// 地区
...
...
extend/base/Qrcode.php
浏览文件 @
65554306
...
...
@@ -11,6 +11,7 @@
namespace
base
;
use
app\service\ResourcesService
;
use
app\service\SystemBaseService
;
/**
* 二维码驱动
...
...
@@ -188,7 +189,7 @@ class Qrcode
// 验证下载地址域名
$domain_arr
=
[
GetUrlHost
(
config
(
'shopxo.attachment_host'
)),
GetUrlHost
(
SystemBaseService
::
AttachmentHost
(
)),
GetUrlHost
(
__MY_HOST__
),
];
if
(
!
in_array
(
GetUrlHost
(
$url
),
$domain_arr
))
...
...
public/static/common/css/common.css
浏览文件 @
65554306
...
...
@@ -834,4 +834,15 @@ button.colorpicker-submit img {
form
.am-panel
.am-form-group
:last-child
,
form
.am-panel
.business-form-group
:last-child
{
border-bottom
:
0
;
}
/**
* 仓库信息
*/
.warehouse-item-container
*
{
vertical-align
:
middle
;
}
.warehouse-item-container
.warehouse-icon
{
widows
:
14px
;
height
:
14px
;
}
\ No newline at end of file
public/static/common/images/default-warehouse-icon.png
0 → 100644
浏览文件 @
65554306
2.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录