zhifu
This commit is contained in:
21
app/model/Payment.php
Normal file
21
app/model/Payment.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user