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 ...@@ -236,10 +236,10 @@ class SupplierController extends Controller
]; ];
}, $systemTags); }, $systemTags);
$customerTags = $tagService->getTagsBySupplierId($supplierId, 2); $customerTags = $tagService->getTagsBySupplierId($supplierId, 2);
$supplier['customer_tags'] = $customerTags ? implode(',', $customerTags['list']) : []; $supplier['customer_tags'] = $customerTags ? implode(',', $customerTags['list']) : '';
$supplierModel = new SupplierChannelModel(); $supplierModel = new SupplierChannelModel();
$supplierModel->where('supplier_id', $supplierId)->update([ $supplierModel->where('supplier_id', $supplierId)->update([
'customer_tags' => $supplier['customer_tags'], 'customer_tags' => $supplier['customer_tags']?:'',
]); ]);
$this->data['supplier'] = $supplier; $this->data['supplier'] = $supplier;
$this->data['address'] = $supplierService->getAddress($supplierId); $this->data['address'] = $supplierService->getAddress($supplierId);
...@@ -251,7 +251,6 @@ class SupplierController extends Controller ...@@ -251,7 +251,6 @@ class SupplierController extends Controller
$this->data['brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']); $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['exclude_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
$this->data['agency_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['agency_brands']); $this->data['agency_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['agency_brands']);
$ruleService = new RuleService(); $ruleService = new RuleService();
$this->data['rule'] = $ruleService->getSupplierRule($supplier['supplier_code']); $this->data['rule'] = $ruleService->getSupplierRule($supplier['supplier_code']);
......
...@@ -28,18 +28,23 @@ class SupplierTagService ...@@ -28,18 +28,23 @@ class SupplierTagService
//标签系统获取标签 //标签系统获取标签
public function getSystemTags() public function getSystemTags()
{ {
$response = $this->client->get('/get?tag_use=14'); try {
$data = json_decode($response->getBody()->getContents(), true);
$data = !empty($data['data']) ? $data['data'] : []; $response = $this->client->get('/get?tag_use=14');
$result = []; $data = json_decode($response->getBody()->getContents(), true);
foreach ($data as $key => $value) { $data = !empty($data['data']) ? $data['data'] : [];
if (empty($value)) { $result = [];
continue; foreach ($data as $key => $value) {
if (empty($value)) {
continue;
}
$result[] = [
'tag_id' => $value,
'tag_name' => $value,
];
} }
$result[] = [ } catch (\Exception $exception) {
'tag_id' => $value, return [];
'tag_name' => $value,
];
} }
return $result; return $result;
} }
...@@ -56,15 +61,14 @@ class SupplierTagService ...@@ -56,15 +61,14 @@ class SupplierTagService
} catch (\Exception $exception) { } catch (\Exception $exception) {
return []; return [];
} }
} }
public function getSystemTagsBySupplierId($supplierId) public function getSystemTagsBySupplierId($supplierId)
{ {
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->select(['system_tags', 'united_tags']) $supplier = SupplierChannelModel::where('supplier_id', $supplierId)->select(['system_tags', 'united_tags'])
->first()->toArray(); ->first()->toArray();
$systemTags = $supplier['system_tags']?explode(',',$supplier['system_tags']):[]; $systemTags = $supplier['system_tags'] ? explode(',', $supplier['system_tags']) : [];
$unitedTags = $supplier['united_tags']?explode(',',$supplier['united_tags']):[]; $unitedTags = $supplier['united_tags'] ? explode(',', $supplier['united_tags']) : [];
return array_merge($systemTags, $unitedTags); return array_merge($systemTags, $unitedTags);
} }
......
...@@ -256,7 +256,6 @@ ...@@ -256,7 +256,6 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-md6">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label"><span class="require">*</span>合作类型</label> <label class="layui-form-label"><span class="require">*</span>合作类型</label>
<div class="layui-input-block"> <div class="layui-input-block">
...@@ -269,8 +268,9 @@ ...@@ -269,8 +268,9 @@
title="{{$type}}"> title="{{$type}}">
@endforeach @endforeach
</div> </div>
</div>
</div> </div>
</div>
<div class="layui-form-item">
<div class="layui-col-md3"> <div class="layui-col-md3">
<div class="layui-inline"> <div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter') @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