|
@@ -641,6 +641,21 @@ class GoodsService
|
|
|
if (isset($extendJson['address'])) {
|
|
|
$data['address'] = $extendJson['address'];
|
|
|
}
|
|
|
+ if (isset($extendJson['min-count'])){
|
|
|
+ $data['min_count'] = $extendJson['min-count'];
|
|
|
+ }
|
|
|
+ if (isset($extendJson['time'])){
|
|
|
+ $extendJsonTime = explode('至',$extendJson['time']);
|
|
|
+ if(isset($extendJsonTime[0]) && isset($extendJsonTime[1])){
|
|
|
+ $data['work_time'] = [
|
|
|
+ date('Y-m-d H:i:s',strtotime(date('Y-m-d ').$extendJsonTime[0])),
|
|
|
+ date('Y-m-d H:i:s',strtotime(date('Y-m-d ').$extendJsonTime[1])),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isset($extendJson['teachers'])){
|
|
|
+ $data['teachers'] = $extendJson['teachers'];
|
|
|
+ }
|
|
|
if (isset($extendJson['position'])) {
|
|
|
$data['position'] = $extendJson['position'];
|
|
|
}
|
|
@@ -1188,19 +1203,37 @@ class GoodsService
|
|
|
} else if (self::$week[$lastDate] - self::$week[$currentDate] + 1 == count($newDates)) {
|
|
|
$attributeJsonDate = $currentDate . '至' . $lastDate;
|
|
|
}
|
|
|
+
|
|
|
+ if (isset($params['work_time'])){
|
|
|
+ $workTimeStart = date('H:i',strtotime($params['work_time'][0]));
|
|
|
+ $workTimeEnd = date('H:i',strtotime($params['work_time'][1]));
|
|
|
+ $attributeJsonTime = $workTimeStart.'至'.$workTimeEnd;
|
|
|
+ }
|
|
|
+
|
|
|
$attributeJson = [
|
|
|
- 'icon' => '',
|
|
|
+ 'icon' => $model->goods_cover,
|
|
|
'date' => $attributeJsonDate,
|
|
|
'time' => $attributeJsonTime,
|
|
|
'dates' => $newDates ? array_values($newDates) : [],
|
|
|
'times' => $times,
|
|
|
'person' => $personTotal
|
|
|
];
|
|
|
+ if(isset($params['address'])){
|
|
|
+ $attributeJson['address'] = $params['address'];
|
|
|
+ }
|
|
|
+ if (isset($params['min_count'])){
|
|
|
+ $attributeJson['min-count'] = $params['min_count'];
|
|
|
+ }
|
|
|
+ if (isset($params['teachers'])){
|
|
|
+ $attributeJson['teachers'] = $params['teachers'];
|
|
|
+ }
|
|
|
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'];
|
|
|
}
|
|
|
$model->goods_attribute_json = json_encode($attributeJson, JSON_UNESCAPED_UNICODE);
|
|
@@ -1541,25 +1574,32 @@ class GoodsService
|
|
|
$attributeJsonDate = $currentDate . '至' . $lastDate;
|
|
|
}
|
|
|
$attributeJson['date'] = $attributeJsonDate;
|
|
|
+ $attributeJson['icon'] = $data['goods_cover'] ?? '';
|
|
|
$attributeJson['time'] = $attributeJsonTime;
|
|
|
$attributeJson['dates'] = $newDates ? array_values($newDates) : [];
|
|
|
$attributeJson['times'] = $times;
|
|
|
$attributeJson['person'] = $personTotal;
|
|
|
-// $attributeJson = [
|
|
|
-// 'icon' => '',
|
|
|
-// 'date' => $attributeJsonDate,
|
|
|
-// 'time' => $attributeJsonTime,
|
|
|
-// 'dates' => $newDates ? array_values($newDates) : [],
|
|
|
-// 'times' => $times,
|
|
|
-// 'person' => $personTotal
|
|
|
-// ];
|
|
|
+
|
|
|
+ if (isset($params['work_time'])){
|
|
|
+ $workTimeStart = date('H:i',strtotime($params['work_time'][0]));
|
|
|
+ $workTimeEnd = date('H:i',strtotime($params['work_time'][1]));
|
|
|
+ $attributeJson['time'] = $workTimeStart.'至'.$workTimeEnd;
|
|
|
+ }
|
|
|
if (!empty($params['appointment_label'])) {
|
|
|
$attributeJson['label'] = $params['appointment_label'];
|
|
|
}
|
|
|
- if (!empty($params['address']) && !empty($params['position'])) {
|
|
|
+ if (!empty($params['address'])) {
|
|
|
$attributeJson['address'] = $params['address'];
|
|
|
+ }
|
|
|
+ if (!empty($params['position'])){
|
|
|
$attributeJson['position'] = $params['position'];
|
|
|
}
|
|
|
+ if (isset($params['min_count'])){
|
|
|
+ $attributeJson['min-count'] = $params['min_count'];
|
|
|
+ }
|
|
|
+ if (isset($params['teachers'])){
|
|
|
+ $attributeJson['teachers'] = $params['teachers'];
|
|
|
+ }
|
|
|
$data['goods_attribute_json'] = json_encode($attributeJson, JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
|