|
@@ -1652,6 +1652,9 @@ class GoodsService
|
|
|
if (!empty($params['position'])){
|
|
|
$attributeJson['position'] = $params['position'];
|
|
|
}
|
|
|
+ if (isset($params['goods_service_premises'])){
|
|
|
+ $attributeJson['service_premises_id'] = $params['goods_service_premises'];
|
|
|
+ }
|
|
|
if (isset($params['min_count'])){
|
|
|
$attributeJson['min-count'] = $params['min_count'];
|
|
|
}else{
|
|
@@ -1660,9 +1663,6 @@ class GoodsService
|
|
|
if (isset($params['teachers'])){
|
|
|
$attributeJson['teachers'] = $params['teachers'];
|
|
|
}
|
|
|
- if (isset($params['goods_service_premises'])){
|
|
|
- $attributeJson['service_premises_id'] = $params['goods_service_premises'];
|
|
|
- }
|
|
|
$data['goods_attribute_json'] = json_encode($attributeJson, JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
|
|
@@ -1750,6 +1750,46 @@ class GoodsService
|
|
|
$data['goods_attribute_json'] = json_encode($data['goods_attribute_json']);
|
|
|
}
|
|
|
|
|
|
+ if (!empty($params['address'])) {
|
|
|
+ if (!empty($data['goods_attribute_json']) && !is_array($data['goods_attribute_json'])) {
|
|
|
+ if (is_json($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = json_decode($data['goods_attribute_json'], true);
|
|
|
+ } else {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ } elseif (empty($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ $data['goods_attribute_json']['address'] = $params['address'];
|
|
|
+ $data['goods_attribute_json'] = json_encode($data['goods_attribute_json']);
|
|
|
+ }
|
|
|
+ if (!empty($params['position'])){
|
|
|
+ if (!empty($data['goods_attribute_json']) && !is_array($data['goods_attribute_json'])) {
|
|
|
+ if (is_json($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = json_decode($data['goods_attribute_json'], true);
|
|
|
+ } else {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ } elseif (empty($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ $data['goods_attribute_json']['position'] = $params['position'];
|
|
|
+ $data['goods_attribute_json'] = json_encode($data['goods_attribute_json']);
|
|
|
+ }
|
|
|
+ if (isset($params['goods_service_premises'])){
|
|
|
+ if (!empty($data['goods_attribute_json']) && !is_array($data['goods_attribute_json'])) {
|
|
|
+ if (is_json($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = json_decode($data['goods_attribute_json'], true);
|
|
|
+ } else {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ } elseif (empty($data['goods_attribute_json'])) {
|
|
|
+ $data['goods_attribute_json'] = [];
|
|
|
+ }
|
|
|
+ $data['goods_attribute_json']['service_premises_id'] = $params['goods_service_premises'];
|
|
|
+ $data['goods_attribute_json'] = json_encode($data['goods_attribute_json']);
|
|
|
+ }
|
|
|
+
|
|
|
foreach ($data as $key => $val) {
|
|
|
$row->{$key} = $val;
|
|
|
}
|