Files
heping-api/app/model/Payment.php
2022-09-09 17:03:30 +08:00

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);
}
}