增加预订单列表中采购商品状态的提示信息
本次更新在预订单列表中添加了采购商品状态的提示消息。现在,每个预订单项将显示有多少商品正在采购中,以及是否有商品尚未入库。这将帮助管理员更好地了解每个订单的采购进度和库存状态。
This commit is contained in:
parent
45c32ddd40
commit
c1d1ccc56d
@ -7,6 +7,7 @@ use app\admin\lists\BaseAdminDataLists;
|
|||||||
use app\common\model\beforehand_order\BeforehandOrder;
|
use app\common\model\beforehand_order\BeforehandOrder;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\model\auth\Admin;
|
use app\common\model\auth\Admin;
|
||||||
|
use app\common\model\purchase_product_offer\PurchaseProductOffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预订单表列表
|
* 预订单表列表
|
||||||
@ -43,7 +44,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return BeforehandOrder::where($this->searchWhere)
|
return BeforehandOrder::where($this->searchWhere)
|
||||||
->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark'])
|
->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark','warehousing_id'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item){
|
->select()->each(function ($item){
|
||||||
@ -63,6 +64,16 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
}elseif($item->order_type==5){
|
}elseif($item->order_type==5){
|
||||||
$item->order_type_name='仓库补货';
|
$item->order_type_name='仓库补货';
|
||||||
}
|
}
|
||||||
|
$item->msg='';
|
||||||
|
$count1=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',0)->count('id');
|
||||||
|
if($count1>0){
|
||||||
|
$item->msg='有'.$count1.'个商品采购中';
|
||||||
|
}else{
|
||||||
|
$count2=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',1)->count('id');
|
||||||
|
if($count2>0 &&$item['warehousing_id']==0){
|
||||||
|
$item->msg='商品没有入库';
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user