|
|
@@ -42,9 +42,9 @@ class ShopController extends BaseController
|
|
|
ShopService::addShop($data);
|
|
|
util::complete();
|
|
|
}
|
|
|
-
|
|
|
- //下载收款码 shish 2020.2.29
|
|
|
- public function actionDownloadGatheringCode()
|
|
|
+
|
|
|
+ //下载微信和支付宝收款码 shish 2020.2.29
|
|
|
+ public function actionGatheringCode()
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id', 0);
|
|
|
$shop = ShopService::getById($id);
|
|
|
@@ -63,8 +63,32 @@ class ShopController extends BaseController
|
|
|
readfile($file);
|
|
|
}
|
|
|
|
|
|
- //下载注册会员码 shish 2020.2.29
|
|
|
- public function actionDownloadApplyMemberCode()
|
|
|
+ //获取小程序的收款码 shish
|
|
|
+ public function actionGatheringMiniCode()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->get('id', 0);
|
|
|
+ $extend = MerchantExtendService::getByMerchantId($this->merchantId);
|
|
|
+ if ($extend['miniAuth'] == 0) {
|
|
|
+ util::fail('您的小程序还没有授权');
|
|
|
+ }
|
|
|
+ $shop = ShopService::getById($id);
|
|
|
+ ShopService::valid($shop, $this->merchantId);
|
|
|
+ $applyMemberCode = wxUtil::generateGatheringMiniCode($this->merchant, $id);
|
|
|
+ $file = dirUtil::getImgDir() . $applyMemberCode;
|
|
|
+ if (file_exists($file) == false) {
|
|
|
+ util::fail('没有找到注册会员码');
|
|
|
+ }
|
|
|
+ $fileName = "门店({$id})小程序收款码.jpg";
|
|
|
+ $contentType = 'image/jpeg';
|
|
|
+ header("Cache-control: private");
|
|
|
+ header("Content-type: $contentType"); //设置要下载的文件类型
|
|
|
+ header("Content-Length:" . filesize($file)); //设置要下载文件的文件大小
|
|
|
+ header("Content-Disposition: attachment; filename=" . urldecode($fileName)); //设置要下载文件的文件名
|
|
|
+ readfile($file);
|
|
|
+ }
|
|
|
+
|
|
|
+ //下载会员注册码 shish 2020.2.29
|
|
|
+ public function actionApplyMemberCode()
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id', 0);
|
|
|
$extend = MerchantExtendService::getByMerchantId($this->merchantId);
|
|
|
@@ -96,5 +120,5 @@ class ShopController extends BaseController
|
|
|
ShopService::deleteShop($shop);
|
|
|
util::complete();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|