elf 1 year ago
parent 6f34aae8d2
commit 206d11c81b

@ -47,7 +47,7 @@ class MineCommand extends HyperfCommand
public function handle(): void
{
$this->getBalance();
$this->transferWithdraw();
$this->getRequestData();
return;
// $this->notify('http://ceshi-shop.hkcpex.com/index.php/pay/notify/baofu_f_register', $this->getApp(), ['userId' => '30684']);
$this->notify('http://ceshi-shop.hkcpex.com/index.php/pay/notify/baofu_f_bind_card', $this->getApp(), ['userId' => '23121', 'bindCardFlag' => true]);
@ -136,6 +136,21 @@ class MineCommand extends HyperfCommand
]
],
];
$data = [
'userId' => 'ELF1990',
'accountName' => '廖金灵',
'outApplyNo' => time() . rand(1000, 9999),
'amount' => '1',
'summary' => '测试',
'notifyUrl' => 'http://124.223.222.61:9501/notify/test-notify'
];
$data = [
'userId' => 'ELF1990',
'agreementNo' => '312023082200002060225',
'outWithdrawNo' => time() . rand(1000, 9999),
'amount' => '1',
'notifyUrl' => 'http://124.223.222.61:9501/notify/test-notify'
];
$params = [
'app_id' => $app->app_id,
'nonce_str' => StringHelper::getRandomString(16),

@ -6,7 +6,7 @@ namespace App\Model;
class Withdraw extends Model
{
protected $table = 'withdraw';
protected $table = 'withdraws';
public function app()
{

@ -14,7 +14,7 @@ class WithdrawApply extends Model
public const STATUS_SUCCESS = 'SUCCESS';
public const STATUS_FAILED = 'FAILED';
protected $table = 'withdraw_apply';
protected $table = 'withdraw_applies';
public function app()
{

@ -630,6 +630,7 @@ class PaymentService extends AbstractService
$withdraw->out_withdraw_no = $data['outWithdrawNo'];
$withdraw->amount = $data['amount'];
$withdraw->status = 'PREPARE';
$withdraw->applied_at = date('Y-m-d H:i:s');
$withdraw->notify_url = $data['notifyUrl'];
$withdraw->save();
@ -669,6 +670,7 @@ class PaymentService extends AbstractService
$withdraw->status = $params['status'];
$withdraw->fee = $params['fee'];
$withdraw->fee_acc = $params['fee_acc'] ?? '';
$withdraw->finished_at = $params['finished_at'] ?? null;
$withdraw->save();
return $withdraw;
}

@ -234,3 +234,57 @@ add column `remark` varchar(255) NOT NULL DEFAULT '' after return_url;
alter table orders
add column `channel_id` varchar(32) NOT NULL DEFAULT '' after market_info,
add column `channel_app_id` varchar(32) NOT NULL DEFAULT '' after market_info;
CREATE TABLE `withdraws` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`app_id` varchar(16) NOT NULL COMMENT '应用ID',
`member_id` varchar(32) NOT NULL,
`user_id` varchar(32) NOT NULL,
`withdraw_no` varchar(32) NOT NULL,
`out_withdraw_no` varchar(32) NOT NULL,
`amount` int(11) NOT NULL DEFAULT 0,
`agreement_no` varchar(32) NOT NULL DEFAULT '',
`fee` int(11) NOT NULL DEFAULT 0,
`fee_acc` tinyint(1) NOT NULL DEFAULT 0,
`withdraw_url` varchar(255) NOT NULL DEFAULT '',
`applied_at` datetime DEFAULT NULL,
`notify_url` varchar(255) NOT NULL DEFAULT '',
`status` varchar(16) NOT NULL DEFAULT '',
`error_code` varchar(64) NOT NULL DEFAULT '',
`error_message` varchar(120) NOT NULL DEFAULT '',
`finished_at` datetime DEFAULT NULL,
`third_withdraw_no` varchar(32) NOT NULL DEFAULT '',
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_appid` (`app_id`) USING BTREE,
KEY `idx_memberid` (`member_id`) USING BTREE,
KEY `idx_createdat` (`created_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;
CREATE TABLE `withdraw_applies` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`app_id` varchar(16) NOT NULL COMMENT '应用ID',
`member_id` varchar(32) NOT NULL,
`user_id` varchar(32) NOT NULL,
`apply_no` varchar(32) NOT NULL,
`batch_num` varchar(32) NOT NULL,
`out_apply_no` varchar(32) NOT NULL,
`amount` int(11) NOT NULL DEFAULT 0,
`fee` int(11) NOT NULL DEFAULT 0,
`account_name` varchar(32) NOT NULL DEFAULT '',
`summary` varchar(255) NOT NULL DEFAULT '',
`applied_at` datetime DEFAULT NULL,
`notify_url` varchar(255) NOT NULL DEFAULT '',
`status` varchar(16) NOT NULL DEFAULT '',
`error_code` varchar(64) NOT NULL DEFAULT '',
`error_message` varchar(120) NOT NULL DEFAULT '',
`third_apply_no` varchar(32) NOT NULL DEFAULT '',
`third_batch_num` varchar(32) NOT NULL DEFAULT '',
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_appid` (`app_id`) USING BTREE,
KEY `idx_memberid` (`member_id`) USING BTREE,
KEY `idx_createdat` (`created_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;
Loading…
Cancel
Save