|
|
@ -12,12 +12,12 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
|
|
namespace app\common\service\qrcode; |
|
|
|
namespace app\common\service\qrcode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use app\common\enum\Client as ClientEnum; |
|
|
|
|
|
|
|
use app\common\library\Download; |
|
|
|
|
|
|
|
use app\common\library\wechat\Qrcode as WechatQrcode; |
|
|
|
use app\common\model\h5\Setting as H5SettingModel; |
|
|
|
use app\common\model\h5\Setting as H5SettingModel; |
|
|
|
use app\common\model\wxapp\Setting as WxappSettingModel; |
|
|
|
use app\common\model\wxapp\Setting as WxappSettingModel; |
|
|
|
use app\common\service\BaseService; |
|
|
|
use app\common\service\BaseService; |
|
|
|
use app\common\library\Download; |
|
|
|
|
|
|
|
use app\common\library\wechat\Qrcode as WechatQrcode; |
|
|
|
|
|
|
|
use app\common\enum\Client as ClientEnum; |
|
|
|
|
|
|
|
use cores\exception\BaseException; |
|
|
|
use cores\exception\BaseException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -48,7 +48,7 @@ class BaseQRcode extends BaseService |
|
|
|
return $this->getH5Qrcode($storeId, $scene, $page, $channel); |
|
|
|
return $this->getH5Qrcode($storeId, $scene, $page, $channel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getOtherQrcode(int $storeId, string $url, string $channel = 'H5'): string |
|
|
|
public function getOtherQrcode(int $storeId, string $url, string $channel = 'H5'): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 根据指定渠道生成不同的二维码 |
|
|
|
// 根据指定渠道生成不同的二维码 |
|
|
|
$savePath = $this->getFilePath($storeId, $url, "", $channel); |
|
|
|
$savePath = $this->getFilePath($storeId, $url, "", $channel); |
|
|
@ -126,12 +126,12 @@ class BaseQRcode extends BaseService |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 文件目录 |
|
|
|
// 文件目录 |
|
|
|
//$dirPath = runtime_root_path() . "image/{$storeId}"; |
|
|
|
//$dirPath = runtime_root_path() . "image/{$storeId}"; |
|
|
|
$dirPath = root_path()."public/" . "temp/{$storeId}"; |
|
|
|
$dirPath = root_path() . "public/" . "temp/$storeId"; |
|
|
|
!is_dir($dirPath) && mkdir($dirPath, 0755, true); |
|
|
|
!is_dir($dirPath) && mkdir($dirPath, 0755, true); |
|
|
|
// 文件名称 |
|
|
|
// 文件名称 |
|
|
|
$fileName = 'qrcode_' . md5("{$storeId}{$scene}{$page}-{$channel}") . '.png'; |
|
|
|
$fileName = 'qrcode_' . md5("$storeId$scene$page-$channel") . '.png'; |
|
|
|
// 文件路径 |
|
|
|
// 文件路径 |
|
|
|
return "{$dirPath}/{$fileName}"; |
|
|
|
return "$dirPath/$fileName"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|