56 lines
1.5 KiB
PHP
Executable File
56 lines
1.5 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\Reward;
|
|
|
|
final class TestController extends BaseController
|
|
{
|
|
public function index(ServerRequest $request, Response $response, array $args): ResponseInterface
|
|
{
|
|
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')
|
|
);
|
|
}
|
|
}
|