Browse Source

修复form方法中,当type=1时,$agent_product查询不到数据的判断

dev
李可松 4 years ago
parent
commit
9ccbbb51c1
  1. 3
      app/AdminAgent/Controllers/SlideController.php

3
app/AdminAgent/Controllers/SlideController.php

@ -106,10 +106,11 @@ class SlideController extends AdminController
->dialogWidth('80%;min-width:825px;')
->from(SelectAgentProduct::make(['id' => $form->url]))
->options(function ($v) {
if (!$v) return [];
if (!$v || $this->type != 0) return [];
$agent_product = AgentProduct::with('product:id,title')
->select(['id', 'product_id'])
->firstWhere(['id' => $v]);
if (!$agent_product) return [];
return [$agent_product->id => $agent_product->product->title];
})
->pluck('product.title')

Loading…
Cancel
Save