|
|
|
@ -90,7 +90,7 @@ class AgentProductController extends AdminController |
|
|
|
ProductStatus::REFUSE => 'danger', |
|
|
|
ProductStatus::SOLD_OUT => 'warning', |
|
|
|
], 'primary'); |
|
|
|
if (Admin::user()->type != AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type != AgentType::OPERATOR) { |
|
|
|
$grid->column('is_rec')->switch()->help('推荐后将在“我的”页面下方显示'); |
|
|
|
} |
|
|
|
$grid->column('updated_at'); |
|
|
|
@ -134,14 +134,14 @@ class AgentProductController extends AdminController |
|
|
|
$show->field('stock'); |
|
|
|
$show->field('category.name', '分类'); |
|
|
|
$show->field('status')->using(ProductStatus::array()); |
|
|
|
if (Admin::user()->type == AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type == AgentType::OPERATOR) { |
|
|
|
$show->field('guide.name', '地接'); |
|
|
|
} |
|
|
|
$show->field('title'); |
|
|
|
$show->field('pictures')->image('', 80, 80); |
|
|
|
$show->field('know')->unescape(); |
|
|
|
$show->field('content')->unescape(); |
|
|
|
if (Admin::user()->type != AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type != AgentType::OPERATOR) { |
|
|
|
$show->field('is_rec')->using(['未推荐', '已推荐']); |
|
|
|
$show->field('channel_id')->as(fn($v) => join(',', Channel::whereIn('id', explode(',', $v))->pluck('name')->toArray())); |
|
|
|
$show->field('earnest'); |
|
|
|
@ -171,7 +171,7 @@ class AgentProductController extends AdminController |
|
|
|
$form->display('id'); |
|
|
|
|
|
|
|
//计调版旅行社不允许选择计调云产品
|
|
|
|
if (Admin::user()->type == AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type == AgentType::OPERATOR) { |
|
|
|
$form->hidden('product_id')->value(0)->default(0); |
|
|
|
$form->hidden('type')->value(1)->default(1); |
|
|
|
// 组合销售
|
|
|
|
@ -249,7 +249,7 @@ class AgentProductController extends AdminController |
|
|
|
|
|
|
|
/*$form->radio('type') |
|
|
|
->options(['单品销售']) |
|
|
|
->default(Admin::user()->type == AgentType::CLUSTER ? 1 : 0)->required() |
|
|
|
->default(Admin::user()->type == AgentType::OPERATOR ? 1 : 0)->required() |
|
|
|
//->help('单品销售无需审核,组合销售需要审核才能上架')
|
|
|
|
->help('单品销售无需审核') |
|
|
|
->when(0, function (Form $form) { |
|
|
|
@ -318,7 +318,7 @@ class AgentProductController extends AdminController |
|
|
|
// ->required();
|
|
|
|
|
|
|
|
//计调版旅行社可以选择地接
|
|
|
|
if (Admin::user()->type == AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type == AgentType::OPERATOR) { |
|
|
|
$form->selectTable('guide_id', '地接人员') |
|
|
|
->title('选择地接人员') |
|
|
|
->dialogWidth('50%;min-width:600px;') //不起作用
|
|
|
|
@ -485,7 +485,7 @@ class AgentProductController extends AdminController |
|
|
|
} |
|
|
|
|
|
|
|
//如果是计调版旅行社,标记为是云产品
|
|
|
|
if (Admin::user()->type == AgentType::CLUSTER) { |
|
|
|
if (Admin::user()->type == AgentType::OPERATOR) { |
|
|
|
$form->hidden('is_cloud'); |
|
|
|
$form->is_cloud = 1; |
|
|
|
} |
|
|
|
|