diff --git a/app/crm/model/Follow.php b/app/crm/model/Follow.php index 778b669..bc284c6 100644 --- a/app/crm/model/Follow.php +++ b/app/crm/model/Follow.php @@ -38,13 +38,9 @@ class Follow extends Model */ public $timestamps = true; - protected $dates = ['created_at', 'updated_at', 'follow_time']; - protected $casts = [ - 'updated_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 - 'created_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 - 'follow_time' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 -// 'updated_at' => 'timestamp', // 指定序列化格式 -// 'created_at' => 'timestamp', // 指定序列化格式 + 'follow_time' => 'timestamp', // 指定序列化格式 + 'updated_at' => 'timestamp', // 指定序列化格式 + 'created_at' => 'timestamp', // 指定序列化格式 ]; } \ No newline at end of file diff --git a/app/crm/service/FollowService.php b/app/crm/service/FollowService.php index e8ce0f7..e300f11 100644 --- a/app/crm/service/FollowService.php +++ b/app/crm/service/FollowService.php @@ -59,6 +59,8 @@ class FollowService $oss_picture = $ossservice->generatePrivateUrl($follow['picture'], 86400); } $follow['picture_full'] = $oss_picture; + + $follow = Util::formatDate($follow,['created_at','updated_at','follow_time']); // $follow = Util::formatDate($follow); return $follow; } diff --git a/app/crmAdmin/service/CustomerService.php b/app/crmAdmin/service/CustomerService.php index 546bc7c..87ee62f 100644 --- a/app/crmAdmin/service/CustomerService.php +++ b/app/crmAdmin/service/CustomerService.php @@ -479,6 +479,7 @@ class CustomerService $ossservice = new OssService(); foreach ($follow as $item) { + $item = Util::formatDate($item,['created_at','updated_at','follow_time']); $item['picture_full'] = empty($item->picture)?'':$ossservice->generatePrivateUrl($item->picture); }