40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
defined('ABSPATH') || exit;
|
|
|
|
trait AKSRT_DB_Migrator_Part_3 {
|
|
|
|
|
|
/**
|
|
* 表名访问器(其它模块通过此函数取,避免散落硬编码)。
|
|
*/
|
|
public static function table(string $name): string {
|
|
global $wpdb;
|
|
$allowed = [
|
|
'credit_log' => 'aksrt_credit_log',
|
|
'signin_log' => 'aksrt_signin_log',
|
|
'invite' => 'aksrt_invite',
|
|
'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',
|
|
'after_sale' => 'aksrt_after_sale',
|
|
'order_shipping' => 'aksrt_order_shipping',
|
|
'charge_card' => 'aksrt_charge_card',
|
|
'rebate_log' => 'aksrt_rebate_log',
|
|
'coupon_usage' => 'aksrt_coupon_usage',
|
|
'card_key' => 'aksrt_card_key',
|
|
];
|
|
if (!isset($allowed[$name])) {
|
|
return '';
|
|
}
|
|
return $wpdb->prefix . $allowed[$name];
|
|
}
|
|
}
|