51 lines
1.8 KiB
PHP
51 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* @package AKSRT
|
|
*/
|
|
|
|
namespace AKSRT\Core;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
trait DBMigratorPart3 {
|
|
|
|
|
|
/**
|
|
* 表名访问器(其它模块通过此函数取,避免散落硬编码)。
|
|
*/
|
|
public static function table(string $name): string {
|
|
global $wpdb;
|
|
$allowed = [
|
|
'credit_log' => 'aksrt_credit_log',
|
|
'balance_log' => 'aksrt_balance_log',
|
|
'signin_log' => 'aksrt_signin_log',
|
|
'dl_token' => 'aksrt_dl_token',
|
|
'notification' => 'aksrt_notification',
|
|
'conversation' => 'aksrt_conversation',
|
|
'conv_message' => 'aksrt_conversation_message',
|
|
'order' => 'aksrt_order',
|
|
'order_item' => 'aksrt_order_item',
|
|
'revenue' => 'aksrt_revenue',
|
|
'withdrawal' => 'aksrt_withdrawal',
|
|
'report' => 'aksrt_report',
|
|
'follow' => 'aksrt_follow',
|
|
'coupon' => 'aksrt_coupon',
|
|
'charge_card' => 'aksrt_charge_card',
|
|
'rebate_log' => 'aksrt_rebate_log',
|
|
'affiliate_relation' => 'aksrt_affiliate_relation',
|
|
'commission_ledger' => 'aksrt_commission_ledger',
|
|
'commission_adjustment' => 'aksrt_commission_adjustment',
|
|
'payout_account' => 'aksrt_payout_account',
|
|
'coupon_usage' => 'aksrt_coupon_usage',
|
|
'user_restriction' => 'aksrt_user_restriction',
|
|
'identity_application' => 'aksrt_identity_application',
|
|
'identity_event' => 'aksrt_identity_event',
|
|
'vip_membership_event' => 'aksrt_vip_membership_event',
|
|
];
|
|
if (!isset($allowed[$name])) {
|
|
return '';
|
|
}
|
|
return $wpdb->prefix . $allowed[$name];
|
|
}
|
|
}
|