diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index b03722382..1844286e2 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -7,6 +7,7 @@ use app\admin\lists\BaseAdminDataLists; use app\common\lists\ListsExcelInterface; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\lists\ListsSearchInterface; +use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\delivery_service\DeliveryService; use app\common\model\store_category\StoreCategory; use app\common\model\store_product\StoreProduct; @@ -62,6 +63,7 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item) use($job_ids){ + $item->order_sn=BeforehandOrder::where('id',$item['order_id'])->value('order_id'); $find=StoreProduct::where('id',$item->product_id)->withTrashed()->find(); $item->store_name=$find->store_name; $item->store_info=$find->store_info; diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 985b39ec5..df4a11ef0 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -5,8 +5,10 @@ namespace app\admin\logic\purchase_product_offer; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\logic\BaseLogic; +use app\common\model\auth\Admin; use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; +use app\common\model\delivery_service\DeliveryService; use app\common\model\dict\DictData; use app\common\model\store_product\StoreProduct; use app\common\model\store_product_price\StoreProductPrice; @@ -112,8 +114,11 @@ class PurchaseProductOfferLogic extends BaseLogic public static function setProcureInfo(array $params): bool { $offer = PurchaseProductOffer::where(['id' => $params['id']])->find(); - if($offer['buyer_id']!=$params['admin_id']){ - throw new BusinessException('您不是当事采购员,无法设置采购信息'); + $uid=Admin::where('id',$params['admin_id'])->value('uid'); + if($params['admin_id']!=1){ + if($offer['buyer_id']!=$uid){ + throw new BusinessException('您不是当事采购员,无法设置采购信息'); + } } Db::startTrans(); try {