111 lines
2.8 KiB
PHP
Executable File
111 lines
2.8 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Services\Auth;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Slim\Http\Response;
|
|
use Slim\Http\ServerRequest;
|
|
use Smarty\Exception as SmartyException;
|
|
use App\Services\Auth as AuthService;
|
|
use App\Models\Product;
|
|
use App\Models\Config;
|
|
use App\Models\UserCoupon;
|
|
use App\Services\Cron as CronService;
|
|
use App\Services\Reward;
|
|
|
|
final class TestController extends BaseController
|
|
{
|
|
public function index(ServerRequest $request, Response $response, array $args): ResponseInterface
|
|
{
|
|
|
|
error_reporting(E_ALL); // 报告所有错误
|
|
ini_set('display_errors', 1); // 显示错误
|
|
|
|
$k = $request->getQueryParam('k');
|
|
|
|
if ($k !== "wocaonide") {
|
|
exit('x');
|
|
}
|
|
|
|
|
|
$url = 'https://fuc.loc/api/tg/hook';
|
|
$data = [
|
|
'message' => [
|
|
'chat' => [
|
|
'id' => '-4668400285'
|
|
],
|
|
'text' => '/reply 11 sss'
|
|
]
|
|
];
|
|
|
|
$options = [
|
|
'http' => [
|
|
'header' => "Content-Type: application/json\r\n",
|
|
'method' => 'POST',
|
|
'content' => json_encode($data),
|
|
],
|
|
'ssl' => [
|
|
'verify_peer' => false,
|
|
'verify_peer_name' => false,
|
|
],
|
|
];
|
|
|
|
$context = stream_context_create($options);
|
|
$result = file_get_contents($url, false, $context);
|
|
|
|
if ($result === FALSE) {
|
|
die('Error');
|
|
}
|
|
|
|
echo $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exit;
|
|
|
|
$jobs = new CronService();
|
|
|
|
$jobs->bandwidthMerge();
|
|
|
|
exit;
|
|
if ($_ENV['is_loc'] !== true) {
|
|
exit;
|
|
}
|
|
|
|
$user_id = 3;
|
|
$user_ref_by = 4;
|
|
$paylist_total = 43;
|
|
$paylist_invoice_id = rand(1,99999);
|
|
$invoice_order_id = 10;
|
|
|
|
$r = Reward::issuePaybackReward($user_id, $user_ref_by, $paylist_total, $paylist_invoice_id, $invoice_order_id);
|
|
var_dump($r);
|
|
exit;
|
|
|
|
$user = AuthService::getUser();
|
|
|
|
$taocan = (new Product())->where('status', '1')
|
|
->where('type_by_time', '30')
|
|
->orderBy('price')
|
|
->get();
|
|
|
|
foreach ($taocan as $taocanTmp) {
|
|
$taocanTmp->content = json_decode($taocanTmp->content);
|
|
$taocanTmp->price = (int) $taocanTmp->price;
|
|
}
|
|
|
|
return $response->write(
|
|
$this->view()
|
|
->assign('is_login', $user->isLogin)
|
|
->assign('taocan', $taocan)
|
|
->fetch('email_test/verify_code.tpl')
|
|
);
|
|
}
|
|
}
|