This commit is contained in:
Your Name
2026-03-19 12:19:00 +08:00
parent 7832514f28
commit 7147c8e148
243 changed files with 1662 additions and 437 deletions
@@ -0,0 +1,16 @@
<?php
use think\migration\Migrator;
use think\migration\Migration;
class AddOrderTradeNo extends Migration
{
public function change()
{
$table = $this->table('la_order');
if (!$table->hasColumn('trade_no')) {
$table->addColumn('trade_no', 'string', ['limit' => 64, 'null' => true, 'comment' => '支付平台交易号', 'after' => 'payment_time'])
->update();
}
}
}
@@ -0,0 +1,20 @@
<?php
use think\migration\Migrator;
use think\migration\Migration;
class AddOrderWechatPayeePayer extends Migration
{
public function change()
{
$table = $this->table('la_order');
if (!$table->hasColumn('payee_userid')) {
$table->addColumn('payee_userid', 'string', ['limit' => 64, 'null' => true, 'comment' => '收款人企业微信userid', 'after' => 'creator_id'])
->update();
}
if (!$table->hasColumn('payer_external_userid')) {
$table->addColumn('payer_external_userid', 'string', ['limit' => 128, 'null' => true, 'comment' => '付款人企业微信客户external_userid', 'after' => 'payee_userid'])
->update();
}
}
}
@@ -0,0 +1,17 @@
<?php
use think\migration\Migrator;
use think\migration\Migration;
/**
* 企业微信直接收款时自动创建订单,patient_id 可为空(待关联患者)
*/
class AllowOrderPatientNull extends Migration
{
public function change()
{
$this->table('la_order')
->changeColumn('patient_id', 'integer', ['null' => true, 'comment' => '患者ID(诊单ID),空表示待关联'])
->update();
}
}
@@ -0,0 +1,5 @@
-- 订单表增加收款人、付款人字段(企业微信对外收款同步用)
-- 将 zyt_ 替换为你的表前缀(.env 中 PREFIX
ALTER TABLE `zyt_order` ADD COLUMN `payee_userid` VARCHAR(64) NULL COMMENT '收款人企业微信userid' AFTER `creator_id`;
ALTER TABLE `zyt_order` ADD COLUMN `payer_external_userid` VARCHAR(128) NULL COMMENT '付款人企业微信客户external_userid' AFTER `payee_userid`;