|
@@ -1479,13 +1479,12 @@ class wxUtil
|
|
|
file_put_contents($file, $result);
|
|
file_put_contents($file, $result);
|
|
|
return $behind . $fileName;
|
|
return $behind . $fileName;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //临时小程序码生成 shish 2020.4.17
|
|
|
|
|
- public static function generateUnlimitedMiniCode($merchant, $page, $scene = '', $isOpen = 0)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //收款小程序码
|
|
|
|
|
+ public static function generateGatheringMiniCode($merchant, $shopId, $isOpen = 0)
|
|
|
{
|
|
{
|
|
|
- $id = isset($merchant['id']) ? $merchant['id'] : 0;
|
|
|
|
|
- $fileName = stringUtil::shortUniqueId($id) . '.jpg';
|
|
|
|
|
- $behind = '/retail/mimiCode/' . date("Ym") . '/' . date("d") . '/' . $id . '/';
|
|
|
|
|
|
|
+ $fileName = $merchant['id'] . '_' . $shopId . '_apply_member.jpg';
|
|
|
|
|
+ $behind = '/retail/gatheringMimiCode/';
|
|
|
$filePath = dirUtil::getImgDir() . $behind;
|
|
$filePath = dirUtil::getImgDir() . $behind;
|
|
|
if (!file_exists($filePath)) {
|
|
if (!file_exists($filePath)) {
|
|
|
mkdir($filePath, 0777, true);
|
|
mkdir($filePath, 0777, true);
|
|
@@ -1494,19 +1493,19 @@ class wxUtil
|
|
|
if (file_exists($file)) {
|
|
if (file_exists($file)) {
|
|
|
return $behind . $fileName;
|
|
return $behind . $fileName;
|
|
|
}
|
|
}
|
|
|
|
|
+ $path = 'pages/pay/index?scan=1&shopId=' . $shopId;
|
|
|
$accessToken = self::getMiniProgramAccessToken($merchant, $isOpen);
|
|
$accessToken = self::getMiniProgramAccessToken($merchant, $isOpen);
|
|
|
- $url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={$accessToken}";
|
|
|
|
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/getwxacode?access_token={$accessToken}";
|
|
|
$curl = new curl\Curl();
|
|
$curl = new curl\Curl();
|
|
|
- $data = [];
|
|
|
|
|
- if (!empty($page)) {
|
|
|
|
|
- $data["page"] = $page;
|
|
|
|
|
- }
|
|
|
|
|
- $data["scene"] = $scene;
|
|
|
|
|
|
|
+ $data = [
|
|
|
|
|
+ "path" => $path,
|
|
|
|
|
+ "width" => 1000,
|
|
|
|
|
+ ];
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
file_put_contents($file, $result);
|
|
file_put_contents($file, $result);
|
|
|
return $behind . $fileName;
|
|
return $behind . $fileName;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//微信开放平台获取component_access_token
|
|
//微信开放平台获取component_access_token
|
|
|
public static function getComponentAccessToken($open)
|
|
public static function getComponentAccessToken($open)
|
|
|
{
|
|
{
|