fix(purchase_product_offer): 修复采购产品报价单据相关问题

- 在 PurchaseProductOfferLists 中添加订单号字段
- 在 PurchaseProductOfferLogic 中修改采购信息设置权限验证逻辑
This commit is contained in:
mkm 2024-11-14 17:21:19 +08:00
parent 9482c590ff
commit e10e8ffe95
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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 {