Browse Source

新增order_id返回

master
weigang 6 years ago
parent
commit
10ff788c7a
  1. 13
      app/Service/AttachmentService.php
  2. 2
      app/Service/AttachmentServiceInterface.php
  3. 1
      app/Service/OrderListService.php

13
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;
}
}

2
app/Service/AttachmentServiceInterface.php

@ -20,4 +20,6 @@ interface AttachmentServiceInterface
* @param $filesystem
*/
public function base64Upload($contents, $path, $filesystem);
public function switchImgToAliOss($path, $bucket = '');
}

1
app/Service/OrderListService.php

@ -78,6 +78,7 @@ class OrderListService implements OrderListServiceInterface
['type','=',1],
])
->select(
'id as order_id',
'address',
'box_money',
'delivery_time',

Loading…
Cancel
Save