积分与余额账务系统硬切重构

This commit is contained in:
2026-08-24 15:59:11 +08:00
parent ca12226b39
commit 5cae5b5c93
159 changed files with 7275 additions and 4718 deletions
+9 -9
View File
@@ -255,9 +255,9 @@ class PayCoupons {
$id = \AKSRT\Payment\Coupon::get_instance()->create([
'code' => sanitize_text_field((string) wp_unslash($_POST['code'] ?? '')),
'type' => sanitize_key((string) wp_unslash($_POST['type'] ?? 'fixed')),
'value' => (float) ($_POST['value'] ?? 0),
'min_amount' => (float) ($_POST['min_amount'] ?? 0),
'max_discount' => (float) ($_POST['max_discount'] ?? 0),
'value' => trim((string) wp_unslash($_POST['value'] ?? '0')),
'min_amount' => trim((string) wp_unslash($_POST['min_amount'] ?? '0')),
'max_discount' => trim((string) wp_unslash($_POST['max_discount'] ?? '0')),
'usage_limit' => (int) ($_POST['usage_limit'] ?? 0),
'per_user_limit' => (int) ($_POST['per_user_limit'] ?? 0),
'product_scope' => $this->parse_product_scope_from_request(),
@@ -281,9 +281,9 @@ class PayCoupons {
if (class_exists('\AKSRT\Payment\Coupon')) {
$result = \AKSRT\Payment\Coupon::get_instance()->batch_create([
'type' => sanitize_key((string) wp_unslash($_POST['type'] ?? 'fixed')),
'value' => (float) ($_POST['value'] ?? 0),
'min_amount' => (float) ($_POST['min_amount'] ?? 0),
'max_discount' => (float) ($_POST['max_discount'] ?? 0),
'value' => trim((string) wp_unslash($_POST['value'] ?? '0')),
'min_amount' => trim((string) wp_unslash($_POST['min_amount'] ?? '0')),
'max_discount' => trim((string) wp_unslash($_POST['max_discount'] ?? '0')),
'usage_limit' => (int) ($_POST['usage_limit'] ?? 0),
'per_user_limit' => (int) ($_POST['per_user_limit'] ?? 0),
'product_scope' => $this->parse_product_scope_from_request(),
@@ -315,9 +315,9 @@ class PayCoupons {
if ($id > 0 && class_exists('\AKSRT\Payment\Coupon')) {
$ok = \AKSRT\Payment\Coupon::get_instance()->update($id, [
'type' => sanitize_key((string) wp_unslash($_POST['type'] ?? 'fixed')),
'value' => (float) ($_POST['value'] ?? 0),
'min_amount' => (float) ($_POST['min_amount'] ?? 0),
'max_discount' => (float) ($_POST['max_discount'] ?? 0),
'value' => trim((string) wp_unslash($_POST['value'] ?? '0')),
'min_amount' => trim((string) wp_unslash($_POST['min_amount'] ?? '0')),
'max_discount' => trim((string) wp_unslash($_POST['max_discount'] ?? '0')),
'usage_limit' => (int) ($_POST['usage_limit'] ?? 0),
'per_user_limit' => (int) ($_POST['per_user_limit'] ?? 0),
'product_scope' => $this->parse_product_scope_from_request(),