增加核销途径
This commit is contained in:
@@ -10,6 +10,11 @@ class Activity extends Model
|
||||
|
||||
use BelongsToUser;
|
||||
|
||||
protected $dates = [
|
||||
'start_at',
|
||||
'end_at',
|
||||
];
|
||||
|
||||
const TYPE_EXTEND = 1;
|
||||
const TYPE_SCOPE = 2;
|
||||
const TYPES = [
|
||||
@@ -24,9 +29,11 @@ class Activity extends Model
|
||||
self::STATUS_CLOSE => '关闭',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'start_at',
|
||||
'end_at',
|
||||
const CHANNEL_YSD = 1;
|
||||
const CHANNEL_UNION = 2;
|
||||
const CHANNELS = [
|
||||
self::CHANNEL_YSD => '亿时代',
|
||||
self::CHANNEL_UNION => '银联',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -51,7 +58,7 @@ class Activity extends Model
|
||||
}
|
||||
|
||||
//活动状态
|
||||
public function getStatusTextAttribute()
|
||||
public function getStatusTextAttribute(): string
|
||||
{
|
||||
return self::STATUS[$this->status] ?? '未知';
|
||||
}
|
||||
@@ -100,7 +107,12 @@ class Activity extends Model
|
||||
{
|
||||
|
||||
try {
|
||||
$code = 'YSD' . date('ymd') . mt_rand(100000, 999999);
|
||||
//判断生成何种码
|
||||
if ($this->channel == self::CHANNEL_UNION) {
|
||||
$code = '66406' . date('ymdH') . mt_rand(1000000, 9999999);
|
||||
} else {
|
||||
$code = 'YSD' . date('ymd') . mt_rand(100000, 999999);
|
||||
}
|
||||
|
||||
if ($this->type == SELF::TYPE_EXTEND) {
|
||||
$start_at = now();
|
||||
|
||||
Reference in New Issue
Block a user