diff --git a/app/AdminAgent/Controllers/DemandController.php b/app/AdminAgent/Controllers/DemandController.php index c22a9cf..1a778c0 100755 --- a/app/AdminAgent/Controllers/DemandController.php +++ b/app/AdminAgent/Controllers/DemandController.php @@ -4,6 +4,7 @@ namespace App\AdminAgent\Controllers; use App\AdminAgent\Actions\Grid\DemandConfirm; use App\AdminAgent\Lazys\DemandBiddingLazys; +use App\Common\AgentType; use App\Models\AgentProduct; use App\Models\Product; use App\Traits\ResponseHelper; @@ -147,17 +148,25 @@ class DemandController extends AdminController return json_encode($path); }); $form->hidden('deadline'); - $form->select('bidding_user_type','竞标用户类型') - ->when([2],function (Form $form){ - $form->select('agent_product_id','产品')->options(function (){ - return AgentProduct::query()->where('agent_id',Admin::user()->id)->where('status',1)->pluck('title','id'); - }); - }) - ->options([ - 1 => '供应商', - 2 => '地接' - ]) - ->default(1); + if (Admin::user()->type == AgentType::CLUSTER) { + $form->select('bidding_user_type', '竞标用户类型') + ->when([2], function (Form $form) { + $form->select('agent_product_id', '产品')->options(function () { + return AgentProduct::query()->where('agent_id', Admin::user()->id)->where('status', 1)->pluck('title', 'id'); + }); + }) + ->options([ + 1 => '供应商', + 2 => '地接' + ]) + ->default(1); + }else{ + $form->select('bidding_user_type', '竞标用户类型') + ->options([ + 1 => '供应商', + ]) + ->default(1); + } $form->decimal('price'); $form->number('stock'); $form->hidden('publisher_type');