获取平安核销的订单号
This commit is contained in:
@@ -33,11 +33,11 @@ class Log extends Model
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
if (!$this->table) {
|
||||
$this->table = 'api_log_' . date('Ym');
|
||||
if (! $this->table) {
|
||||
$this->table = 'api_log_'.date('Ym');
|
||||
}
|
||||
|
||||
if (!Schema::hasTable($this->table)) {
|
||||
if (! Schema::hasTable($this->table)) {
|
||||
Schema::create($this->table, function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('path', 255);
|
||||
@@ -62,6 +62,7 @@ class Log extends Model
|
||||
|
||||
/**
|
||||
* 为数组 / JSON 序列化准备日期。
|
||||
*
|
||||
* @param \DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
@@ -70,4 +71,15 @@ class Log extends Model
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 关联优惠券
|
||||
*
|
||||
* @Author: 玄尘
|
||||
* @Date: 2022/1/19 11:24
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function coupon()
|
||||
{
|
||||
return $this->hasOne(Coupon::class, 'redemptionCode', 'coupon_no');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user