28 lines
710 B
PHP
28 lines
710 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Server\H5;
|
||
|
|
|
||
|
|
use App\Http\Response\ResponseJson;
|
||
|
|
use App\Models\Server\GeneralQrcode;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
|
||
|
|
class GeneralQrcodeController extends Controller
|
||
|
|
{
|
||
|
|
use ResponseJson;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 活码中转
|
||
|
|
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||
|
|
* @throws \Exception
|
||
|
|
*/
|
||
|
|
public function transfer()
|
||
|
|
{
|
||
|
|
$id = request()->id;
|
||
|
|
if (empty($id)) throw new \Exception('缺少跳转码id');
|
||
|
|
$qrcode = GeneralQrcode::find($id);
|
||
|
|
$qrcode->increment('scan_num');
|
||
|
|
return redirect($qrcode->jump_url);
|
||
|
|
}
|
||
|
|
}
|