Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
6dc0d7c7
Commit
6dc0d7c7
authored
Jul 06, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(order): 导出及详情增加商品规格编号和ID
parent
af50af65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
+32
-4
Order.php
application/admin/controller/shopro/order/Order.php
+11
-3
OrderItem.php
application/admin/model/shopro/order/OrderItem.php
+6
-0
add.html
application/admin/view/shopro/goods/goods/add.html
+5
-1
detail.html
application/admin/view/shopro/order/order/detail.html
+10
-0
No files found.
application/admin/controller/shopro/order/Order.php
View file @
6dc0d7c7
...
...
@@ -151,7 +151,9 @@ class Order extends Common
// 更新包裹信息(5分钟缓存)
(
new
ExpressLib
)
->
updateOrderExpress
(
$id
);
$order
=
$this
->
model
->
withTrashed
()
->
with
([
'user'
,
'items'
,
'address'
,
'activity_orders'
,
'pays'
,
'invoice'
])
->
where
(
'id'
,
$id
)
->
find
();
$order
=
$this
->
model
->
withTrashed
()
->
with
([
'user'
,
'items'
=>
function
(
$query
)
{
$query
->
with
([
'skuPrice'
]);
},
'address'
,
'activity_orders'
,
'pays'
,
'invoice'
])
->
where
(
'id'
,
$id
)
->
find
();
if
(
!
$order
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
...
...
@@ -726,8 +728,11 @@ class Order extends Common
// 订单商品表字段
'activity_type_text'
=>
'活动'
,
'promo_types'
=>
'促销'
,
'promo_types'
=>
'促销'
,
'goods_id'
=>
'商品ID'
,
'goods_title'
=>
'商品名称'
,
'goods_sn'
=>
'商品规格编号'
,
'goods_sku_price_id'
=>
'商品规格ID'
,
'goods_sku_text'
=>
'商品规格'
,
'goods_num'
=>
'购买数量'
,
'goods_original_price'
=>
'商品原价'
,
...
...
@@ -768,7 +773,7 @@ class Order extends Common
$total_score_amount
=
0
;
$result
=
$export
->
export
(
$params
,
function
(
$pages
)
use
(
&
$total_order_amount
,
&
$total_pay_fee
,
&
$total_real_pay_fee
,
&
$total_discount_fee
,
&
$total_score_amount
,
$total
)
{
$datas
=
$this
->
model
->
withTrashed
()
->
sheepFilter
()
->
with
([
'user'
,
'items'
=>
function
(
$query
)
{
$query
->
with
([
'express'
]);
$query
->
with
([
'express'
,
'skuPrice'
]);
},
'address'
])
->
limit
(((
$pages
[
'page'
]
-
1
)
*
$pages
[
'list_rows'
]),
$pages
[
'list_rows'
])
->
select
();
...
...
@@ -820,7 +825,10 @@ class Order extends Common
$items
[]
=
[
'activity_type_text'
=>
$item
[
'activity_type_text'
],
'promo_types_text'
=>
is_array
(
$item
[
'promo_types_text'
])
?
join
(
','
,
$item
[
'promo_types_text'
])
:
(
$item
[
'promo_types_text'
]
?:
'-'
),
'goods_id'
=>
$item
[
'sku_price'
]
?
$item
[
'sku_price'
][
'goods_id'
]
:
'-'
,
'goods_title'
=>
$item
[
'goods_title'
],
'goods_sn'
=>
$item
[
'sku_price'
]
?
$item
[
'sku_price'
][
'sn'
]
:
'-'
,
'goods_sku_price_id'
=>
$item
[
'goods_sku_price_id'
]
?:
'-'
,
'goods_sku_text'
=>
$item
[
'goods_sku_text'
],
'goods_num'
=>
$item
[
'goods_num'
],
'goods_original_price'
=>
$item
[
'goods_original_price'
],
...
...
application/admin/model/shopro/order/OrderItem.php
View file @
6dc0d7c7
...
...
@@ -6,6 +6,7 @@ use app\admin\model\shopro\Common;
use
app\admin\model\shopro\order\traits\OrderItemStatus
;
use
app\admin\model\shopro\activity\Activity
;
use
app\admin\model\shopro\user\User
;
use
app\admin\model\shopro\goods\SkuPrice
;
class
OrderItem
extends
Common
{
...
...
@@ -224,4 +225,9 @@ class OrderItem extends Common
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
);
}
public
function
skuPrice
()
{
return
$this
->
belongsTo
(
SkuPrice
::
class
,
'goods_sku_price_id'
);
}
}
application/admin/view/shopro/goods/goods/add.html
View file @
6dc0d7c7
...
...
@@ -480,6 +480,7 @@
<table
class=
"sku-table"
rules=
"all"
>
<thead>
<tr>
<th>
商品规格ID
</th>
<template
v-for=
"(sku, skuIndex) in form.model.skus"
:key=
"skuIndex"
>
<th
v-if=
"sku.children.length"
>
{{ sku.name }}
</th>
</template>
...
...
@@ -634,11 +635,14 @@
</el-popover>
</div>
</th>
<th>
状态
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
v-for=
"(skuPrice,i) in form.model.sku_prices"
:key=
"skuPrice.sku_key"
>
<td
class=
"sku-id"
>
<span>
{{ skuPrice.id ? skuPrice.id : '-' }}
</span>
</td>
<template
v-for=
"skuName in skuPrice.goods_sku_text"
:key=
"skuName"
>
<td>
<span
class=
"th-center"
>
{{ skuName }}
</span>
...
...
application/admin/view/shopro/order/order/detail.html
View file @
6dc0d7c7
...
...
@@ -839,6 +839,16 @@
</div>
</template>
</el-table-column>
<el-table-column
label=
"商品规格编号"
min-width=
"120"
>
<template
#
default=
"scope"
>
{{ scope.row.sku_price ? scope.row.sku_price.sn : '-' }}
</template>
</el-table-column>
<el-table-column
label=
"商品规格ID"
min-width=
"100"
>
<template
#
default=
"scope"
>
{{ scope.row.sku_price ? scope.row.sku_price.id : '-' }}
</template>
</el-table-column>
<el-table-column
prop=
"goods_price"
label=
"单价(元)"
min-width=
"100"
>
</el-table-column>
<el-table-column
prop=
"goods_num"
label=
"数量(件)"
min-width=
"80"
></el-table-column>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment