Merge pull request 'dev' (#328) from dev into main

Reviewed-on: #328
This commit is contained in:
mkm 2024-11-14 15:41:58 +08:00
commit bb21f1aed7
2 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,7 @@ use app\common\model\auth\Admin;
use app\common\model\purchase_product_offer\PurchaseProductOffer;
use app\common\model\system_store\SystemStore;
use app\common\lists\ListsExcelInterface;
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
/**
* 预订单表列表
@ -51,6 +52,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function ($item){
$item['outbound']='';
if($item->admin_id){
$item->admin_name=Admin::where(['id'=>$item->admin_id])->value('name');
}else{
@ -66,6 +68,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
$item->order_type_name='线上订单';
}elseif($item->order_type==5){
$item->order_type_name='仓库补货';
$item->outbound='无须出库';
}elseif($item->order_type==6){
$item->order_type_name='往期补单';
}
@ -79,8 +82,13 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
$item->msg='商品没有入库';
}
}
if($item->msg==''){
$count=BeforehandOrderCartInfo::where('is_buyer',0)->where('bhoid',$item['id'])->count('id');
if($count>0){
$item->msg='有'.$count.'个商品未设置';
}
}
$item['warehousing']='';
$item['outbound']='';
$item['system_store']='';
if($item['warehousing_id']>0){
$item->warehousing='已入库|'.$item['warehousing_id'];

View File

@ -345,6 +345,9 @@ class BeforehandOrderLogic extends BaseLogic
if (!$order) {
throw new BusinessException('该订单不存在');
}
if($order['order_type']==5){
throw new BusinessException('仓库补货,不用出库');
}
if ($order['outbound_id'] > 0) {
throw new BusinessException('该订单已创建出库单');
}