Commit 272e752e by 杨树贤

优化布局

parent ce63ba6c
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
vendor/
......@@ -236,10 +236,10 @@ class SupplierController extends Controller
];
}, $systemTags);
$customerTags = $tagService->getTagsBySupplierId($supplierId, 2);
$supplier['customer_tags'] = $customerTags ? implode(',', $customerTags['list']) : [];
$supplier['customer_tags'] = $customerTags ? implode(',', $customerTags['list']) : '';
$supplierModel = new SupplierChannelModel();
$supplierModel->where('supplier_id', $supplierId)->update([
'customer_tags' => $supplier['customer_tags'],
'customer_tags' => $supplier['customer_tags']?:'',
]);
$this->data['supplier'] = $supplier;
$this->data['address'] = $supplierService->getAddress($supplierId);
......@@ -251,7 +251,6 @@ class SupplierController extends Controller
$this->data['brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
$this->data['exclude_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
$this->data['agency_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['agency_brands']);
$ruleService = new RuleService();
$this->data['rule'] = $ruleService->getSupplierRule($supplier['supplier_code']);
......
......@@ -28,18 +28,23 @@ class SupplierTagService
//标签系统获取标签
public function getSystemTags()
{
$response = $this->client->get('/get?tag_use=14');
$data = json_decode($response->getBody()->getContents(), true);
$data = !empty($data['data']) ? $data['data'] : [];
$result = [];
foreach ($data as $key => $value) {
if (empty($value)) {
continue;
try {
$response = $this->client->get('/get?tag_use=14');
$data = json_decode($response->getBody()->getContents(), true);
$data = !empty($data['data']) ? $data['data'] : [];
$result = [];
foreach ($data as $key => $value) {
if (empty($value)) {
continue;
}
$result[] = [
'tag_id' => $value,
'tag_name' => $value,
];
}
$result[] = [
'tag_id' => $value,
'tag_name' => $value,
];
} catch (\Exception $exception) {
return [];
}
return $result;
}
......@@ -56,15 +61,14 @@ class SupplierTagService
} catch (\Exception $exception) {
return [];
}
}
public function getSystemTagsBySupplierId($supplierId)
{
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->select(['system_tags', 'united_tags'])
->first()->toArray();
$systemTags = $supplier['system_tags']?explode(',',$supplier['system_tags']):[];
$unitedTags = $supplier['united_tags']?explode(',',$supplier['united_tags']):[];
$systemTags = $supplier['system_tags'] ? explode(',', $supplier['system_tags']) : [];
$unitedTags = $supplier['united_tags'] ? explode(',', $supplier['united_tags']) : [];
return array_merge($systemTags, $unitedTags);
}
......
......@@ -256,7 +256,6 @@
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label"><span class="require">*</span>合作类型</label>
<div class="layui-input-block">
......@@ -269,8 +268,9 @@
title="{{$type}}">
@endforeach
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md3">
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment