This commit is contained in:
2022-09-09 17:03:30 +08:00
parent 7f930b2287
commit 0270a2ca32
2 changed files with 35 additions and 13 deletions

21
app/model/Payment.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
namespace app\model;
use think\Model;
use think\model\relation\BelongsTo;
class Payment extends Model
{
protected $autoWriteTimestamp = true;
public function onBeforeInsert()
{
$this->trade_no = time();
}
public function orders(): BelongsTo
{
return $this->belongsTo(Order::class);
}
}