Commit ae500a44 by 朱继来

订单详情添加售后数量、单价等

parent b23c3125
......@@ -337,18 +337,18 @@ function getOrderPurPrice($xls_sn)
return $data;
}
// 获取已提交售后单数量
function getOrderServiceNum($order_id, $goods_id)
// 获取售后单信息
function getOrderServiceNum($order_id, $goods_id, $status=1, $field='adjust_number')
{
$OrderServiceModel = new OrderServiceModel;
$OrderServiceItemsModel = new OrderServiceItemsModel;
return $OrderServiceModel->from('lie_order_service as s')
->leftJoin('lie_order_service_items as i', 's.id', '=', 'i.service_id')
->where('s.service_status', '>', 1)
->where('s.service_status', '>', $status)
->where('i.order_id', $order_id)
->where('i.goods_id', $goods_id)
->sum('i.adjust_number');
->sum('i.'.$field);
}
......
......@@ -64,6 +64,11 @@
<th>商品备注</th>
<th>合同备注</th>
<?php if ($order_info['order_goods_type'] == 1) { ?>
<th>售后数量</th>
<th>剩余数量</th>
<th>售后单价</th>
<?php } ?>
<th>状态</th>
</tr>
</thead>
......@@ -142,6 +147,14 @@
<td><?= !empty($v['remarks']) ? $v['remarks'] : '' ?></td>
<td><?= !empty($v['contract_remark']) ? $v['contract_remark'] : '' ?></td>
<?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');
echo '<td>'.$service_number.'</td><td>'.($v['goods_number'] - $service_number).'</td><td>'.$service_price.'</td>';
}
?>
<td><?= $v['status'] == 1 ? '正常' : '<i class="error">已关闭</i>' ?></td>
</tr>
<?php } ?>
......@@ -323,6 +336,15 @@
</td>
</tr>
<?php } ?>
<?php if ($order_info['order_goods_type'] == 1 && isset($service_number) && isset($service_price)) { ?>
<tr>
<td>售后金额:</td>
<td>
<span class="amount" style="color:red;font-size:20px"><?= '- '.number_format($service_number * $service_price, 2) ?></span>
</td>
</tr>
<?php } ?>
</table>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment