dongxiaoqin 1 год назад
Родитель
Сommit
cabb1884cb
2 измененных файлов с 10 добавлено и 9 удалено
  1. 8 7
      app/api/logic/GroupActivityLogic.php
  2. 2 2
      app/common/command/AutomaticDispatch.php

+ 8 - 7
app/api/logic/GroupActivityLogic.php

@@ -35,15 +35,16 @@ class GroupActivityLogic extends BaseLogic
         $detail = GroupActivityCategory::where('id',$id)->where('status',1)->field('id,title,images,block_data')->findOrEmpty()->toArray();
         if($detail) {
             $detail['block_data'] = $detail['block_data'] ? json_decode($detail['block_data'],true) : [];
-            if ($block_key) {
-                foreach($detail['block_data'] as $item) {
-                    if ($block_key == $item['block_key']) {
-                        return $item;
-                    }
+            
+            foreach($detail['block_data'] as $item) {
+                foreach($item['activity'] as &$activity) {
+                    $activity['end_time'] = is_numeric($activity['end_time']) ? $activity['end_time'] : strtotime($activity['end_time']);
+                }
+                if ($block_key == $item['block_key']) {
+                    return $item;
                 }
-            } else {
-                $detail['images'] = $detail['images']? explode(",",$detail['images']) : [];
             }
+            $detail['images'] = $detail['images']? explode(",",$detail['images']) : [];
         }
         return $detail;
     }

+ 2 - 2
app/common/command/AutomaticDispatch.php

@@ -233,7 +233,7 @@ class AutomaticDispatch extends Command
                     $this->customerList[] = [
                         'phone' => $worker['mobile'],
                         'properties' => [
-                            // '订单号' => substr($item['work_sn'], -4),
+                            '订单号' => substr($item['work_sn'], -4),
                             // '详细地址'=>$item['address'],
                             // '服务类型'=> isset($this->categoryType[$item['category_type']]) ? $this->categoryType[$item['category_type']] : '',
                             // '客户手机号'=>$item['mobile']
@@ -327,7 +327,7 @@ class AutomaticDispatch extends Command
                 $this->customerList[] = [
                     'phone' => MasterWorker::where('id',$worker['master_worker_id'])->value('mobile'),
                     'properties' => [
-                        // '订单号' => substr($item['work_sn'], -4),
+                        '订单号' => substr($item['work_sn'], -4),
                         // '详细地址'=>$item['address'],
                         // '服务类型'=> isset($this->categoryType[$item['category_type']]) ? $this->categoryType[$item['category_type']] : '',
                         // '客户手机号'=>$item['mobile']