Răsfoiți Sursa

完善功能

gorden 8 luni în urmă
părinte
comite
30c3c3d4cf

+ 28 - 9
app/admin/service/goods/GoodsService.php

@@ -1249,15 +1249,6 @@ class GoodsService
                 if (!empty($params['appointment_label'])) {
                     $attributeJson['label'] = $params['appointment_label'];
                 }
-                if (!empty($params['address'])) {
-                    $attributeJson['address'] = $params['address'];
-                }
-                if (!empty($params['position'])){
-                    $attributeJson['position'] = $params['position'];
-                }
-                if (isset($params['goods_service_premises'])){
-                    $attributeJson['service_premises_id'] = $params['goods_service_premises'];
-                }
                 $model->goods_attribute_json = json_encode($attributeJson, JSON_UNESCAPED_UNICODE);
 
 //                $times = [];
@@ -1352,6 +1343,34 @@ class GoodsService
                 $attributeJson['icon'] = str_replace(getenv('STORAGE_DOMAIN'), '', $params['goods_theme_icon']);
                 $model->goods_attribute_json = json_encode($attributeJson);
             }
+            
+            if (!empty($params['address'])) {
+                if (!empty($model->goods_attribute_json) && !is_array($model->goods_attribute_json)) {
+                    $attributeJson = json_decode($model->goods_attribute_json, true);
+                } elseif (empty($model->goods_attribute_json)) {
+                    $attributeJson = [];
+                }
+                $attributeJson['address'] = $params['address'];
+                $model->goods_attribute_json = json_encode($attributeJson);
+            }
+            if (!empty($params['position'])){
+                if (!empty($model->goods_attribute_json) && !is_array($model->goods_attribute_json)) {
+                    $attributeJson = json_decode($model->goods_attribute_json, true);
+                } elseif (empty($model->goods_attribute_json)) {
+                    $attributeJson = [];
+                }
+                $attributeJson['position'] = $params['position'];
+                $model->goods_attribute_json = json_encode($attributeJson);
+            }
+            if (isset($params['goods_service_premises'])){
+                if (!empty($model->goods_attribute_json) && !is_array($model->goods_attribute_json)) {
+                    $attributeJson = json_decode($model->goods_attribute_json, true);
+                } elseif (empty($model->goods_attribute_json)) {
+                    $attributeJson = [];
+                }
+                $attributeJson['service_premises_id'] = $params['goods_service_premises'];
+                $model->goods_attribute_json = json_encode($attributeJson);
+            }
 
             if ($model->save()) {
                 return $model->goods_id;

+ 1 - 3
app/admin/service/member/MemberService.php

@@ -181,9 +181,7 @@ class MemberService
                     if ($item['pay_category'] == 'RECHARGE' && (!isset($extendJson['notify']) || $extendJson['notify'] != 'success')) {
                         continue;
                     }
-                    dump(floatval($extendJson['added_amount']).'----0');
                     if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {
-                        dump('进来了');
                         $data[] = [
                             'join_pay_member_id' => $item['join_pay_member_id'],
                             'pay_addtimes' => $item['pay_addtimes'],
@@ -205,7 +203,7 @@ class MemberService
             if (in_array($item['pay_category'], ['RECHARGE', 'REFUND'])) {
                 if (!empty($item['pay_extend_json'])) {
                     $extendJson = json_decode($item['pay_extend_json'], true);
-                    if (isset($extendJson['added_amount'])) {
+                    if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {
                         $data[] = [
                             'join_pay_member_id' => $item['join_pay_member_id'],
                             'pay_addtimes' => $item['pay_addtimes'],