webman/app/controller/RecommendController.php

32 lines
761 B
PHP

<?php
namespace app\controller;
use app\model\Recommend;
use App\Utils\API\PaymentNew;
use support\Request;
use App\Utils\ApiResponse;
use support\Log;
class RecommendController
{
protected $noNeedLogin = ['index'];
/**
* @Apidoc\Title("1.0 获取vip等级赠送积分")
* @Apidoc\Url("Recommend/index")
* @Apidoc\Method("POST")
*/
public function index(Request $request)
{
$invite_code = $request->get('invite_code');
$Recommend = Recommend::where('invite_code', $invite_code)->first();
if (!empty($Recommend)) {
$Recommend->open += 1;
$Recommend->save();
return redirect("http://127.0.0.1:8787/#/reg?i=$invite_code", 302);
}
return 0;
}
}