21 lines
340 B
PHP
21 lines
340 B
PHP
<?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);
|
|
}
|
|
} |