Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
b2148dee
ShopXO
项目概览
jcy2004x
/
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,体验更适合开发者的 AI 搜索 >>
提交
b2148dee
编写于
11月 20, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单逻辑调整处理
上级
e4c9521a
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
352 addition
and
145 deletion
+352
-145
application/admin/view/default/order/index.html
application/admin/view/default/order/index.html
+42
-13
application/api/controller/Buy.php
application/api/controller/Buy.php
+1
-1
application/index/controller/Buy.php
application/index/controller/Buy.php
+1
-1
application/index/view/default/buy/index.html
application/index/view/default/buy/index.html
+31
-28
application/index/view/default/order/detail.html
application/index/view/default/order/detail.html
+26
-33
application/lang/zh-cn.php
application/lang/zh-cn.php
+1
-1
application/service/BuyService.php
application/service/BuyService.php
+180
-43
application/service/ConfigService.php
application/service/ConfigService.php
+1
-1
application/service/OrderService.php
application/service/OrderService.php
+3
-3
config/shopxo.sql
config/shopxo.sql
+47
-21
public/static/admin/default/js/order.js
public/static/admin/default/js/order.js
+18
-0
public/static/index/default/css/order.detail.css
public/static/index/default/css/order.detail.css
+1
-0
未找到文件。
application/admin/view/default/order/index.html
浏览文件 @
b2148dee
...
...
@@ -369,20 +369,23 @@
<dt>
退款金额
</dt>
<dd>
{{if empty($v['refund_price']) or $v['refund_price'] elt 0.00}}
<span
class=
"cr-ddd"
>
未退款
</span>
{{else /}}
<span
class=
"am-text-danger"
>
{{$v.refund_price}}{{/if}}
</span></dd>
<dt>
确认时间
</dt>
<dd>
{{if empty($v['confirm_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.confirm_tim
e}}{{/if}}
</dd>
<dt>
自提取货码
</dt>
<dd>
{{if empty($v['extraction_code'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.extraction_cod
e}}{{/if}}
</dd>
<dt>
支付
时间
</dt>
<dd>
{{if empty($v['pay_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.pay
_time}}{{/if}}
</dd>
<dt>
确认
时间
</dt>
<dd>
{{if empty($v['confirm_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.confirm
_time}}{{/if}}
</dd>
<dt>
发货
时间
</dt>
<dd>
{{if empty($v['delivery_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.deliver
y_time}}{{/if}}
</dd>
<dt>
支付
时间
</dt>
<dd>
{{if empty($v['pay_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.pa
y_time}}{{/if}}
</dd>
<dt>
完成
时间
</dt>
<dd>
{{if empty($v['collect_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.collect
_time}}{{/if}}
</dd>
<dt>
发货
时间
</dt>
<dd>
{{if empty($v['delivery_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.delivery
_time}}{{/if}}
</dd>
<dt>
取消时间
</dt>
<dd>
{{if empty($v['cancel_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.cancel_time}}{{/if}}
</dd>
<dt>
完成时间
</dt>
<dd>
{{if empty($v['collect_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.collect_time}}{{/if}}
</dd>
<dt>
取消时间
</dt>
<dd>
{{if empty($v['cancel_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.cancel_time}}{{/if}}
</dd>
<dt>
关闭时间
</dt>
<dd>
{{if empty($v['close_time'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.close_time}}{{/if}}
</dd>
...
...
@@ -390,8 +393,8 @@
<dt>
创建时间
</dt>
<dd>
{{$v.add_time}}
</dd>
<dt>
更新时间
</dt>
<dd>
{{$v.upd_time}}
</dd>
<dt>
更新时间
</dt>
<dd>
{{$v.upd_time}}
</dd>
</dl>
</div>
</div>
...
...
@@ -408,7 +411,11 @@
{{/if}}
{{/if}}
{{if $v['status'] eq 2}}
<button
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-send-o am-btn-block submit-delivery"
data-url=
"{{:MyUrl('admin/order/delivery')}}"
data-id=
"{{$v.id}}"
data-user-id=
"{{$v.user_id}}"
data-express-id=
"{{$v.express_id}}"
data-am-modal=
"{target: '#order-delivery-popup'}"
>
发货
</button>
{{if $v['order_model'] eq 2}}
<button
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-check am-btn-block submit-take"
data-url=
"{{:MyUrl('admin/order/delivery')}}"
data-id=
"{{$v.id}}"
data-user-id=
"{{$v.user_id}}"
data-extraction-code=
""
data-am-modal=
"{target: '#order-take-modal', closeViaDimmer: 0, width: 300, height: 160}"
>
取货
</button>
{{else /}}
<button
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-send-o am-btn-block submit-delivery"
data-url=
"{{:MyUrl('admin/order/delivery')}}"
data-id=
"{{$v.id}}"
data-user-id=
"{{$v.user_id}}"
data-express-id=
"{{$v.express_id}}"
data-am-modal=
"{target: '#order-delivery-popup'}"
>
发货
</button>
{{/if}}
{{/if}}
{{if $v['status'] eq 3}}
<button
class=
"am-btn am-btn-success am-btn-xs am-radius am-icon-check-circle-o am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/order/collect')}}"
data-id=
"{{$v.id}}"
data-value=
"{{$v.user_id}}"
data-view=
"reload"
data-msg=
"是否操作收货,操作后不可恢复!"
>
收货
</button>
...
...
@@ -448,6 +455,28 @@
{{/if}}
<!-- list end -->
<!-- 取货弹窗 -->
<div
class=
"am-modal am-modal-no-btn"
tabindex=
"-1"
id=
"order-take-modal"
>
<div
class=
"am-modal-dialog"
>
<div
class=
"am-modal-hd"
>
<a
href=
"javascript: void(0)"
class=
"am-close am-close-spin"
data-am-modal-close
>
×
</a>
</div>
<div
class=
"am-modal-bd"
>
<form
class=
"am-form form-validation-take take-form"
method=
"post"
action=
"{{:MyUrl('admin/order/delivery')}}"
request-type=
"ajax-reload"
>
<div
class=
"am-form-group am-form-group-refreshing am-margin-bottom-0"
>
<label>
取货码
</label>
<input
type=
"text"
autocomplete=
"off"
name=
"extraction_code"
placeholder=
"取货码"
minlength=
"4"
maxlength=
"4"
data-validation-message=
"请填写4位数取货码"
class=
"am-radius"
required
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
value=
"0"
/>
<input
type=
"hidden"
name=
"user_id"
value=
"0"
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
确认
</button>
</div>
</form>
</div>
</div>
</div>
<!-- 发货弹窗 -->
<div
class=
"am-popup"
id=
"order-delivery-popup"
>
<div
class=
"am-popup-inner"
>
...
...
application/api/controller/Buy.php
浏览文件 @
b2148dee
...
...
@@ -91,7 +91,7 @@ class Buy extends Common
{
$params
=
$this
->
data_post
;
$params
[
'user'
]
=
$this
->
user
;
return
BuyService
::
Order
Add
(
$params
);
return
BuyService
::
Order
Insert
(
$params
);
}
}
?>
\ No newline at end of file
application/index/controller/Buy.php
浏览文件 @
b2148dee
...
...
@@ -237,7 +237,7 @@ class Buy extends Common
{
$params
=
$_POST
;
$params
[
'user'
]
=
$this
->
user
;
return
BuyService
::
Order
Add
(
$params
);
return
BuyService
::
Order
Insert
(
$params
);
}
else
{
$this
->
assign
(
'msg'
,
'非法访问'
);
return
$this
->
fetch
(
'public/tips_error'
);
...
...
application/index/view/default/buy/index.html
浏览文件 @
b2148dee
...
...
@@ -382,35 +382,38 @@
</span>
</div>
<div
class=
"pay-address"
>
<div
class=
"buy-footer-address"
>
<span
class=
"buy-line-title buy-line-title-type"
>
寄送至:
</span>
<span
class=
"buy-address-detail"
>
{{if !empty($base['address'])}}
{{$base.address.province_name}} {{$base.address.city_name}} {{$base.address.county_name}} {{$base.address.address}}
{{else /}}
...
{{/if}}
</span>
</div>
<div
class=
"buy-footer-address"
>
<span
class=
"buy-line-title"
>
收货人:
</span>
<span
class=
"buy-user"
>
{{if !empty($base['address'])}}
{{$base.address.name}}
{{else /}}
...
{{/if}}
</span>
<span
class=
"buy-phone"
>
{{if !empty($base['address'])}}
{{$base.address.tel}}
{{else /}}
...
{{/if}}
</span>
<!-- 销售模式+自提模式 显示地址 -->
{{if in_array($common_site_type, [0,2])}}
<div
class=
"pay-address"
>
<div
class=
"buy-footer-address"
>
<span
class=
"buy-line-title buy-line-title-type"
>
地址:
</span>
<span
class=
"buy-address-detail"
>
{{if !empty($base['address'])}}
{{$base.address.province_name}} {{$base.address.city_name}} {{$base.address.county_name}} {{$base.address.address}}
{{else /}}
...
{{/if}}
</span>
</div>
<div
class=
"buy-footer-address"
>
<span
class=
"buy-line-title"
>
联系人:
</span>
<span
class=
"buy-user"
>
{{if !empty($base['address'])}}
{{$base.address.name}}
{{else /}}
...
{{/if}}
</span>
<span
class=
"buy-phone"
>
{{if !empty($base['address'])}}
{{$base.address.tel}}
{{else /}}
...
{{/if}}
</span>
</div>
</div>
</div>
{{/if}}
</div>
<form
class=
"am-form form-validation nav-buy"
action=
"{{:MyUrl('index/buy/add')}}"
method=
"post"
class=
"nav-buy"
request-type=
"ajax-fun"
request-value=
"BuySubmitBack"
data-site-type=
"{{$common_site_type}}"
data-is-booking=
"{{$common_order_is_booking}}"
>
<input
type=
"hidden"
name=
"goods_id"
value=
"{{if isset($params['goods_id'])}}{{$params.goods_id}}{{else /}}0{{/if}}"
/>
...
...
application/index/view/default/order/detail.html
浏览文件 @
b2148dee
...
...
@@ -241,7 +241,7 @@
}
{{/php}}
</div>
{{if in_array($data['status'], [3,4])}}
{{if
$data['order_model'] eq 0 and
in_array($data['status'], [3,4])}}
<div
class=
"logistics"
>
<div
class=
"items am-cf"
>
<div
class=
"items-title am-fl"
>
快递公司:
</div>
...
...
@@ -285,41 +285,34 @@
{{/if}}
<!-- 虚拟销售信息 -->
{{if $data['order_model'] eq 3 and
!in_array($data['status'], [5,6
])}}
<div
class=
"am-panel am-panel-s
uccess
business-panel fictitious-panel-container"
>
{{if $data['order_model'] eq 3 and
$data['pay_status'] eq 1 and in_array($data['status'], [3,4
])}}
<div
class=
"am-panel am-panel-s
econdary
business-panel fictitious-panel-container"
>
<div
class=
"am-panel-hd"
>
{{$site_fictitious.title}}
</div>
<div
class=
"am-panel-bd am-padding-horizontal-0 am-padding-bottom-xs"
>
{{if $data['pay_status'] eq 1 and $data['status'] eq 3}}
<div
class=
"am-alert am-margin-bottom-0 am-margin-horizontal-sm"
data-am-alert
>
<p
class=
"am-text-danger"
>
该区域为敏感信息,订单完成后,将不再展示。
</p>
{{if !empty($site_fictitious)}}
<p
class=
"am-margin-top-xs"
>
{{$site_fictitious.tips|raw}}
</p>
{{/if}}
<div
class=
"am-panel-bd am-padding-horizontal-0 am-padding-top-xs am-padding-bottom-xs"
>
{{if !empty($site_fictitious['tips'])}}
<div
class=
"am-alert am-alert-warning am-margin-top-xs am-margin-bottom-0 am-margin-horizontal-sm"
data-am-alert
>
{{$site_fictitious.tips|raw}}
</div>
{{if !empty($data.items)}}
<ul
class=
"am-list am-margin-bottom-0"
>
{{foreach $data.items as $goods}}
<li
class=
"am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"
>
<div
class=
"am-u-sm-2 am-u-md-1 am-list-thumb"
>
<img
src=
"{{$goods.images}}"
alt=
"{{$goods.title}}"
class=
"am-img-thumbnail am-radius"
/>
</div>
<div
class=
"am-u-sm-10 am-u-md-11 am-list-item-text"
>
{{if empty($goods['fictitious_goods_value'])}}
<span>
未配置数据
</span>
{{else /}}
{{$goods.fictitious_goods_value|raw}}
{{/if}}
</div>
</li>
{{/foreach}}
</ul>
{{else /}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有订单商品数据
</div>
{{/if}}
{{/if}}
{{if !empty($data.items)}}
<ul
class=
"am-list am-margin-bottom-0"
>
{{foreach $data.items as $goods}}
<li
class=
"am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"
>
<div
class=
"am-u-sm-2 am-u-md-1 am-list-thumb"
>
<img
src=
"{{$goods.images}}"
alt=
"{{$goods.title}}"
class=
"am-img-thumbnail am-radius"
/>
</div>
<div
class=
"am-u-sm-10 am-u-md-11 am-list-item-text"
>
{{if empty($goods['fictitious_goods_value'])}}
<span>
未配置数据
</span>
{{else /}}
{{$goods.fictitious_goods_value|raw}}
{{/if}}
</div>
</li>
{{/foreach}}
</ul>
{{else /}}
<div
class=
"am-alert am-margin-horizontal-sm"
data-am-alert
>
仅待收货状态下展示该区域信息,如有疑问请联系管理员。
</div>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有订单商品数据
</div>
{{/if}}
</div>
</div>
...
...
application/lang/zh-cn.php
浏览文件 @
b2148dee
...
...
@@ -100,7 +100,7 @@ return array(
'common_order_admin_status'
=>
array
(
0
=>
array
(
'id'
=>
0
,
'name'
=>
'待确认'
,
'checked'
=>
true
),
1
=>
array
(
'id'
=>
1
,
'name'
=>
'已确认/待支付'
),
2
=>
array
(
'id'
=>
2
,
'name'
=>
'已支付/待发货'
),
2
=>
array
(
'id'
=>
2
,
'name'
=>
'已支付/待发货
/待取货
'
),
3
=>
array
(
'id'
=>
3
,
'name'
=>
'已发货/待收货'
),
4
=>
array
(
'id'
=>
4
,
'name'
=>
'已完成'
),
5
=>
array
(
'id'
=>
5
,
'name'
=>
'已取消'
),
...
...
application/service/BuyService.php
浏览文件 @
b2148dee
...
...
@@ -802,7 +802,7 @@ class BuyService
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
Order
Add
(
$params
=
[])
public
static
function
Order
Insert
(
$params
=
[])
{
// 站点类型,是否开启了展示型
$common_site_type
=
MyC
(
'common_site_type'
,
0
,
true
);
...
...
@@ -902,23 +902,10 @@ class BuyService
{
$order
[
'confirm_time'
]
=
time
();
}
// 订单收货地址
$order_address
=
[
'user_id'
=>
$params
[
'user'
][
'id'
],
'receive_address_id'
=>
isset
(
$address
[
'id'
])
?
intval
(
$address
[
'id'
])
:
0
,
'receive_name'
=>
isset
(
$address
[
'name'
])
?
$address
[
'name'
]
:
''
,
'receive_tel'
=>
isset
(
$address
[
'tel'
])
?
$address
[
'tel'
]
:
''
,
'receive_province'
=>
isset
(
$address
[
'province'
])
?
intval
(
$address
[
'province'
])
:
0
,
'receive_city'
=>
isset
(
$address
[
'city'
])
?
intval
(
$address
[
'city'
])
:
0
,
'receive_county'
=>
isset
(
$address
[
'county'
])
?
intval
(
$address
[
'county'
])
:
0
,
'receive_address'
=>
isset
(
$address
[
'address'
])
?
$address
[
'address'
]
:
''
,
'receive_province_name'
=>
isset
(
$address
[
'province_name'
])
?
$address
[
'province_name'
]
:
''
,
'receive_city_name'
=>
isset
(
$address
[
'city_name'
])
?
$address
[
'city_name'
]
:
''
,
'receive_county_name'
=>
isset
(
$address
[
'county_name'
])
?
$address
[
'county_name'
]
:
''
,
'receive_lng'
=>
isset
(
$address
[
'lng'
])
?
(
float
)
$address
[
'lng'
]
:
'0.0000000000'
,
'receive_lat'
=>
isset
(
$address
[
'lat'
])
?
(
float
)
$address
[
'lat'
]
:
'0.0000000000'
,
];
if
(
$common_site_type
==
2
)
{
$order
[
'extraction_code'
]
=
GetNumberCode
(
4
);
}
// 订单添加前钩子
$hook_name
=
'plugins_service_buy_order_insert_begin'
;
...
...
@@ -926,7 +913,6 @@ class BuyService
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'order'
=>
&
$order
,
'order_address'
=>
&
$order_address
,
'params'
=>
$params
,
]);
...
...
@@ -944,38 +930,36 @@ class BuyService
{
foreach
(
$buy
[
'data'
][
'goods'
]
as
$v
)
{
$detail
=
[
'order_id'
=>
$order_id
,
'user_id'
=>
$params
[
'user'
][
'id'
],
'goods_id'
=>
$v
[
'goods_id'
],
'title'
=>
$v
[
'title'
],
'images'
=>
$v
[
'images_old'
],
'original_price'
=>
$v
[
'original_price'
],
'price'
=>
$v
[
'price'
],
'total_price'
=>
PriceNumberFormat
(
$v
[
'stock'
]
*
$v
[
'price'
]),
'spec'
=>
empty
(
$v
[
'spec'
])
?
''
:
json_encode
(
$v
[
'spec'
]),
'spec_weight'
=>
empty
(
$v
[
'spec_weight'
])
?
0.00
:
(
float
)
$v
[
'spec_weight'
],
'spec_coding'
=>
empty
(
$v
[
'spec_coding'
])
?
''
:
$v
[
'spec_coding'
],
'spec_barcode'
=>
empty
(
$v
[
'spec_barcode'
])
?
''
:
$v
[
'spec_barcode'
],
'buy_number'
=>
intval
(
$v
[
'stock'
]),
'model'
=>
$v
[
'model'
],
'add_time'
=>
time
(),
];
if
(
Db
::
name
(
'OrderDetail'
)
->
insertGetId
(
$detail
)
<=
0
)
// 添加订单详情数据
$detail_ret
=
self
::
OrderDetailInsert
(
$order_id
,
$params
[
'user'
][
'id'
],
$v
);
if
(
$detail_ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
return
DataReturn
(
'订单详情添加失败'
,
-
1
);
return
$ret
;
}
// 自提模式 - 虚拟信息
if
(
$common_site_type
==
3
)
{
// 订单虚拟销售关联数据添加
$ret
=
self
::
OrderFictitiousValueInsert
(
$order_id
,
$detail_ret
[
'data'
],
$params
[
'user'
][
'id'
],
$v
[
'goods_id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
return
$ret
;
}
}
}
// 添加订单收货地址
if
(
in_array
(
$common_site_type
,
[
0
,
2
]))
//
销售型模式+自提模式
添加订单收货地址
if
(
in_array
(
$common_site_type
,
[
0
,
2
])
&&
!
empty
(
$address
)
)
{
$order_address
[
'order_id'
]
=
$order_id
;
if
(
Db
::
name
(
'OrderReceiveAddress'
)
->
insertGetId
(
$order_address
)
<=
0
)
// 订单地址添加前钩子
$ret
=
self
::
OrderReceiveAddressInsert
(
$order_id
,
$params
[
'user'
][
'id'
],
$address
);
if
(
$ret
[
'code'
]
!=
0
)
{
Db
::
rollback
();
return
DataReturn
(
'订单收货地址添加失败'
,
-
1
)
;
return
$ret
;
}
}
}
else
{
...
...
@@ -1043,6 +1027,159 @@ class BuyService
return
DataReturn
(
$msg
,
0
,
$result
);
}
/**
* 订单详情添加
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-11-20
* @desc description
* @param [int] $order_id [订单id]
* @param [int] $user_id [用户id]
* @param [array] $detail [商品详情数据]
*/
private
static
function
OrderDetailInsert
(
$order_id
,
$user_id
,
$detail
)
{
$data
=
[
'order_id'
=>
$order_id
,
'user_id'
=>
$user_id
,
'goods_id'
=>
$detail
[
'goods_id'
],
'title'
=>
$detail
[
'title'
],
'images'
=>
$detail
[
'images_old'
],
'original_price'
=>
$detail
[
'original_price'
],
'price'
=>
$detail
[
'price'
],
'total_price'
=>
PriceNumberFormat
(
$detail
[
'stock'
]
*
$detail
[
'price'
]),
'spec'
=>
empty
(
$detail
[
'spec'
])
?
''
:
json_encode
(
$detail
[
'spec'
]),
'spec_weight'
=>
empty
(
$detail
[
'spec_weight'
])
?
0.00
:
(
float
)
$detail
[
'spec_weight'
],
'spec_coding'
=>
empty
(
$detail
[
'spec_coding'
])
?
''
:
$detail
[
'spec_coding'
],
'spec_barcode'
=>
empty
(
$detail
[
'spec_barcode'
])
?
''
:
$detail
[
'spec_barcode'
],
'buy_number'
=>
intval
(
$detail
[
'stock'
]),
'model'
=>
$detail
[
'model'
],
'add_time'
=>
time
(),
];
// 订单详情添加前钩子
$hook_name
=
'plugins_service_buy_order_detail_insert_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'user_id'
=>
$user_id
,
'order_id'
=>
$order_id
,
'data'
=>
&
$data
,
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 添加订单详情数据
$order_detail_id
=
Db
::
name
(
'OrderDetail'
)
->
insertGetId
(
$data
);
if
(
$order_detail_id
>
0
)
{
return
DataReturn
(
'添加成功'
,
0
,
$order_detail_id
);
}
return
DataReturn
(
'订单详情添加失败'
,
-
1
);
}
/**
* 订单关联虚拟销售数据添加
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-11-20
* @desc description
* @param [int] $order_id [订单id]
* @param [int] $order_detail_id [订单详情id]
* @param [int] $user_id [用户id]
* @param [int] $goods_id [商品id]
*/
private
static
function
OrderFictitiousValueInsert
(
$order_id
,
$order_detail_id
,
$user_id
,
$goods_id
)
{
$data
=
[
'order_id'
=>
$order_id
,
'order_detail_id'
=>
$order_detail_id
,
'user_id'
=>
$user_id
,
'value'
=>
Db
::
name
(
'Goods'
)
->
where
([
'id'
=>
$goods_id
])
->
value
(
'fictitious_goods_value'
),
'add_time'
=>
time
(),
];
// 订单虚拟数据添加前钩子
$hook_name
=
'plugins_service_buy_order_fictitious_insert_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'user_id'
=>
$user_id
,
'order_id'
=>
$order_id
,
'order_detail_id'
=>
$order_detail_id
,
'goods_id'
=>
$goods_id
,
'data'
=>
&
$data
,
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 添加订单虚拟数据
if
(
Db
::
name
(
'OrderFictitiousValue'
)
->
insertGetId
(
$data
)
>
0
)
{
return
DataReturn
(
'添加成功'
,
0
);
}
return
DataReturn
(
'订单虚拟信息添加失败'
,
-
1
);
}
/**
* 订单关联地址添加
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-11-20
* @desc description
* @param [int] $order_id [订单id]
* @param [int] $user_id [用户id]
* @param [array] $address [地址]
*/
private
static
function
OrderReceiveAddressInsert
(
$order_id
,
$user_id
,
$address
)
{
// 订单收货地址
$data
=
[
'order_id'
=>
$order_id
,
'user_id'
=>
$user_id
,
'receive_address_id'
=>
isset
(
$address
[
'id'
])
?
intval
(
$address
[
'id'
])
:
0
,
'receive_name'
=>
isset
(
$address
[
'name'
])
?
$address
[
'name'
]
:
''
,
'receive_tel'
=>
isset
(
$address
[
'tel'
])
?
$address
[
'tel'
]
:
''
,
'receive_province'
=>
isset
(
$address
[
'province'
])
?
intval
(
$address
[
'province'
])
:
0
,
'receive_city'
=>
isset
(
$address
[
'city'
])
?
intval
(
$address
[
'city'
])
:
0
,
'receive_county'
=>
isset
(
$address
[
'county'
])
?
intval
(
$address
[
'county'
])
:
0
,
'receive_address'
=>
isset
(
$address
[
'address'
])
?
$address
[
'address'
]
:
''
,
'receive_province_name'
=>
isset
(
$address
[
'province_name'
])
?
$address
[
'province_name'
]
:
''
,
'receive_city_name'
=>
isset
(
$address
[
'city_name'
])
?
$address
[
'city_name'
]
:
''
,
'receive_county_name'
=>
isset
(
$address
[
'county_name'
])
?
$address
[
'county_name'
]
:
''
,
'receive_lng'
=>
isset
(
$address
[
'lng'
])
?
(
float
)
$address
[
'lng'
]
:
'0.0000000000'
,
'receive_lat'
=>
isset
(
$address
[
'lat'
])
?
(
float
)
$address
[
'lat'
]
:
'0.0000000000'
,
];
// 订单地址添加前钩子
$hook_name
=
'plugins_service_buy_order_receive_address_insert_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'user_id'
=>
$user_id
,
'order_id'
=>
$order_id
,
'data'
=>
&
$data
,
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 添加订单地址
if
(
Db
::
name
(
'OrderReceiveAddress'
)
->
insertGetId
(
$data
)
>
0
)
{
return
DataReturn
(
'添加成功'
,
0
);
}
return
DataReturn
(
'订单收货地址添加失败'
,
-
1
);
}
/**
* 购物车总数
* @author Devil
...
...
application/service/ConfigService.php
浏览文件 @
b2148dee
...
...
@@ -322,7 +322,7 @@ class ConfigService
$title
=
MyC
(
'common_site_fictitious_return_title'
,
'密钥信息'
,
true
);
// 提示信息
$tips
=
MyC
(
'common_site_fictitious_return_tips'
,
'支付后查看密钥信息!'
,
true
);
$tips
=
MyC
(
'common_site_fictitious_return_tips'
,
null
,
true
);
$result
=
[
'title'
=>
$title
,
...
...
application/service/OrderService.php
浏览文件 @
b2148dee
...
...
@@ -698,7 +698,7 @@ class OrderService
$v
[
'client_type_name'
]
=
isset
(
$common_platform_type
[
$v
[
'client_type'
]])
?
$common_platform_type
[
$v
[
'client_type'
]][
'name'
]
:
''
;
// 状态
$v
[
'status_name'
]
=
$order_status_list
[
$v
[
'status'
]][
'name'
];
$v
[
'status_name'
]
=
(
$v
[
'order_model'
]
==
2
&&
$v
[
'status'
]
==
2
)
?
'待取货'
:
$order_status_list
[
$v
[
'status'
]][
'name'
];
// 支付状态
$v
[
'pay_status_name'
]
=
$order_pay_status
[
$v
[
'pay_status'
]][
'name'
];
...
...
@@ -782,9 +782,9 @@ class OrderService
}
// 虚拟销售商品 - 虚拟信息处理
if
(
$v
[
'
status'
]
==
3
&&
$v
[
'pay_status'
]
==
1
&&
$v
[
'order_model'
]
==
3
)
if
(
$v
[
'
order_model'
]
==
3
&&
$v
[
'pay_status'
]
==
1
&&
in_array
(
$v
[
'status'
],
[
3
,
4
])
)
{
$vs
[
'fictitious_goods_value'
]
=
Db
(
'Goods'
)
->
where
([
'id'
=>
$vs
[
'goods_id'
]])
->
value
(
'fictitious_goods_
value'
);
$vs
[
'fictitious_goods_value'
]
=
Db
::
name
(
'OrderFictitiousValue'
)
->
where
([
'order_detail_id'
=>
$vs
[
'id'
]])
->
value
(
'
value'
);
}
// 是否excel导出
...
...
config/shopxo.sql
浏览文件 @
b2148dee
此差异已折叠。
点击以展开。
public/static/admin/default/js/order.js
浏览文件 @
b2148dee
...
...
@@ -80,4 +80,22 @@ $(function()
}
});
// 取货操作
$
(
'
.submit-take
'
).
on
(
'
click
'
,
function
()
{
$
(
'
form.take-form input[name=id]
'
).
val
(
$
(
this
).
data
(
'
id
'
)
||
0
);
$
(
'
form.take-form input[name=user_id]
'
).
val
(
$
(
this
).
data
(
'
user-id
'
)
||
0
);
});
// 取货操作表单
FromInit
(
'
form.form-validation-take
'
);
$
(
'
form.take-form button[type=submit]
'
).
on
(
'
click
'
,
function
()
{
if
((
$
(
'
form.take-form input[name=id]
'
).
val
()
||
0
)
==
0
)
{
Prompt
(
'
订单id有误
'
);
return
false
;
}
});
});
\ No newline at end of file
public/static/index/default/css/order.detail.css
浏览文件 @
b2148dee
...
...
@@ -234,6 +234,7 @@ strong.total-price-content { color: #d2364c; }
#popup-extraction-receive-map
.am-popup-bd
,
#map
{
height
:
100%
;
padding
:
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录