Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
ce879745
ShopXO
项目概览
飞鱼0526
/
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,发现更多精彩内容 >>
提交
ce879745
编写于
7月 07, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
细节调整
上级
1762b2d6
变更
13
展开全部
显示空白变更内容
内联
并排
Showing
13 changed file
with
151 addition
and
64 deletion
+151
-64
application/admin/form/Goodscomments.php
application/admin/form/Goodscomments.php
+1
-1
application/admin/form/Order.php
application/admin/form/Order.php
+1
-1
application/admin/form/Orderaftersale.php
application/admin/form/Orderaftersale.php
+1
-1
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+1
-1
application/admin/view/default/goodscomments/module/goods.html
...cation/admin/view/default/goodscomments/module/goods.html
+0
-0
application/admin/view/default/order/detail.html
application/admin/view/default/order/detail.html
+1
-1
application/admin/view/default/order/module/goods.html
application/admin/view/default/order/module/goods.html
+2
-17
application/admin/view/default/orderaftersale/module/goods.html
...ation/admin/view/default/orderaftersale/module/goods.html
+0
-0
application/service/BuyService.php
application/service/BuyService.php
+98
-28
application/service/GoodsService.php
application/service/GoodsService.php
+6
-5
application/service/NavigationService.php
application/service/NavigationService.php
+12
-4
application/service/OrderService.php
application/service/OrderService.php
+26
-3
config/shopxo.sql
config/shopxo.sql
+2
-2
未找到文件。
application/admin/form/Goodscomments.php
浏览文件 @
ce879745
...
...
@@ -60,7 +60,7 @@ class Goodscomments
[
'label'
=>
'基础信息'
,
'view_type'
=>
'module'
,
'view_key'
=>
'goodscomments/module/
info
'
,
'view_key'
=>
'goodscomments/module/
goods
'
,
'grid_size'
=>
'lg'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
...
...
application/admin/form/Order.php
浏览文件 @
ce879745
...
...
@@ -73,7 +73,7 @@ class Order
[
'label'
=>
'基础信息'
,
'view_type'
=>
'module'
,
'view_key'
=>
'order/module/
info
'
,
'view_key'
=>
'order/module/
goods
'
,
'grid_size'
=>
'lg'
,
'is_detail'
=>
0
,
'search_config'
=>
[
...
...
application/admin/form/Orderaftersale.php
浏览文件 @
ce879745
...
...
@@ -58,7 +58,7 @@ class Orderaftersale
[
'label'
=>
'基础信息'
,
'view_type'
=>
'module'
,
'view_key'
=>
'orderaftersale/module/
info
'
,
'view_key'
=>
'orderaftersale/module/
goods
'
,
'grid_size'
=>
'lg'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
...
...
application/admin/view/default/goods/save_info.html
浏览文件 @
ce879745
...
...
@@ -344,7 +344,7 @@
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"
1"
max=
"100000000"
pattern=
"^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$"
data-validation-message=
"库存数量 1
~100000000"
required
/>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"
0"
max=
"100000000"
pattern=
"^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$"
data-validation-message=
"库存数量 0
~100000000"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_weight[]"
placeholder=
"重量"
class=
"am-radius"
maxlength=
"80"
min=
"0.00"
max=
"100000000.00"
step=
"0.01"
data-validation-message=
"规格重量 0.00~100000000.00"
/>
...
...
application/admin/view/default/goodscomments/module/
info
.html
→
application/admin/view/default/goodscomments/module/
goods
.html
浏览文件 @
ce879745
文件已移动
application/admin/view/default/order/detail.html
浏览文件 @
ce879745
...
...
@@ -11,7 +11,7 @@
<div
class=
"am-panel-hd"
>
订单商品
</div>
<div
class=
"am-panel-bd"
>
{{if !empty($data['items'])}}
{{:ModuleInclude('order/module/info', $data
, ['form_request_type'=>'detail']
)}}
{{:ModuleInclude('order/module/info', $data)}}
{{else /}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
{{/if}}
...
...
application/admin/view/default/order/module/
info
.html
→
application/admin/view/default/order/module/
goods
.html
浏览文件 @
ce879745
<!-- 订单
基础
信息 -->
<!-- 订单
商品
信息 -->
{{if !empty($module_data) and !empty($module_data['items'])}}
{{foreach $module_data.items as $
key=>$
item}}
{{foreach $module_data.items as $item}}
<div
class=
"am-nbfc am-padding-vertical-xs"
>
<div
class=
"base am-nbfc"
>
<a
href=
"{{:MyUrl('index/goods/index', ['id'=>$item['goods_id']])}}"
target=
"_blank"
title=
"{{$item.title}}"
>
...
...
@@ -21,21 +21,6 @@
</div>
</div>
<hr
data-am-widget=
"divider"
class=
"am-divider am-divider-dashed am-margin-vertical-0"
/>
{{if $key eq 0}}
{{if !isset($module_params['form_request_type']) or $module_params['form_request_type'] neq 'detail'}}
{{php}}break;{{/php}}
{{/if}}
{{/if}}
{{/foreach}}
<div
class=
"am-margin-top-sm"
>
{{$module_data.describe}}
</div>
{{if count($module_data.items) gt 1}}
{{if !isset($module_params['form_request_type']) or $module_params['form_request_type'] neq 'detail'}}
<div
class=
"am-text-center"
>
<button
type=
"button"
class=
"am-btn am-btn-link am-btn-xs am-radius submit-popup"
data-url=
"{{:MyUrl('admin/order/detail', ['id'=>$module_data['id']])}}"
>
<i
class=
"am-icon-caret-down"
></i>
<span>
查看更多
</span>
</button>
</div>
{{/if}}
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/orderaftersale/module/
info
.html
→
application/admin/view/default/orderaftersale/module/
goods
.html
浏览文件 @
ce879745
文件已移动
application/service/BuyService.php
浏览文件 @
ce879745
...
...
@@ -987,17 +987,16 @@ class BuyService
}
// 支付方式
$payment_id
=
0
;
$is_under_line
=
0
;
$payment
=
[];
if
(
!
empty
(
$params
[
'payment_id'
]))
{
$pay
men
t
=
PaymentService
::
PaymentList
([
'where'
=>
[
'id'
=>
intval
(
$params
[
'payment_id'
])]]);
if
(
empty
(
$pay
men
t
[
0
]))
$pay
_re
t
=
PaymentService
::
PaymentList
([
'where'
=>
[
'id'
=>
intval
(
$params
[
'payment_id'
])]]);
if
(
empty
(
$pay
_re
t
[
0
]))
{
return
DataReturn
(
'支付方式有误'
,
-
1
);
}
else
{
$payment
=
$pay_ret
[
0
];
}
$payment_id
=
$payment
[
0
][
'id'
];
$is_under_line
=
in_array
(
$payment
[
0
][
'payment'
],
config
(
'shopxo.under_line_list'
))
?
1
:
0
;
}
// 是否仅一个商品并且商品自定义类型
...
...
@@ -1011,25 +1010,84 @@ class BuyService
}
}
// 订单
主信息
// 订单
信息处理
$order
=
[
'order_no'
=>
date
(
'YmdHis'
)
.
GetNumberCode
(
6
),
'user_id'
=>
$params
[
'user'
][
'id'
],
'user_note'
=>
isset
(
$params
[
'user_note'
])
?
str_replace
([
'"'
,
"'"
],
''
,
strip_tags
(
$params
[
'user_note'
]))
:
''
,
'status'
=>
(
intval
(
MyC
(
'common_order_is_booking'
,
0
))
==
1
)
?
0
:
1
,
'preferential_price'
=>
(
$buy
[
'data'
][
'base'
][
'preferential_price'
]
<=
0.00
)
?
0.00
:
$buy
[
'data'
][
'base'
][
'preferential_price'
],
'increase_price'
=>
(
$buy
[
'data'
][
'base'
][
'increase_price'
]
<=
0.00
)
?
0.00
:
$buy
[
'data'
][
'base'
][
'increase_price'
],
'price'
=>
(
$buy
[
'data'
][
'base'
][
'total_price'
]
<=
0.00
)
?
0.00
:
$buy
[
'data'
][
'base'
][
'total_price'
],
'total_price'
=>
(
$buy
[
'data'
][
'base'
][
'actual_price'
]
<=
0.00
)
?
0.00
:
$buy
[
'data'
][
'base'
][
'actual_price'
],
'extension_data'
=>
empty
(
$buy
[
'data'
][
'extension_data'
])
?
''
:
json_encode
(
$buy
[
'data'
][
'extension_data'
]),
'payment_id'
=>
$payment_id
,
'buy_number_count'
=>
array_sum
(
array_column
(
$buy
[
'data'
][
'goods'
],
'stock'
)),
'client_type'
=>
(
APPLICATION_CLIENT_TYPE
==
'pc'
&&
IsMobile
())
?
'h5'
:
APPLICATION_CLIENT_TYPE
,
'order_model'
=>
$site_model
,
'is_under_line'
=>
$is_under_line
,
'add_time'
=>
time
(),
];
if
(
$order
[
'status'
]
==
1
)
// 添加订单处理
return
self
::
OrderInsertHandle
(
$order
,
$buy
[
'data'
][
'goods'
],
$address
,
$params
[
'user'
],
$payment
,
$site_model
,
$params
);
}
public
static
function
OrderInsertHandle
(
$order
,
$goods
,
$address
,
$user
,
$payment
,
$site_model
,
$params
=
[])
{
// 订单信息处理
// 订单号没有则自动生成
if
(
!
isset
(
$order
[
'order_no'
]))
{
$order
[
'order_no'
]
=
date
(
'YmdHis'
)
.
GetNumberCode
(
6
);
}
// 订单模式
if
(
!
isset
(
$order
[
'order_model'
]))
{
$order
[
'order_model'
]
=
$site_model
;
}
// 订单状态
if
(
!
isset
(
$order
[
'status'
]))
{
$order
[
'status'
]
=
(
intval
(
MyC
(
'common_order_is_booking'
,
0
))
==
1
)
?
0
:
1
;
}
// 用户 id
if
(
!
isset
(
$order
[
'user_id'
])
&&
!
empty
(
$user
[
'id'
]))
{
$order
[
'user_id'
]
=
$user
[
'id'
];
}
// 订单商品数量
if
(
!
isset
(
$order
[
'buy_number_count'
]))
{
$order
[
'buy_number_count'
]
=
array_sum
(
array_column
(
$goods
,
'stock'
));
}
// 订单备注
if
(
!
isset
(
$order
[
'user_note'
]))
{
$order
[
'user_note'
]
=
isset
(
$params
[
'user_note'
])
?
str_replace
([
'"'
,
"'"
],
''
,
strip_tags
(
$params
[
'user_note'
]))
:
''
;
}
// 订单支付方式
if
(
!
isset
(
$order
[
'payment_id'
]))
{
$order
[
'payment_id'
]
=
empty
(
$payment
[
'id'
])
?
0
:
$payment
[
'id'
];
}
// 是否线下支付
if
(
!
isset
(
$order
[
'is_under_line'
]))
{
$order
[
'is_under_line'
]
=
(
isset
(
$payment
[
'payment'
])
&&
in_array
(
$payment
[
'payment'
],
config
(
'shopxo.under_line_list'
)))
?
1
:
0
;
}
// 客户端类型
if
(
!
isset
(
$order
[
'client_type'
]))
{
$order
[
'client_type'
]
=
(
APPLICATION_CLIENT_TYPE
==
'pc'
&&
IsMobile
())
?
'h5'
:
APPLICATION_CLIENT_TYPE
;
}
// 时间
if
(
!
isset
(
$order
[
'add_time'
]))
{
$order
[
'add_time'
]
=
time
();
}
// 确认时间
if
(
isset
(
$order
[
'status'
])
&&
$order
[
'status'
]
==
1
)
{
$order
[
'confirm_time'
]
=
time
();
}
...
...
@@ -1040,9 +1098,13 @@ class BuyService
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'order'
=>
&
$order
,
'goods'
=>
&
$buy
[
'data'
][
'goods'
],
'goods'
=>
&
$goods
,
'address'
=>
&
$address
,
'site_model'
=>
$site_model
,
'payment'
=>
$payment
,
'payment_id'
=>
isset
(
$order
[
'payment_id'
])
?
$order
[
'payment_id'
]
:
0
,
'is_under_line'
=>
isset
(
$order
[
'is_under_line'
])
?
$order
[
'is_under_line'
]
:
0
,
'params'
=>
$params
,
]));
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
...
...
@@ -1056,13 +1118,13 @@ class BuyService
$order_id
=
Db
::
name
(
'Order'
)
->
insertGetId
(
$order
);
if
(
$order_id
>
0
)
{
foreach
(
$
buy
[
'data'
][
'goods'
]
as
$k
=>
$v
)
foreach
(
$
goods
as
$k
=>
$v
)
{
// 添加订单详情数据,data返回自增id
$detail_ret
=
self
::
OrderDetailInsert
(
$order_id
,
$
params
[
'user'
]
[
'id'
],
$v
);
$detail_ret
=
self
::
OrderDetailInsert
(
$order_id
,
$
user
[
'id'
],
$v
);
if
(
$detail_ret
[
'code'
]
==
0
)
{
$
buy
[
'data'
][
'goods'
]
[
$k
][
'id'
]
=
$detail_ret
[
'data'
];
$
goods
[
$k
][
'id'
]
=
$detail_ret
[
'data'
];
}
else
{
Db
::
rollback
();
return
$ret
;
...
...
@@ -1071,7 +1133,7 @@ class BuyService
// 订单模式 - 虚拟信息添加
if
(
$site_model
==
3
)
{
$ret
=
self
::
OrderFictitiousValueInsert
(
$order_id
,
$detail_ret
[
'data'
],
$
params
[
'user'
]
[
'id'
],
$v
[
'goods_id'
]);
$ret
=
self
::
OrderFictitiousValueInsert
(
$order_id
,
$detail_ret
[
'data'
],
$
user
[
'id'
],
$v
[
'goods_id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
...
...
@@ -1087,7 +1149,7 @@ class BuyService
// 添加订单(收货|取货)地址
if
(
!
empty
(
$address
))
{
$ret
=
self
::
OrderAddressInsert
(
$order_id
,
$
params
[
'user'
]
[
'id'
],
$address
);
$ret
=
self
::
OrderAddressInsert
(
$order_id
,
$
user
[
'id'
],
$address
);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
...
...
@@ -1098,7 +1160,7 @@ class BuyService
// 自提模式 添加订单取货码
if
(
$site_model
==
2
)
{
$ret
=
self
::
OrderExtractionCcodeInsert
(
$order_id
,
$
params
[
'user'
]
[
'id'
]);
$ret
=
self
::
OrderExtractionCcodeInsert
(
$order_id
,
$
user
[
'id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
...
...
@@ -1130,8 +1192,12 @@ class BuyService
'is_backend'
=>
true
,
'order_id'
=>
$order_id
,
'order'
=>
$order
,
'goods'
=>
$
buy
[
'data'
][
'goods'
]
,
'goods'
=>
$
goods
,
'address'
=>
$address
,
'site_model'
=>
$site_model
,
'payment'
=>
$payment
,
'payment_id'
=>
isset
(
$order
[
'payment_id'
])
?
$order
[
'payment_id'
]
:
0
,
'is_under_line'
=>
isset
(
$order
[
'is_under_line'
])
?
$order
[
'is_under_line'
]
:
0
,
'params'
=>
$params
,
]));
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
...
...
@@ -1157,8 +1223,12 @@ class BuyService
'is_backend'
=>
true
,
'order_id'
=>
$order_id
,
'order'
=>
$order
,
'goods'
=>
$
buy
[
'data'
][
'goods'
]
,
'goods'
=>
$
goods
,
'address'
=>
$address
,
'site_model'
=>
$site_model
,
'payment'
=>
$payment
,
'payment_id'
=>
isset
(
$order
[
'payment_id'
])
?
$order
[
'payment_id'
]
:
0
,
'is_under_line'
=>
isset
(
$order
[
'is_under_line'
])
?
$order
[
'is_under_line'
]
:
0
,
'params'
=>
$params
,
]);
...
...
application/service/GoodsService.php
浏览文件 @
ce879745
...
...
@@ -290,7 +290,8 @@ class GoodsService
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$data
=
Db
::
name
(
'Goods'
)
->
alias
(
'g'
)
->
join
([
'__GOODS_CATEGORY_JOIN__'
=>
'gci'
],
'g.id=gci.goods_id'
)
->
field
(
$field
)
->
where
(
$where
)
->
group
(
'g.id'
)
->
order
(
$order_by
)
->
limit
(
$m
,
$n
)
->
select
();
return
self
::
GoodsDataHandle
(
$params
,
$data
);
// 数据处理
return
self
::
GoodsDataHandle
(
$data
,
$params
);
}
/**
...
...
@@ -299,10 +300,10 @@ class GoodsService
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-12-08T23:16:42+0800
* @param [array] $params [输入参数]
* @param [array] $data [商品列表]
* @param [array] $params [输入参数]
*/
public
static
function
GoodsDataHandle
(
$
params
,
$data
)
public
static
function
GoodsDataHandle
(
$
data
,
$params
=
[]
)
{
if
(
!
empty
(
$data
))
{
...
...
@@ -473,7 +474,7 @@ class GoodsService
}
}
}
return
DataReturn
(
'
处理成功
'
,
0
,
$data
);
return
DataReturn
(
'
success
'
,
0
,
$data
);
}
/**
...
...
@@ -606,7 +607,7 @@ class GoodsService
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$data
=
Db
::
name
(
'Goods'
)
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order_by
)
->
limit
(
$m
,
$n
)
->
select
();
return
self
::
GoodsDataHandle
(
$
params
,
$data
);
return
self
::
GoodsDataHandle
(
$
data
,
$params
);
}
/**
...
...
application/service/NavigationService.php
浏览文件 @
ce879745
...
...
@@ -231,13 +231,21 @@ class NavigationService
}
// 数据集合
if
(
!
empty
(
$items_group
))
{
foreach
(
$data
as
$dv
)
{
$result
[]
=
$dv
;
if
(
!
empty
(
$items_group
)
&&
array_key_exists
(
$dv
[
'id'
],
$items_group
))
if
(
array_key_exists
(
$dv
[
'id'
],
$items_group
))
{
$dv
[
'is_sub_data'
]
=
1
;
$result
[]
=
$dv
;
$result
=
array_merge
(
$result
,
$items_group
[
$dv
[
'id'
]]);
}
else
{
$result
[]
=
$dv
;
}
}
}
else
{
$result
=
$data
;
}
}
...
...
application/service/OrderService.php
浏览文件 @
ce879745
...
...
@@ -776,18 +776,41 @@ class OrderService
$m
=
isset
(
$params
[
'm'
])
?
intval
(
$params
[
'm'
])
:
0
;
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$order_by
=
empty
(
$params
[
'order_by'
])
?
'id desc'
:
$params
[
'order_by'
];
$is_items
=
isset
(
$params
[
'is_items'
])
?
intval
(
$params
[
'is_items'
])
:
1
;
$is_orderaftersale
=
isset
(
$params
[
'is_orderaftersale'
])
?
intval
(
$params
[
'is_orderaftersale'
])
:
0
;
$user_type
=
isset
(
$params
[
'user_type'
])
?
$params
[
'user_type'
]
:
'user'
;
// 获取订单
$data
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
limit
(
$m
,
$n
)
->
order
(
$order_by
)
->
select
();
// 数据处理
return
self
::
OrderDataHandle
(
$data
,
$params
);
}
/**
* 订单数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-05
* @desc description
* @param [array] $data [订单数据]
* @param [array] $params [输入参数]
*/
public
static
function
OrderDataHandle
(
$data
,
$params
=
[])
{
$result
=
[];
if
(
!
empty
(
$data
))
{
// 其它额外处理
$is_items
=
isset
(
$params
[
'is_items'
])
?
intval
(
$params
[
'is_items'
])
:
1
;
$is_orderaftersale
=
isset
(
$params
[
'is_orderaftersale'
])
?
intval
(
$params
[
'is_orderaftersale'
])
:
0
;
$user_type
=
isset
(
$params
[
'user_type'
])
?
$params
[
'user_type'
]
:
'user'
;
// 静态数据
$order_status_list
=
lang
(
'common_order_user_status'
);
$order_pay_status
=
lang
(
'common_order_pay_status'
);
$common_platform_type
=
lang
(
'common_platform_type'
);
$common_site_type_list
=
lang
(
'common_site_type_list'
);
// 循环处理数据
foreach
(
$data
as
&
$v
)
{
// 订单处理前钩子
...
...
config/shopxo.sql
浏览文件 @
ce879745
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录