Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
2a628b66
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,发现更多精彩内容 >>
提交
2a628b66
编写于
11月 09, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
0eec4a10
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
39 addition
and
25 deletion
+39
-25
service/Application/Admin/Controller/AlipayLifeController.class.php
...plication/Admin/Controller/AlipayLifeController.class.php
+1
-1
service/Application/Admin/Controller/BrandController.class.php
...ce/Application/Admin/Controller/BrandController.class.php
+1
-1
service/Application/Admin/Controller/CommonController.class.php
...e/Application/Admin/Controller/CommonController.class.php
+10
-10
service/Application/Admin/Controller/ExpressController.class.php
.../Application/Admin/Controller/ExpressController.class.php
+1
-1
service/Application/Admin/Controller/GoodsCategoryController.class.php
...cation/Admin/Controller/GoodsCategoryController.class.php
+2
-2
service/Application/Admin/Controller/GoodsController.class.php
...ce/Application/Admin/Controller/GoodsController.class.php
+15
-7
service/Application/Admin/Controller/PaymentController.class.php
.../Application/Admin/Controller/PaymentController.class.php
+1
-1
service/Application/Admin/Controller/SiteController.class.php
...ice/Application/Admin/Controller/SiteController.class.php
+2
-2
service/Application/Api/Controller/GoodsController.class.php
service/Application/Api/Controller/GoodsController.class.php
+6
-0
未找到文件。
service/Application/Admin/Controller/AlipayLifeController.class.php
浏览文件 @
2a628b66
...
...
@@ -202,7 +202,7 @@ class AlipayLifeController extends CommonController
}
// 图片
$this
->
Images
Save
(
'logo'
,
'file_logo'
,
'alipay_life'
);
$this
->
File
Save
(
'logo'
,
'file_logo'
,
'alipay_life'
);
// id为空则表示是新增
$m
=
D
(
'AlipayLife'
);
...
...
service/Application/Admin/Controller/BrandController.class.php
浏览文件 @
2a628b66
...
...
@@ -198,7 +198,7 @@ class BrandController extends CommonController
}
// 图片
$this
->
Images
Save
(
'logo'
,
'file_logo'
,
'brand'
);
$this
->
File
Save
(
'logo'
,
'file_logo'
,
'brand'
);
// id为空则表示是新增
$m
=
D
(
'Brand'
);
...
...
service/Application/Admin/Controller/CommonController.class.php
浏览文件 @
2a628b66
...
...
@@ -290,7 +290,7 @@ class CommonController extends Controller
}
/**
*
图片
删除
*
文件
删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -298,7 +298,7 @@ class CommonController extends Controller
* @desc description
* @param [string] $img [图片地址 path+name]
*/
protected
function
Images
Delete
(
$img
)
protected
function
File
Delete
(
$img
)
{
if
(
empty
(
$img
))
return
false
;
...
...
@@ -310,7 +310,7 @@ class CommonController extends Controller
}
/**
*
图片
批量删除
*
文件
批量删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -318,22 +318,22 @@ class CommonController extends Controller
* @desc description
* @param [array] $img_all [图片地址 path+name]
*/
protected
function
Images
DeleteAll
(
$img_all
)
protected
function
File
DeleteAll
(
$img_all
)
{
if
(
!
empty
(
$img_all
)
&&
is_array
(
$img_all
))
{
for
(
$i
=
0
;
$i
<
count
(
$img_all
);
$i
++
)
{
$this
->
Images
Delete
(
$img_all
[
$i
]);
$this
->
Images
Delete
(
str_replace
([
'compr'
,
'small'
],
'small'
,
$img_all
[
$i
]));
$this
->
Images
Delete
(
str_replace
([
'compr'
,
'small'
],
'compr'
,
$img_all
[
$i
]));
$this
->
Images
Delete
(
str_replace
([
'compr'
,
'small'
],
'original'
,
$img_all
[
$i
]));
$this
->
File
Delete
(
$img_all
[
$i
]);
$this
->
File
Delete
(
str_replace
([
'compr'
,
'small'
],
'small'
,
$img_all
[
$i
]));
$this
->
File
Delete
(
str_replace
([
'compr'
,
'small'
],
'compr'
,
$img_all
[
$i
]));
$this
->
File
Delete
(
str_replace
([
'compr'
,
'small'
],
'original'
,
$img_all
[
$i
]));
}
}
}
/**
*
图片
存储
*
文件
存储
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -343,7 +343,7 @@ class CommonController extends Controller
* @param [string] $post_name [file form name名称]
* @param [string] $dir [存储路径标记]
*/
protected
function
Images
Save
(
$field
,
$post_name
,
$dir
=
'common'
)
protected
function
File
Save
(
$field
,
$post_name
,
$dir
=
'common'
)
{
if
(
isset
(
$_FILES
[
$post_name
][
'error'
]))
{
...
...
service/Application/Admin/Controller/ExpressController.class.php
浏览文件 @
2a628b66
...
...
@@ -94,7 +94,7 @@ class ExpressController extends CommonController
}
// 图片
$this
->
Images
Save
(
'icon'
,
'file_icon'
,
'express'
);
$this
->
File
Save
(
'icon'
,
'file_icon'
,
'express'
);
// id为空则表示是新增
$m
=
D
(
'Express'
);
...
...
service/Application/Admin/Controller/GoodsCategoryController.class.php
浏览文件 @
2a628b66
...
...
@@ -116,10 +116,10 @@ class GoodsCategoryController extends CommonController
}
// icon
$this
->
Images
Save
(
'icon'
,
'file_icon'
,
'goods_category'
);
$this
->
File
Save
(
'icon'
,
'file_icon'
,
'goods_category'
);
// 大图片
$this
->
Images
Save
(
'big_images'
,
'file_big_images'
,
'goods_category'
);
$this
->
File
Save
(
'big_images'
,
'file_big_images'
,
'goods_category'
);
// id为空则表示是新增
$m
=
D
(
'GoodsCategory'
);
...
...
service/Application/Admin/Controller/GoodsController.class.php
浏览文件 @
2a628b66
...
...
@@ -342,7 +342,11 @@ class GoodsController extends CommonController
// 添加/编辑
$m
=
D
(
'Goods'
);
$type
=
empty
(
$_POST
[
'id'
])
?
1
:
2
;
// 商品
$goods_id
=
I
(
'id'
);
$goods
=
$m
->
find
(
$goods_id
);
$type
=
empty
(
$goods
)
?
1
:
2
;
if
(
$m
->
create
(
$_POST
,
$type
))
{
// 开启事务
...
...
@@ -356,14 +360,12 @@ class GoodsController extends CommonController
}
else
{
// 更新
$data
[
'upd_time'
]
=
time
();
if
(
$m
->
where
([
'id'
=>
I
(
'id'
)
])
->
save
(
$data
)
===
false
)
if
(
$m
->
where
([
'id'
=>
$goods_id
])
->
save
(
$data
)
===
false
)
{
// 回滚事务
$m
->
rollback
();
$this
->
ajaxReturn
(
L
(
'common_operation_edit_error'
),
-
100
);
}
else
{
$goods_id
=
I
(
'id'
);
}
}
...
...
@@ -410,6 +412,12 @@ class GoodsController extends CommonController
// 提交事务
$m
->
commit
();
// 删除原来的视频
if
(
!
empty
(
$goods
[
'video'
])
&&
!
empty
(
$video
[
'data'
][
'file_video'
][
'url'
]))
{
$this
->
FileDelete
(
$goods
[
'video'
]);
}
// 提示
if
(
$type
==
1
)
{
...
...
@@ -547,7 +555,7 @@ class GoodsController extends CommonController
$result
[
$key
[
1
]][
$key
[
0
]]
=
DS
.
$path
.
'compr'
.
$date
.
$small
;
}
else
{
// 如果图片格式有误,则删除原图片
$this
->
Images
Delete
(
$path
.
'original'
.
$date
.
$original
);
$this
->
File
Delete
(
$path
.
'original'
.
$date
.
$original
);
}
}
}
...
...
@@ -616,7 +624,7 @@ class GoodsController extends CommonController
$result
[]
=
DS
.
$path
.
'compr'
.
$date
.
$small
;
}
else
{
// 如果图片格式有误,则删除原图片
$this
->
Images
Delete
(
$path
.
'original'
.
$date
.
$original
);
$this
->
File
Delete
(
$path
.
'original'
.
$date
.
$original
);
}
}
}
...
...
@@ -677,7 +685,7 @@ class GoodsController extends CommonController
$result
[
$field
]
=
DS
.
$path
.
'compr'
.
$date
.
$small
;
}
else
{
// 如果图片格式有误,则删除原图片
$this
->
Images
Delete
(
$path
.
'original'
.
$date
.
$original
);
$this
->
File
Delete
(
$path
.
'original'
.
$date
.
$original
);
}
}
}
...
...
service/Application/Admin/Controller/PaymentController.class.php
浏览文件 @
2a628b66
...
...
@@ -205,7 +205,7 @@ class PaymentController extends CommonController
}
// 图片
$this
->
Images
Save
(
'logo'
,
'file_logo'
,
'payment'
);
$this
->
File
Save
(
'logo'
,
'file_logo'
,
'payment'
);
// id为空则表示是新增
$m
=
D
(
'Payment'
);
...
...
service/Application/Admin/Controller/SiteController.class.php
浏览文件 @
2a628b66
...
...
@@ -72,8 +72,8 @@ class SiteController extends CommonController
public
function
Save
()
{
// logo存储
$this
->
Images
Save
(
'home_site_logo'
,
'home_site_logo_img'
);
$this
->
Images
Save
(
'home_site_logo_wap'
,
'home_site_logo_wap_img'
);
$this
->
File
Save
(
'home_site_logo'
,
'home_site_logo_img'
);
$this
->
File
Save
(
'home_site_logo_wap'
,
'home_site_logo_wap_img'
);
// 站点状态值处理
if
(
!
isset
(
$_POST
[
'home_user_reg_state'
]))
...
...
service/Application/Api/Controller/GoodsController.class.php
浏览文件 @
2a628b66
...
...
@@ -55,6 +55,9 @@ class GoodsController extends CommonController
// 是否已收藏
$goods
[
'is_favor'
]
=
$this
->
IsGoodsUserFavor
(
$goods_id
);
// 视频
$goods
[
'video'
]
=
empty
(
$goods
[
'video'
])
?
null
:
C
(
'IMAGE_HOST'
)
.
$goods
[
'video'
];
$result
=
[
// 商品基础数据
'goods'
=>
$goods
,
...
...
@@ -67,6 +70,9 @@ class GoodsController extends CommonController
// 属性
'attribute'
=>
$this
->
GetGoodsAttribute
(
$goods_id
),
// 客服电话
'customer_service_tel'
=>
MyC
(
'common_customer_service_tel'
),
];
$this
->
ajaxReturn
(
L
(
'common_operation_success'
),
0
,
$result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录