在预订单列表中添加系统仓库信息并优化订单创建逻辑

- 在预订单列表中增加系统仓库(system_store)信息,便于管理和查询
- 优化预订单创建逻辑,自动关联仓库信息,提高数据的准确性和完整性
This commit is contained in:
mkm 2024-10-15 13:09:19 +08:00
parent d838e01c43
commit a5594083c7
2 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ use app\common\model\beforehand_order\BeforehandOrder;
use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\purchase_product_offer\PurchaseProductOffer;
use app\common\model\system_store\SystemStore;
/**
* 预订单表列表
@ -76,12 +77,16 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
}
$item['warehousing']='';
$item['outbound']='';
$item['system_store']='';
if($item['warehousing_id']>0){
$item->warehousing='已入库|'.$item['warehousing_id'];
}
if($item['outbound_id']>0){
$item->outbound='已出库|'.$item['outbound_id'];
}
if($item['store_id']>0){
$item->system_store=SystemStore::where(['id'=>$item['store_id']])->value('name');
}
})
->toArray();
}

View File

@ -68,6 +68,7 @@ class BeforehandOrderLogic extends BaseLogic
$order = BeforehandOrder::create([
'order_id' => getNewOrderId('YG'),
'admin_id' => $params['admin_id'] ?? 0,
'store_id' => $params['store_id'] ?? 0,
'uid' => $uid,
'total_num' => $total_num,
'total_price' => $total_price,