支付完成回调
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use think\Model;
|
||||
use think\model\relation\BelongsTo;
|
||||
|
||||
@@ -13,4 +14,17 @@ class Payment extends Model
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes : 订单支付完成后续操作
|
||||
*
|
||||
* @Date : 2022/9/13 15:41
|
||||
* @Author : <Jason.C>
|
||||
*/
|
||||
public function paid()
|
||||
{
|
||||
$this->paid_at = Carbon::now(); // 更新支付时间为当前时间
|
||||
$this->status = 1;
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user