添加发货价值

This commit is contained in:
baji 2025-03-10 18:23:44 +08:00
parent 6493a42be1
commit 3fd6d3b435
2 changed files with 9 additions and 1 deletions

View File

@ -251,6 +251,7 @@ class Order extends Base
$addtime = trim(input('get.addtime'));
$whe = array();
$whe1 = array();
if ($status) {
$whe[] = ['status', '=', $status];
} else {
@ -259,13 +260,16 @@ class Order extends Base
if ($user_id) {
$user_id = $user_id - 1260;
$whe[] = ['user_id', '=', $user_id];
$whe1[] = ['user_id', '=', $user_id];
}
if ($mobile) {
$mobile = User::field('id')->where('mobile', '=', $mobile)->value('id');
$whe[] = ['user_id', '=', $mobile];
$whe1[] = ['user_id', '=', $mobile];
}
if ($send_num) {
$whe[] = ['send_num', '=', $send_num];
$whe1[] = ['send_num', '=', $send_num];
}
if ($addtime) {
$time = explode(' - ', $addtime);
@ -275,6 +279,7 @@ class Order extends Base
$this->err('开始时间不能大于结束时间');
}
$whe[] = ['addtime', 'BETWEEN', array($start_time, $end_time)];
$whe1[] = ['addtime', 'BETWEEN', array($start_time, $end_time)];
$str_addtime = $start_time . '_' . $end_time;
} else {
$str_addtime = 0;
@ -283,6 +288,7 @@ class Order extends Base
$order = 'id desc';
$all_goodslist_money = 0;
$data = OrderListSend::getList($whe, $field, $order, $this->page);
$all_goodslist_money_sum = OrderList::where('status', '=',2)->where($whe1)->sum('goodslist_money');
foreach ($data['list'] as &$value) {
$user_info = User::field('nickname,headimg,mobile')->where(['id' => $value['user_id']])->find();
if ($user_info) {
@ -305,6 +311,8 @@ class Order extends Base
View::assign('user_id', $user_id ? $user_id : 0);
View::assign('mobile', $mobile ? $mobile : 0);
View::assign('send_num', $send_num ? $send_num : 0);
View::assign('all_goodslist_money_sum', $all_goodslist_money_sum ? $all_goodslist_money_sum : 0);
View::assign('all_goodslist_money', $all_goodslist_money ? $all_goodslist_money : 0);
View::assign('status', $status ? $status : 0);
View::assign('str_addtime', $str_addtime ? $str_addtime : 0);

View File

@ -48,7 +48,7 @@
<xblock>
<div style="padding-bottom: 10px;">
<a class="layui-btn" href="{:url('/admin/send_order_daochu',['user_id'=>$user_id,'mobile'=>$mobile,'send_num'=>$send_num,'addtime'=>$str_addtime,'status'=>$status])}">导出订单</a>
<span style="line-height:40px;float:right;">共有数据: {$count}条,总发货价值:{$all_goodslist_money}</span>
<span style="line-height:40px;float:right;">共有数据: {$count}条,全部价值:{$all_goodslist_money_sum},本页总发货价值:{$all_goodslist_money}</span>
</div>
</xblock>
<table class="layui-table" style="text-align:center">