Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a1930e00
authored
Jan 28, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整详情页售后金额
parent
709bc2c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
app/Http/Controllers/OrderController.php
app/Model/OrderServiceItemsModel.php
resources/views/detail/detail_items_info.php
app/Http/Controllers/OrderController.php
View file @
a1930e00
...
...
@@ -1750,6 +1750,10 @@ Class OrderController extends Controller
// 获取数组中的采购人id的名字
$this
->
getBuyerName
(
$response
);
// 获取售后金额
$OrderServiceItemsModel
=
new
OrderServiceItemsModel
;
$response
[
'service_amount'
]
=
$OrderServiceItemsModel
->
getServiceAmount
(
''
,
$id
);
return
$response
;
}
...
...
app/Model/OrderServiceItemsModel.php
View file @
a1930e00
...
...
@@ -44,9 +44,13 @@ class OrderServiceItemsModel extends Model
}
// 获取售后金额
public
function
getServiceAmount
(
$service_id
)
public
function
getServiceAmount
(
$service_id
=
''
,
$order_id
=
''
)
{
$data
=
$this
->
where
(
'service_id'
,
$service_id
)
->
select
(
'adjust_number'
,
'adjust_price'
)
->
get
()
->
toArray
();
$map
=
[];
$service_id
&&
$map
[
'service_id'
]
=
$service_id
;
$order_id
&&
$map
[
'order_id'
]
=
$order_id
;
$data
=
$this
->
where
(
$map
)
->
select
(
'adjust_number'
,
'adjust_price'
)
->
get
()
->
toArray
();
$amount
=
0
;
foreach
(
$data
as
$v
)
{
...
...
resources/views/detail/detail_items_info.php
View file @
a1930e00
...
...
@@ -67,7 +67,7 @@
<?php
if
(
$order_info
[
'order_goods_type'
]
==
1
)
{
?>
<th>
售后数量
</th>
<th>
剩余数量
</th>
<
th>
售后单价
</th
>
<
!-- <th>售后单价</th> --
>
<?php
}
?>
<th>
状态
</th>
</tr>
...
...
@@ -150,9 +150,9 @@
<?php
if
(
$order_info
[
'order_goods_type'
]
==
1
)
{
$service_number
=
App\Http\Controllers\getOrderServiceNum
(
$v
[
'order_id'
],
$v
[
'goods_id'
],
2
);
$service_price
=
App\Http\Controllers\getOrderServiceNum
(
$v
[
'order_id'
],
$v
[
'goods_id'
],
2
,
'adjust_price'
);
//
$service_price = App\Http\Controllers\getOrderServiceNum($v['order_id'], $v['goods_id'], 2, 'adjust_price');
echo
'<td>'
.
$service_number
.
'</td><td>'
.
(
$v
[
'goods_number'
]
-
$service_number
)
.
'</td>
<td>'
.
$service_price
.
'</td>
'
;
echo
'<td>'
.
$service_number
.
'</td><td>'
.
(
$v
[
'goods_number'
]
-
$service_number
)
.
'</td>'
;
}
?>
<td>
<?=
$v
[
'status'
]
==
1
?
'正常'
:
'<i class="error">已关闭</i>'
?>
</td>
...
...
@@ -341,11 +341,11 @@
</tr>
<?php
}
?>
<?php
if
(
$order_info
[
'order_goods_type'
]
==
1
&&
isset
(
$service_number
)
&&
isset
(
$service_price
)
)
{
?>
<?php
if
(
$order_info
[
'order_goods_type'
]
==
1
&&
$service_amount
!=
0
)
{
?>
<tr>
<td>
售后金额:
</td>
<td>
<span
class=
"amount"
style=
"color:red;font-size:20px"
>
<?=
'- '
.
number_format
(
$service_number
*
$service_price
,
2
)
?>
</span>
<span
class=
"amount"
style=
"color:red;font-size:20px"
>
<?=
'- '
.
$service_amount
?>
</span>
</td>
</tr>
<?php
}
?>
...
...
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