- 基础环境:Docker 部署配置,源码挂载实时同步 - 修复:super_admin 权限补全、登录重定向循环 - 开发:店铺营销账户账单 - 抖音账户(15字段汇总账单) - 开发:店铺营销账户账单 - 淘系支付宝账户(8字段流水账单) - 开发:店铺营销账户账单 - 拼多多账户(7字段流水账单) - 业务页面导航集成:config/business_navigation.php + Business\Pages 控制器 - 各平台独立表结构和视图,互不影响
61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\View\Components\Form\Group;
|
|
|
|
use App\Abstracts\View\Components\Form;
|
|
use App\Models\Setting\Currency as Model;
|
|
|
|
class Currency extends Form
|
|
{
|
|
public $type = 'currency';
|
|
|
|
public $path;
|
|
|
|
public $field;
|
|
|
|
public $currencies;
|
|
|
|
/**
|
|
* Get the view / contents that represent the component.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View|string
|
|
*/
|
|
public function render()
|
|
{
|
|
if (empty($this->name)) {
|
|
$this->name = 'currency_code';
|
|
}
|
|
|
|
$this->path = route('modals.currencies.create');
|
|
|
|
$this->field = [
|
|
'key' => 'code',
|
|
'value' => 'name'
|
|
];
|
|
|
|
$this->currencies = Model::enabled()->orderBy('name')->pluck('name', 'code');
|
|
|
|
if (! empty($this->options)) {
|
|
$this->currencies = $this->options;
|
|
}
|
|
|
|
$currency_id = old('currency.id', old('currency_id', null));
|
|
|
|
if (! empty($currency_id)) {
|
|
$this->selected = $currency_id;
|
|
|
|
if (! $this->currencies->has($currency_id)) {
|
|
$currency = Model::find($currency_id);
|
|
|
|
$this->currencies->put($currency->id, $currency->name);
|
|
}
|
|
}
|
|
|
|
if ($this->selected === null && empty($this->getParentData('model'))) {
|
|
$this->selected = default_currency();
|
|
}
|
|
|
|
return view('components.form.group.currency');
|
|
}
|
|
}
|