diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 29e254235..90513d2ac 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -9,13 +9,15 @@ use app\common\lists\ListsSearchInterface; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\model\store_product\StoreProduct; use app\common\model\warehouse_product_storege\WarehouseProductStorege; +use app\common\lists\ListsExcelInterface; +use app\common\model\store_product_unit\StoreProductUnit; /** * 预订单购物详情表列表 * Class BeforehandOrderCartInfoLists * @package app\admin\listsbeforehand_order_cart_info */ -class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchInterface +class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -50,6 +52,7 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe ->order(['id' => 'desc']) ->select()->each(function($item){ $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image,unit')->withTrashed()->find(); + $item->unit_name=StoreProductUnit::where('id',$find->unit)->value('name'); $item['warehouse_stock']=WarehouseProductStorege::where('product_id',$item['product_id'])->value('nums')??0; $item['store_name']=$find['store_name']; $item['image']=$find['image']; @@ -79,4 +82,34 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe return BeforehandOrderCartInfo::where($this->searchWhere)->count(); } + /** + * @notes 导出文件名 + * @return string + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setFileName(): string + { + return '预订单商品列表'; + } + + + /** + * @notes 导出字段 + * @return string[] + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + $data=[ + 'store_name' => '商品名称', + 'warehouse_stock' => '仓库数量', + 'cart_num' => '需求数量', + 'unit_name' => '单位', + 'price' => '单价', + 'total_price' => '总价', + ]; + return $data; + } } \ No newline at end of file diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index 1bbb9e654..f292d17ee 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -58,6 +58,7 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc $item->image=$find->image; $item->unit_name=StoreProductUnit::where('id',$item->unit)->value('name'); $item->cate_name=StoreCategory::where('id',$find->cate_id)->value('name'); + $item->top_cate_name=StoreCategory::where('id',$find->top_cate_id)->value('name'); if($item->is_buyer==1){ $item->is_buyer_name='需要采购'; }elseif($item->is_buyer==-1){