From 10ff788c7a934aee99f149411eb42bde481b5f71 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 27 Aug 2020 12:05:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eorder=5Fid=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/AttachmentService.php | 13 ++++++++ app/Service/AttachmentServiceInterface.php | 2 ++ app/Service/OrderListService.php | 35 +++++++++++----------- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/app/Service/AttachmentService.php b/app/Service/AttachmentService.php index 65ab9a4..a788e6c 100644 --- a/app/Service/AttachmentService.php +++ b/app/Service/AttachmentService.php @@ -70,4 +70,17 @@ class AttachmentService implements AttachmentServiceInterface $path .= '/'.date('Y').'/'.date('m').'/'.date('d'); return $baseDir.$path; } + + public function switchImgToAliOss($path, $bucket = 'thumbnail_q50') + { + if (strpos($path, 'http') === false || strpos($path, 'https') === false) { + $path = 'https://img.lanzulive.com/' . $path; + } else { + $temp = explode('//', $path); + $temp = explode('/', $temp[1]); + unset($temp[0]); + $path = 'https://img.lanzulive.com/' . implode('/', $temp); + } + return $path . '!' . $bucket; + } } \ No newline at end of file diff --git a/app/Service/AttachmentServiceInterface.php b/app/Service/AttachmentServiceInterface.php index 28439b2..cacdc9e 100644 --- a/app/Service/AttachmentServiceInterface.php +++ b/app/Service/AttachmentServiceInterface.php @@ -20,4 +20,6 @@ interface AttachmentServiceInterface * @param $filesystem */ public function base64Upload($contents, $path, $filesystem); + + public function switchImgToAliOss($path, $bucket = ''); } \ No newline at end of file diff --git a/app/Service/OrderListService.php b/app/Service/OrderListService.php index fc514a2..dc600f0 100644 --- a/app/Service/OrderListService.php +++ b/app/Service/OrderListService.php @@ -78,24 +78,25 @@ class OrderListService implements OrderListServiceInterface ['type','=',1], ]) ->select( + 'id as order_id', 'address', - 'box_money', - 'delivery_time', - 'dn_state', - 'money', - 'name', - 'note', - 'order_num', - 'order_type', - 'pay_time', - 'pay_type', - 'state', - 'dada_fee as ps_money', - 'time', - 'type', - 'yhq_money2', - 'tel', - 'dada_status' + 'box_money', + 'delivery_time', + 'dn_state', + 'money', + 'name', + 'note', + 'order_num', + 'order_type', + 'pay_time', + 'pay_type', + 'state', + 'dada_fee as ps_money', + 'time', + 'type', + 'yhq_money2', + 'tel', + 'dada_status' ) ->first(); $order = Db::table('ims_cjdc_order as o')