From c60228d72b5adf88d01820fe33f9d8cf55e3ffeb Mon Sep 17 00:00:00 2001 From: "HESU\\HESU" <1696136552@qq.com> Date: Wed, 19 Mar 2025 17:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/FollowController.php | 2 +- app/model/Customer.php | 16 ++++++++++------ app/model/Follow.php | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/controller/FollowController.php b/app/controller/FollowController.php index 19455fb..1e04aa6 100644 --- a/app/controller/FollowController.php +++ b/app/controller/FollowController.php @@ -74,7 +74,7 @@ class FollowController // $host = $request->host(); $url = 'http:'.$request->url(); foreach ($data as &$value){ - $value = Follow::getFollow($value,$url); + $value = Follow::getFollow($value); } return Util::success($data,trans('success')); diff --git a/app/model/Customer.php b/app/model/Customer.php index 0fa9fb6..0fd1897 100644 --- a/app/model/Customer.php +++ b/app/model/Customer.php @@ -41,10 +41,10 @@ class Customer extends Model protected $dates = ['deleted_at']; protected $casts = [ -// 'updated_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 -// 'created_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 - 'updated_at' => 'timestamp', // 指定序列化格式 - 'created_at' => 'timestamp', // 指定序列化格式 + 'updated_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 + 'created_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式 +// 'updated_at' => 'timestamp', // 指定序列化格式 +// 'created_at' => 'timestamp', // 指定序列化格式 ]; public static function getCustomer($customer) @@ -70,9 +70,13 @@ class Customer extends Model $begin_follow = Follow::select('id','created_at','updated_at') ->where($where) ->min('created_at'); + + $customer['begin_follow'] = Util::timeTotDate($begin_follow); - $customer['created_at'] = Util::timeTotDate($customer['created_at']); - $customer['updated_at'] = Util::timeTotDate($customer['updated_at']); +// $customer['created_at'] = Util::timeTotDate($customer['created_at']); +// $customer['updated_at'] = Util::timeTotDate($customer['updated_at']); + + $customer = Util::formatDate($customer,['follow_last']); $customer['car_type_name'] = empty($customer['car_type_id'])?'':CarType::where(['id'=>$customer['car_type_id']])->value('name'); // $customer['last_follow'] = $last_follow; diff --git a/app/model/Follow.php b/app/model/Follow.php index 27e3d75..4456a43 100644 --- a/app/model/Follow.php +++ b/app/model/Follow.php @@ -44,7 +44,7 @@ class Follow extends Model 'created_at' => 'timestamp', // 指定序列化格式 ]; - public static function getFollow($follow,$domain = '') + public static function getFollow($follow,$domain = 'https://vehicle-album.oss-cn-beijing.aliyuncs.com') { $follow['type_txt'] = Constants::FOLLOW[$follow['type']]; $follow['oss_picture'] = $domain.'/'.$follow['picture'];