no message

This commit is contained in:
hellcat 2025-08-29 13:19:24 +08:00
parent 794e93d417
commit a83ac2e655
17 changed files with 150 additions and 16 deletions

BIN
public/.DS_Store vendored

Binary file not shown.

BIN
resources/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -135,12 +135,10 @@
<i class="ti ti-file-dollar"></i>&nbsp;
账单
</a>
<!--
<a class="dropdown-item" href="/user/profile">
<i class="ti ti-info-square"></i>&nbsp;
账户
</a>
-->
<a class="dropdown-item" href="/user/edit">
<i class="ti ti-edit"></i>&nbsp;
资料

View File

@ -21,7 +21,7 @@ final class ProductController extends BaseController
'field' => [
'op' => '操作',
'id' => '商品ID',
'type_by_time' => '套餐时长',
'class_time' => '套餐时长',
'name' => '名称',
'price' => '售价',
'status' => '销售状态',
@ -194,7 +194,7 @@ final class ProductController extends BaseController
];
$product->type = $type;
$product->type_by_time = $class_time;
$product->class_time = $class_time;
$product->name = $name;
$product->price = $price;
$product->content = json_encode($content);
@ -304,7 +304,7 @@ final class ProductController extends BaseController
];
$product->type = $type;
$product->type_by_time = $class_time;
$product->class_time = $class_time;
$product->name = $name;
$product->price = $price;
$product->content = json_encode($content);
@ -355,7 +355,7 @@ final class ProductController extends BaseController
public function ajax(ServerRequest $request, Response $response, array $args): ResponseInterface
{
$products = (new Product())->orderBy('type_by_time', 'desc')->orderBy('price', 'asc')->get();
$products = (new Product())->orderBy('class_time', 'desc')->orderBy('price', 'asc')->get();
foreach ($products as $product) {
$product->op = '<button type="button" class="btn btn-red" id="delete-product-' . $product->id . '"

View File

@ -35,7 +35,7 @@ final class FrontController extends BaseController
$user = AuthService::getUser();
$taocan = (new Product())->where('status', '1')
->where('type_by_time', '30')
->where('class_time', '30')
->orderBy('price')
->get();

View File

@ -180,7 +180,7 @@ final class TestController extends BaseController
$user = AuthService::getUser();
$taocan = (new Product())->where('status', '1')
->where('type_by_time', '30')
->where('class_time', '30')
->orderBy('price')
->get();

View File

@ -88,6 +88,120 @@ final class CouponController extends BaseController
]);
}
// $content = json_decode($coupon->content);
// $iRet = 1;
// $sMsg = "优惠码可用";
//
// $sDateNow = date("Y-m-d");
//// $sDateNow = "2025-05-02";
// $oHuodong = Huodong::where("start_date", "<=", $sDateNow)->where("end_date", ">=", $sDateNow)->first();
//
// if ($oHuodong) {
// if ($oHuodong->class == "A") {
// if ($content->type === 'percentage') {
//
// $content->value = $oHuodong->coupon_global;
// $iRet = 2;
// $sMsg = '该优惠码可用,在【'.$oHuodong->title.'】期间视为-'.$oHuodong->coupon_global.'%优惠。';
//
// }
// }
// }
//
// if ($content->type === 'percentage') {
// $discount = $product->price * $content->value / 100;
// } else {
// $discount = $content->value;
// }
//
// $buy_price = $product->price - $discount;
// return $response->withJson([
// 'ret' => $iRet,
// 'msg' => $sMsg,
// 'discount' => $discount,
// 'buy_price' => $buy_price,
// ]);
return $response->withJson([
'code' => 111,
'shop' => 222,
'credit' => 333,
'total' => 444,
'total' => 555,
]);
}
public function check_old(ServerRequest $request, Response $response, array $args): ResponseInterface
{
$coupon_raw = $this->antiXss->xss_clean($request->getParam('coupon'));
$product_id = $this->antiXss->xss_clean($request->getParam('product_id'));
$invalid_coupon_msg = '优惠码无效';
if ($coupon_raw === '') {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
$coupon = (new UserCoupon())->where('code', $coupon_raw)->first();
if ($coupon === null || ($coupon->expire_time !== 0 && $coupon->expire_time < time())) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
$product = (new Product())->where('id', $product_id)->first();
if ($product === null) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
$limit = json_decode($coupon->limit);
if ($limit->disabled) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
if ($limit->product_id !== '' && ! in_array($product_id, explode(',', $limit->product_id))) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
$user = $this->user;
$use_limit = $limit->use_time;
if ($use_limit > 0) {
$user_use_count = (new Order())->where('user_id', $user->id)->where('coupon', $coupon->code)->count();
if ($user_use_count >= $use_limit) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
}
$total_use_limit = $limit->total_use_time;
if ($total_use_limit > 0 && $coupon->use_count >= $total_use_limit) {
return $response->withJson([
'ret' => 0,
'msg' => $invalid_coupon_msg,
]);
}
$content = json_decode($coupon->content);
$iRet = 1;

View File

@ -148,7 +148,7 @@ final class OrderController extends BaseController
// if ($oHuodong) {
// if ($oHuodong->class == "A") {
// // 月套餐以上禁用优惠码
// if ($product->type_by_time > 32) {
// if ($product->class_time > 32) {
// return $response->withJson([
// 'ret' => 0,
// 'msg' => '该商品在【'.$oHuodong->title.'】期间不能使用优惠码',

View File

@ -20,17 +20,17 @@ final class ProductController extends BaseController
public function index(ServerRequest $request, Response $response, array $args): ResponseInterface
{
$tabps = (new Product())->where('status', '1')
->where('type_by_time', '30')
->where('class_time', '30')
->orderBy('price')
->get();
$bandwidths = (new Product())->where('status', '1')
->where('type_by_time', '90')
->where('class_time', '90')
->orderBy('price')
->get();
$times = (new Product())->where('status', '1')
->where('type_by_time', '365')
->where('class_time', '365')
->orderBy('price')
->get();
// echo '<pre>';var_dump($tabps);

View File

@ -703,8 +703,8 @@ final class Cron
if ($content->class_time > 32) {
$oProduct = Product::where("name", $order->product_name)
->where("type_by_time", "<", $content->class_time)
->orderBy("type_by_time", "desc")
->where("class_time", "<", $content->class_time)
->orderBy("class_time", "desc")
->first();
if ($oProduct) {

View File

@ -68,6 +68,10 @@ final class Epay extends Base
$type = $this->antiXss->xss_clean($request->getParam('type'));
$redir = $this->antiXss->xss_clean($request->getParam('redir'));
//// 修改,先创建账单
////////end//////
if ($price <= 0) {
return $response->withJson([
'ret' => 0,
@ -111,6 +115,14 @@ final class Epay extends Base
$data['sign_type'] = $this->epay['sign_type'];
$client = new Client();
//// 本地直接成功
if ($_ENV['is_loc'] == true) {
$this->postPayment($pl->tradeno);
return $response->withJson(['state' => 'success', 'msg' => 'Payment success']);
}
//// end
try {
$res = $client->request('POST', $this->epay['apiurl'] . 'mapi.php', ['form_params' => $data]);

View File

@ -9,10 +9,20 @@ use App\Models\User as ModelUser;
use App\Utils\Tools;
//use App\Services\DB;
use App\Services\Cron;
use App\Command\Cron as CommandCron;
final class Test extends Base
{
// id1778 测试员test1可着它嚯嚯
public function cron($aParam)
{
$sFunc = $aParam["aArg"][1];
$job = new Cron();
return $job->$sFunc();
}
public function smtpClearDayCount()
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 MiB

Binary file not shown.

View File

@ -6,7 +6,7 @@ ALTER TABLE user_invite_code
ADD COLUMN `is_admin` tinyint(1) DEFAULT 0;
ALTER TABLE product
ADD COLUMN `type_by_time` int(11) DEFAULT 0;
ADD COLUMN `class_time` int(11) DEFAULT 0;
ALTER TABLE node
ADD COLUMN `online_user_date_last` datetime DEFAULT NULL;
@ -52,7 +52,7 @@ node加字段
===================================================
ALTER TABLE product ADD type_by_time INT DEFAULT 0;
ALTER TABLE product ADD class_time INT DEFAULT 0;
ALTER TABLE user_coupon ADD name VARCHAR(255) NOT NULL AFTER id;
.config添加$_ENV['geoUrl']