|
|
@ -104,11 +104,18 @@ class AgentProductController extends Controller |
|
|
$agent_product->cost = ''; |
|
|
$agent_product->cost = ''; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//如果是单品销售,显示附加信息字段,组合产品和计调产品不显示
|
|
|
|
|
|
if ($agent_product->type == 0) { |
|
|
|
|
|
$agent_product->product = Product::query()->where('id', $agent_product->product_id)->first(['type', 'extends']); |
|
|
|
|
|
} else { |
|
|
|
|
|
$agent_product->product = null; |
|
|
|
|
|
|
|
|
//处理自定义字段
|
|
|
|
|
|
if (!empty($agent_product->product->diyForm->fields) && !$agent_product->product->diyForm->fields->isEmpty()) { |
|
|
|
|
|
foreach ($agent_product->product->diyForm->fields as &$v) { |
|
|
|
|
|
if ($v['type'] == 'checkbox' && is_array($v['options'])) { |
|
|
|
|
|
$v['options'] = array_map(function ($v2) { |
|
|
|
|
|
$arr['checked'] = false; |
|
|
|
|
|
$arr['disabled'] = false; |
|
|
|
|
|
$arr['name'] = $v2; |
|
|
|
|
|
return $arr; |
|
|
|
|
|
}, $v['options']); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//处理规格
|
|
|
//处理规格
|
|
|
|