配置修改
This commit is contained in:
@ -309,7 +309,7 @@ class StatisticsLogic extends Logic
|
|||||||
|
|
||||||
return ['count' => $goods_count, 'lists' => $goods_list];
|
return ['count' => $goods_count, 'lists' => $goods_list];
|
||||||
}
|
}
|
||||||
public static function makeMpWechatQrcode( string $type = 'base64', array $extra = [])
|
public static function makeMpWechatQrcode( string $type = 'url', array $extra = [])
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -355,9 +355,16 @@ class StatisticsLogic extends Logic
|
|||||||
$contents = $save_dir . $file_name;
|
$contents = $save_dir . $file_name;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'url': // 保存并返回完整URL
|
||||||
|
$full_path = $save_dir . $file_name;
|
||||||
|
file_put_contents($full_path, $contents);
|
||||||
|
// 生成完整的可访问URL(根据实际域名调整)
|
||||||
|
$contents = request()->domain() . '/uploads/wxqrcode/' . $file_name;
|
||||||
|
break;
|
||||||
case 'base64':
|
case 'base64':
|
||||||
$mp_base64 = chunk_split(base64_encode($contents));
|
$mp_base64 = chunk_split(base64_encode($contents));
|
||||||
$contents = 'data:image/png;base64,' . $mp_base64;
|
$contents = 'data:image/png;base64,' . $mp_base64;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return data_success('',['qr_code'=>$contents, 'extra' => $extra]);
|
return data_success('',['qr_code'=>$contents, 'extra' => $extra]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user