|
|
@@ -91,11 +91,10 @@ class ShopController extends BaseController
|
|
|
if (empty($shop)) {
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
- ShopService::valid($shop->attributes, $this->sjId);
|
|
|
- $gatheringCode = ShopService::generateGatheringCode($this->sjId, $id);
|
|
|
- $filename = Yii::$app->params['hdImgHost'] . 'gathering/1.jpg?x-oss-process=image/watermark,image_' . base64_encode($gatheringCode . '?x-oss-process=image/resize,P_55') . ',g_nw,x_278,y_465/watermark,image_' . base64_encode('gathering/logo.jpg') . ',g_nw,x_510,y_685';
|
|
|
+ ShopClass::valid($shop->attributes, $this->sjId);
|
|
|
+ $imgUrl = ShopClass::generateGatheringCode($this->sjId, $id);
|
|
|
$shopName = $shop->shopName ?? '';
|
|
|
- $file = fopen($filename, "rb");
|
|
|
+ $file = fopen($imgUrl, "rb");
|
|
|
Header("Content-type: application/octet-stream ");
|
|
|
Header("Accept-Ranges: bytes ");
|
|
|
Header("Content-Disposition: attachment;filename={$shopName}收款码.jpg");
|
|
|
@@ -107,6 +106,19 @@ class ShopController extends BaseController
|
|
|
fclose($file);
|
|
|
}
|
|
|
|
|
|
+ //获取二维码
|
|
|
+ public function actionGetGatheringCodeUrl()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->get('id', 0);
|
|
|
+ $shop = ShopService::getById($id, true);
|
|
|
+ if (empty($shop)) {
|
|
|
+ util::fail('没有找到门店');
|
|
|
+ }
|
|
|
+ ShopClass::valid($shop->attributes, $this->sjId);
|
|
|
+ $imgUrl = ShopClass::generateGatheringCode($this->sjId, $id);
|
|
|
+ util::success(['url' => $imgUrl]);
|
|
|
+ }
|
|
|
+
|
|
|
//获取小程序的收款码 ssh
|
|
|
public function actionGatheringMiniCode()
|
|
|
{
|